settlement in GET /v1/venues.
Steps over HTTP: maker quickstart. In TypeScript: SDK.
What to follow
Where a pool’s funds are:
held and held_in (balances).
Passive market making
- Fund a pool.
- Publish quote lines and keep the lease alive.
- For each fill, the operator waits for the taker’s payment to be final, pays the taker from your pool, then claims the payment for you (deadlines).
- GMX’s escrow on Arbitrum acts at the chain’s head, without waiting for Ethereum finality: a payment the sequencer later reorders away is not undone. Price that risk in your GMX quotes.
- A taker paying from Lighter or Aster pays your linked account there; the server reads that transfer before the delivery. On Lighter it accepts transfers the sequencer executed before Ethereum proves them; the deployment’s fill cap bounds that risk.
- Your pool pays deliveries the operator vouches for, under your signed quotes: the escrow cannot see the payment on the other chain (trust model).
- Once a fill is delivered (
maker_legCLAIMED), itssecretis in your fills (GET /v1/fills). It lets you claim the payment yourself (recovery). - Release capital through the API (releasing capital), or on chain after a one-day notice (recovery).
Active market making
The maker delivers each fill itself, by a transfer inside Lighter or Aster:- The taker signs. Each fill delivered on Lighter or Aster gets
maker_accept_by, at most 15 seconds later. - The maker accepts it with
POST /v1/fills/{id}/accept. The taker’s payment waits for every fill of the take to be accepted; one missed deadline expires the whole take unpaid. - The operator reserves the fills (
RESERVED) and sends the payment. Once it is locked and verified, the fill isPAIDwithpayment_verified_atset. - The maker transfers
amount_outtodelivery_to, executed bydeliver_by. - The maker reports the transfer with
POST /v1/fills/{id}/deliverybeforereport_by. - The operator claims the payment for the maker. The fill’s
secretlets the maker claim it too (recovery).
Before quoting
- Sign in once with your master address, then ask LaMarge on Telegram or Discord to approve it (and to grant access while access is by invitation). Unapproved, a pool or line preparation answers
MAKER_NOT_APPROVED. - On each escrow venue you buy on, link an account and complete its setup. It is the
recipientof your quotes there. - Hold the inventory in an account owned by a dedicated address. Its key signs every delivery from the bot’s host, where the master key never goes. It can withdraw the whole account: keep there only what the bot may deliver.
- On Lighter, register an API key for that account with Lighter’s
ChangePubKey, signed by the owner, at an unused index from 4 to 252 (253 and 254 are LaMarge’s). Read the account’s fee per transfer (how): 0 or 1 USDC so far; the order’sdelivery_feeshows the fee the server last read. A Standard account allows 60 requests a minute. - Open the pool with
POST /v1/maker/{venue}/prepare,"funding_source":"venue". Nothing is signed: the preparation iscompleteand the poolliveat once. One account backs one pool. - Publish quote lines: the pool’s venue with
sellandstock, and abuyprice on each escrow venue you receive on.
amount is a cap that deliveries consume. Within it, the pool offers what the account could transfer at the last balance read, less delivery_fee for each reserved fill and the next one; nothing once that read is two minutes old.
Bot loop
- Renew the lease and publish lines. A pool whose identity’s lease was last renewed over two minutes ago leaves the book; back, the bot signs its quotes again.
- Follow the identity’s fills over the stream, from a snapshot.
- Accept each fill with
maker_accept_byset andmaker_accepted_atnull, beforemaker_accept_by, while it can deliver. - Deliver each
PAIDfill withpayment_verified_atset, the earliestdeliver_byfirst: one transfer ofamount_outtodelivery_to, never a second for the same fill (Lighter, Aster). - Report each executed transfer (on Aster, its
transferId). - When it cannot deliver, stop accepting and stop quoting first.
- To stop: stop accepting, cancel quotes, then keep delivering and reporting until no accepted fill is owed anything.
AsterDeliverer and LighterDeliverer do steps 3 to 5 and accept only while their journal saves and no delivery’s outcome is unknown.
A fill to accept, then deliver, as GET /v1/fills returns it (fields the bot reads):
Deadlines
Each fill carries its deadlines: read them, never compute them.settlement.delivery in /v1/info gives the deployment’s offsets and min_status, the Lighter status a delivery needs.
A report is accepted until
report_by, also once the leg is ABANDONED. Consenting to an early refund (refundPayment) gives up the payment, and no report is accepted after it: check your journal and the venue first.
With Lighter’s Python or WebAssembly signer, which cannot set the expiry at deliver_by, send nothing within a minute of deliver_by.
A refused report with 425 or 502 is sent again with the same hash; 400 and 409 are final, except not_due before the payment locks (reasons).
Retiring a pool
- Close it with
POST /v1/closes; signclose_ordersunless itsheldis 0. - It closes at once when
heldis 0, otherwise once no fill awaits delivery. Accepted fills stay owed; reports are accepted until each fill’sreport_by.
amount to a live pool’s cap and keeps its quotes. On a closed pool it reopens it without quotes, with a cap of what it delivered plus that amount.
LaMarge can withdraw an approval: the maker’s pools leave the books at once; fills already reserved stay owed.