Make offer (build typed-data)
GET/v1/actions/midnight/make
MAKE — step 1 of 2. Build the EIP-712 typed-data for a limit offer at your own rate.
Morpho Midnight is an order-book lender — liquidity is a book of maker offers, not a pool — so there are two ways to interact:
- TAKE (fill existing offers): use the standard lending actions, which route to Midnight automatically for a
MORPHO_MIDNIGHT_<id>market. There is no separate "take" endpoint.- lend →
/v1/actions/lending/deposit— fills the ask side (supply offers) - borrow →
/v1/actions/lending/borrow— fills the bid side (demand offers) - repay / withdraw →
/v1/actions/lending/repay·/withdraw - Read the live two-sided ladder from
/v1/data/lending/latest?includeOffers=true— each order-book market's loan leg carriesoffers(bids) andlendOffers(asks), best-first, with per-levelaprPct,assets, andcumulativeAssets.
- lend →
- MAKE (post your own limit offer at a chosen rate): the endpoints in this section (
/v1/actions/midnight/*) plus/v1/data/lending/midnight/open-offersto list and cancel them.
Make flow (worker-assisted signing):
GET /v1/actions/midnight/make→ returnstypedData, the echoedinputs, and a one-timeauthorizationtx.- The maker signs
typedDatawith their wallet (wallet.signTypedData). POST /v1/actions/midnight/finalizewith{ inputs, signature }→ the on-chain transaction that publishes the offer to the Midnight mempool.
If authorization is present and the maker has not yet authorized the ratifier (read isAuthorized on-chain), send that one-time setIsAuthorized transaction before finalizing. The APR you request is snapped to an order-book tick — aprPctSnapped is the exact rate the offer will quote.
Request
Responses
- 200
- 400
Offer typed-data, echoed inputs, and one-time authorization
Validation error