First run the quickstart: sign in, then link and set up an account on each venue you supply or price. What each venue asks of a maker: market making. In TypeScript: the provisioning and bot scripts.

Create the credential

With the master session, POST /v1/credentials:
  • quote_signer is the address of a separate EOA key (quotes).
  • expires_at is Unix seconds, at most 90 days ahead.
  • The answer’s token (mk_…) is returned once: it goes to the quoting host. Its id is the quote identity ID.
What each bearer can call: authentication.

Fund a pool

Escrow venues (Hyperliquid, Polymarket, GMX), with the master session; the linked account signs.
  1. Persist a new client_request_id.
  2. POST /v1/maker/{venue}/prepare:
  3. Check funding and every to_sign item (maker capital, signing). Sign each with its signer.
  4. Before expires_at, send one signature per item to POST /v1/maker/preparations/{id}/signatures: {"signatures":[{"kind":"fund","signature":"0x…"}]}.
  5. Poll GET /v1/maker/preparations/{id} until state is complete (the pool is live) or failed (the order’s error says why).
On Lighter and Aster, nothing is funded: open the pool instead. On GMX, funding_source is wallet: move GMX Account funds to the linked address first with your own transferOut (margin transfers). Deliveries and releases land in GMX Accounts.

Quote

With the credential as $MAKER_TOKEN and its id as $IDENTITY_ID.
  1. Read the identity’s quote lines and their revision with GET /v1/quote-lines, and its pools with GET /v1/orders (capital_pool: true, with available_to_quote).
  2. Renew the lease, 5 to 120 seconds:
  3. Prepare every line, one per venue. valid_until is Unix seconds within the next five minutes; expected_revision is the lines’ revision.
  4. Rebuild each draft from your lines before signing (quote lines, signing). Sign each draft’s single quote_set item with the quote key.
  5. Publish {"preparation_id":"…","signatures":[{"draft_id":"…","signature":"0x…"}]} with POST /v1/quote-lines, within five minutes of preparation, before valid_until and while the lease is live. Every pool switches at once, or none.
  6. Repeat: renew the lease before it expires and publish again before valid_until. After a funding, publish again once the pool is live.
Follow pools and fills with a snapshot and replay. Stop with cancellation.

Deliver on Lighter

Deadlines and refusals: active market making.
  1. Accept each new fill with POST /v1/fills/{id}/accept before maker_accept_by. Accept only a fill you can deliver.
  2. Once the fill is PAID with payment_verified_at set, read your transfer fee: GET https://mainnet.zklighter.elliot.ai/api/v1/transferFeeInfo?account_index=<yours>&to_account_index=<delivery_to>, authenticated by your API key. Lighter charges it on top of the amount and refuses a transfer signed with another fee.
  3. Sign one transfer:
  4. Persist the signed transfer and its hash, then send it.
  5. Once Lighter shows it executed, report it with POST /v1/fills/{id}/delivery {"tx_hash":"…"} before report_by. Report again after 425 or 502; 400 and 409 are final, except not_due before the payment locks.
Never sign a second transfer for a fill, or reuse a nonce, while a transfer is pending or of unknown outcome. A transfer that moved nothing (refused on first send, status 0 or above 3, or unexecuted at its expiry) may be replaced before deliver_by, at the nonce Lighter’s nextNonce returns. After a restart, resend or report what you persisted before signing anything new.

Deliver on Aster

  1. Accept each new fill with POST /v1/fills/{id}/accept before maker_accept_by.
  2. Keep the inventory in the Spot wallet, or move it there from margin: POST https://fapi.asterdex.com/fapi/v3/asset/wallet/transfer, kindType FUTURE_SPOT, by an agent with canPerpTrade. Keep the account public: Aster refuses a private account’s transfers.
  3. Once the fill is PAID with payment_verified_at set, send POST https://chainapi.asterdex.com/aster-chain/v3/transfer?asset=USDT&amount=…&toAddress=…&clientTranId=…&nonce=…&user=…&signature=…:
  4. Report the reply’s transferId with POST /v1/fills/{id}/delivery {"tx_hash":"…"} until accepted, before report_by. 425 means the Spot histories do not show it yet.
  • A lost answer is resent with the same clientTranId within a minute of its nonce: Aster returns the first transfer and moves nothing more.
  • 032209 Daily transfer limit exceeded means the Spot wallet holds too little.
  • Never send one fill’s transfer under another fill’s ID.