Terms: concepts.

Trust model

The operator key sends every escrow transaction LaMarge relays and pays its gas.
  • It reads the taker’s escrow payment at the chain’s final head (finalized by default; the head itself on Arbitrum), then pays the taker from the maker’s pool on the other chain, under the maker’s signed quote: the delivery.
  • A payment from Lighter or Aster is a signed transfer the operator sends first (paying from Lighter).
  • It keeps each fill’s secret, which releases the payment to the maker, and shows it to the maker once the fill is delivered.
  • On Lighter and Aster the maker delivers; the operator claims the payment for the maker once the delivery report is accepted, by report_by. A claim not landed by t2 lets the payment return to the taker, even after a delivery (active market making).
The escrows cannot see the other chain. A stolen operator key can deliver inventory under any unexpired quote signature and return a delivered fill’s payment to its taker before the maker claims it. A secret leaked before the delivery lets anyone release the payment to the maker early, the delivery still owed. Each chain’s escrow is a UUPS proxy. Only the governance key can upgrade it, through a timelock set to zero delay during the closed beta; the operator has no upgrade authority. Governance therefore controls every escrow balance and allowance to it. Under the current implementation, owners withdraw their funds on chain (recovery): the available balance at once, a pool after a one-day notice. Payments stay locked at most 24 hours.

Venues and balances

  • The tokens are distinct assets: never add their base units.
  • The escrow spends an allowance only on actions its owner signs.
  • LaMarge’s Aster agent holds only canPerpTrade: it reads the account and moves margin to the account’s own Spot wallet.
  • A taker receiving on Lighter or Aster needs a linked account, and on Aster the agent. A taker paying from there signs a transfer (Lighter, Aster).
  • setup in /v1/me and /v1/balances lists each account’s setup steps with what each is needed_for.

Opening an account

Lighter and Aster create an account at its first deposit, and LaMarge pays into them inside the venue: an account receives only once opened. LaMarge never makes that deposit.
  • An account is open when its /v1/balances row has read_at, no error and has_account true. balance.changed announces each read; an account linked within the hour and still unopened is read every 30 seconds.
  • Lighter links before its first deposit, with venue_wallet null until the deposit creates the master account. Until then its api_key step is required, and takes to or from it answer STATE_CONFLICT with reason no_deposit. Deposit at least 1 USDC through deposit on Lighter’s Ethereum contract, or at least 5 USDC to the intent address Lighter’s POST /api/v1/createIntentAddress returns for the owner (CCTP chains, Arbitrum and HyperEVM among them). A wallet delivery with max_parts 1 can pay that address. Get the address from Lighter yourself: LaMarge does not vouch for it.
  • Aster answers takes to an account without a deposit with STATE_CONFLICT and reason no_deposit. Anyone can open it: depositFor(USDT, owner, amount, 0) on Aster’s BSC vault 0x128463A60784c4D3f46c23Af3f65Ed859Ba87974: 0.000001 USDT is enough.
  • Polymarket links only once the signer has a Deposit Wallet or Safe (WALLET_NOT_FOUND).

Balances

GET /v1/balances returns one row per linked account: holdings.total on that venue’s side, of which holdings.available can move or be committed now and holdings.locked is the rest. Each amount appears once:
  • xyz is set for a standard Hyperliquid account (mode default, disabled or dexAbstraction), which holds trade.xyz, the HIP-3 dex xyz, apart from its perps. A unified or portfolio-margin account’s one balance covers its perps, spot and trade.xyz: xyz is null.
  • A pool’s held_in tells where its held is: escrow, or venue for a Lighter or Aster pool, whose figure is its account’s balance and never adds to equity.
  • Pools another operator funded are read on chain by GET /v1/escrow with in_balances false: add them to the total.
  • Venue values carry read_at and error, chain values chain_read_at and chain_error: check each pair on its own.
The available balance holds settlement receipts, refunded payments, refused venue deposits and tokens swept from deposit_address.
  • Tokens there are swept once they reach one token, or in any amount within an hour of a withdrawal relayed there.
  • Takes pay from it first, and maker capital uses it first.
  • A maker’s receipts go there. A taker’s receipts are deposited into the destination venue.
  • A fill’s payment_destination and maker_destination read venue, or escrow when kept in the available balance.

Margin transfers

  1. Prepare {venue, amount, to}.
  2. Sign the returned typed data with the linked account.
  3. Relay it within ten minutes of preparation.
  • An Aster withdrawal takes two signatures of the account at chain 56: the Action, then its envelope, signed at most 50 seconds before the relay.
  • to: "account" with recipient sends to another existing account on the same venue (kind send): Hyperliquid’s SendAsset; Aster’s wallet-signed transfer (clientTranId starting with s, relayed within 50 seconds, no envelope, no fee); Polymarket’s internal transfer, an Op whose message.data hashes the returned op. Rebuild that hash from op and check its recipient and amount before signing: the wallet shows only the hash. On Polymarket the recipient is the Perps account’s owner address.
  • On a standard Hyperliquid account, dex: "xyz" withdraws or sends from trade.xyz instead of the perps. A withdrawal’s from_dex reads xyz when it left trade.xyz. A Hyperliquid delivery lands on the perps, never on trade.xyz.
  • relayed is the venue’s acknowledgement, not arrival. A Polymarket withdrawal or Hyperliquid transfer the venue did not answer stays queued and is sent again, unchanged, within its two minutes. unknown may have reached the venue: it blocks further transfers on that venue until it is resolved. A Polymarket withdrawal resolves from Polymarket’s exchange: relayed once it executes, refused a little over an hour after signing if it never did. Never sign another transfer to work around it.

Maker capital

Escrow venues. Lighter and Aster pools: active market making. A pool (capital_pool: true) is the escrow inventory of one owner, venue and quote identity.
  • The operator pays each delivery from it once the taker’s payment is final. Through the API, releasing it is immediate; on chain, it takes a one-day notice (recovery).
  • Its 32-byte ID, the escrow offerId, comes from its first preparation and is reused by every later one.
  • The quote identity fixes its quote signer: the master address for the browser identity, else the credential’s quote_signer. Another signer needs a new credential and new capital.
POST /v1/maker/{venue}/prepare adds amount to the pool of quote_identity_id (the browser identity when omitted):
  • funding splits amount into idle_amount (available balance, used first), then wallet_amount or venue_amount, by funding_source. A GMX pool funds from the wallet only: move GMX Account funds there first with your own transferOut. existing_available is the pool’s available_to_quote plus the available balance.
  • to_sign holds a fund item, and a margin_move item when venue_amount is above zero. For the browser identity, a quote_set item re-signs the pool’s current quotes, scaled to what remains.
  • Check them (signing) and submit every signature before expires_at: one hour, ten minutes with a margin_move.
Rules:
  • The first funding is at least 5 tokens.
  • Adding capital is refused while a fill of the pool is reserved, or another funding, take payment or escrow withdrawal of the owner is pending on that venue. It pauses the pool’s admissions until it lands or the preparation ends.
  • Submission answers STATE_CONFLICT, cancelling the preparation, when the pool’s revision changed (a fill or a publication). It answers FORBIDDEN when the identity’s generation changed or, with a quote_set item, its lease lapsed: delete the preparation. Stop quoting a pool before preparing its funding; resume after submission.
  • Each funding raises the pool’s on-chain quote floor to minQuoteSequence, revoking every older set. The preparation’s quote_set, when it has one, replaces it; otherwise the pool has no set until its quote key publishes one.
A preparation ends:
  • complete: the pool is live.
  • cancelled (DELETE, expiry or a changed revision): the pool returns to its prior state (closed for a new one).
  • failed: its margin transfer or funding did not land. A first funding leaves the pool failed with an error; a top-up restores its previous state and prices.

Releasing capital

  • POST /v1/escrow/withdraw/prepare prepares an owner-signed escrow_withdrawal of amount from one pool or the available balance (order_id zero), to the venue margin (to_margin: true) or to the owner’s address. POST /v1/escrow/withdraw relays it. GET /v1/escrow lists what this can release.
  • A pool keeps quoting what remains: it releases only its available_to_quote, what its reserved fills leave, and quotes without the amount until the withdrawal lands. All of it closes the pool.
  • A pool another operator funded releases only once its owner’s exit notice has run (409 STATE_CONFLICT before).
  • POST /v1/closes closes up to 50 pools. Empty ones close at once; the others need one close_orders item signed by the master, then submitted. Once every reserved fill is delivered or abandoned, the operator releases the funds into the owner’s venue margin; a Lighter or Aster pool just closes.
Cancelling quotes releases no capital.

Quote lines

A maker prices venues, not routes. A quote line gives, for one venue:
  • Prices are USDC per unit, from 0.90 to 1.10, eight decimals at most; null leaves a side out.
  • A taker paying on A and receiving on B from one maker gets paid × buy[A] / sell[B]. Two makers’ lines never combine.
  • Publishing replaces all of an identity’s lines at once, for new takes. A take already prepared still executes at the set it was prepared under, within that set’s budget and the pool’s funds, until its pay_by; cancelling quotes withdraws it.
  • Each pool with stock gets a quote set quoting every other line with a buy price whose venue can pay into it. Lighter and Aster never trade directly with each other.
  • Each quote has supply and quote_size the stock, receive = ceil(stock × sell × 10^dA / (buy × 10^dB)) with d each token’s decimals, and the line’s min_fill. Raise min_fill where each delivery costs a fee, as on Lighter.
  • A venue needs no stock to receive. A pool without stock leaves the books. Changing one price re-signs every pool it affects, together.
GET /v1/markets shows each venue’s best lines among the makers the books show, its liquidity and its 24-hour volume. The best buy and the best sell can belong to different makers; a route’s price is always one maker’s pair.

Quotes

Quote lines compile into quote sets. A quote set prices one pool for every destination it quotes, under one ECDSA signature of the pool’s quote signer. The signer is an EOA key: publication refuses a contract’s (ERC-1271) signature, which could be withdrawn once the taker paid. Each quote, named by its position quote_index, has:
  • venue: the destination, never the pool’s venue. The taker pays the recipient there, the maker’s linked account.
  • supply: pool-token base units the quote sells in total under the set.
  • receive: destination-token base units for supply, the exact price. The taker pays ceil(amount_out × receive / supply).
  • min_fill: the smallest fill, in pool-token base units: at least 1 token, at most supply, quote_size and the fill cap, limits.fill_max in /v1/info (millionths of a token).
quote_size is the set’s admission budget, shared by its quotes and not signed.
  • A destination’s levels are drawn best price first. Each shows the smallest of its remaining supply, the set’s remaining quote_size and the pool’s unreserved funds, less output and delivery fees.
  • Every destination draws on the same funds. Each delivery spends signed budget permanently.
  • Books sort by price, then age. A take skips the taker’s own pools.
The server admits takes only under the current set of a live pool, before its valid_until, at its identity’s current generation and, for a credential, while the credential is active and its lease is live.
  • A lease lasts 5 to 120 seconds. Renewing a lapsed one advances the generation: earlier quotes and drafts never return.
  • A credential’s valid_until is at most five minutes ahead. The browser identity has no lease and may use 253402214400, no expiry.
  • The server prepares each set from the lines and allocates its sequence. Publication sends only {draft_id, signature}, within five minutes of preparation, at the same generation and cancel_epoch.
On chain, a signed set stays valid until expiresAt = valid_until + maker_timeout_seconds + 1, while its sequence is at or above the pool’s floor and its budget is unspent. Leases and API cancellation do not revoke it. A stolen quote key can sell the whole pool at any price to a colluding taker: keep funded inventory within strategy limits.

Cancellation

Fills reserved before a cancellation continue and may settle. raiseQuoteFloor(owner, offerId, last_sequence + 1) revokes signed sets on chain. Only the operator can call it before the pool’s exit notice has run; after, the owner or the quote signer can too. The server does not read the floor: set above the server’s next sequence, it makes deliveries under the pool’s later sets and its fundings revert until the server’s sequences reach it. Against a stolen quote key, release the capital.

Maker results

GET /v1/me/stats’s maker is what your pools received less what they delivered, over every fill with a claimed leg: a payment once claimed, a delivery and its fee once delivered. Each token is valued at your mark there, the mid of the line’s buy and sell, or its one price (a fill without a mark for both its tokens values each at 1): the spread your prices captured, apart from what holding the tokens gains or loses. daily sums it per UTC day, pairs per paying and delivering venue.

Takes

A taker needs linked accounts on both venues, or only on the paying one for a wallet delivery.
  1. POST /v1/takes: amount_in is the most paid, min_out the least received in total, max_parts 1 to 8. The server walks the book, one fill per price level, each capped at fill_max and at what the take left of its pool’s funds, skipped below its min_fill. Together the fills must reach the to venue’s release_minimum (GET /v1/venues).
  2. The fills are PREPARED: exact terms, no maker liquidity reserved. Check the single pay_take item and sign it before pay_by, then submit it. Its deposit pulls what the available balance lacks from the linked address; each LockPayment pays one fill under its hashlock.
  3. A fill delivered on Lighter or Aster waits for its maker’s acceptance, by maker_accept_by (active market making). A missed acceptance expires the whole take unpaid.
  4. The operator rechecks the quotes, reserves every fill at once (RESERVED) and sends the deposit and every payment in one transaction, or none.
  5. Each fill executes under the quote set it was prepared under: the maker publishing new prices meanwhile does not undo it. A quote cancelled, expired or run out meanwhile expires the take unpaid, with a reason: take again.
  • Before signing, DELETE /v1/takes/{id} cancels the take.
  • When the available balance and the linked address together cannot cover the payment, the take answers PREFUNDING_REQUIRED and reserves nothing.
  • Up to limits.max_unpaid_takes takes may await payment at once, each admitted against what the others hold of the same funds (holdings.committed in balances).
  • A payment already sent keeps its reservation until its outcome is known.
  • A payment whose delivery has not landed by t1 returns to the available balance right after it.
  • Fills settle independently, so the total received can be below min_out.

Fees

Each pair has a taker fee in basis points, the book’s taker_fee_bps; makers pay none.
  • Send max_fee_bps to accept it. A pair whose fee is higher refuses the take (VALIDATION_ERROR, reason fee_above_max). Without it, the take pays no fee.
  • A transfer carries its take’s consent; a route’s second take, then.max_fee_bps. GET /v1/routes prices each leg for the max_fee_bps you pass.
  • The fee is fixed per fill (taker_fee, in taker_fee_venue’s token) and carried by its swap_id, which the escrow reads. Paid from an escrow, it is part of amount_in and the maker receives the rest (maker_in). Paid from Lighter or Aster, the maker’s pool delivers it on top of amount_out (maker_out).
  • Before signing, check that each fill’s taker_fee is the one its swap_id carries (the SDK does).

Wallet funding

funding: "wallet" on a transfer or a take pays only from the payer’s escrow-token wallet and available balance on from’s escrow chain: nothing is withdrawn from the venue account. The default, venue, may withdraw a shortfall. It needs chain.wallet_funding in GET /v1/venues, so never Lighter or Aster.
  • payer defaults to the master, which needs no linked account on from; another payer is the account linked there. Where the take delivers is a separate choice (wallet delivery).
  • GET /v1/wallets/{venue} reads the payer’s wallet and available now, what other payments hold (committed_wallet, committed_available) and the rest (spendable_wallet, spendable_available). Before signing a prepared take, pass its take_id to leave its own hold out.
  • POST /v1/wallets/{venue}/permit with an empty body (or payer) prepares the escrow-token permit; post its ref and signature to the same route. Funds and the permit are checked again at payment.
  • Refunds credit the payer’s available balance. The master reads its own with GET /v1/escrow?owner=<master> and withdraws it to its wallet with that owner, order_id zero and to_margin: false (releasing capital), without a linked account. Retry with the prepared withdrawal, never a new one.

Native USDC on Polygon

Polygon’s escrow token is pUSD. Where chain.wallet_funding.conversion is set, a wallet-funded transfer from Polymarket can pay from native USDC: send conversion: {amount_in, min_out}: the USDC paid, at least 0.01, and the least pUSD credited, at least ceil(amount_in × 9,995 / 10,000), which is also the transfer’s amount_in. Without conversion, it pays pUSD.
  1. Prepare the conversion: it returns its nonce and a deadline 30 minutes ahead. A payer has one open conversion at a time.
  2. Before the wallet prompt, post an empty body: it moves prepared to pending once, across tabs and devices. After a lost answer, never prompt again.
  3. From the payer, approve amount_in of native USDC to the escrow, then send it convertDeposit(amount_in, min_out, nonce, deadline), paying POL gas. Report each broadcast tx_hash, replacements included, to the same route.
  4. The conversion is ready once LaMarge reads its finalized event, reported or not. Until then the take answers STATE_CONFLICT.
The escrow credits the pUSD it measures, at least min_out, to the available balance: anything above amount_in, and any refund, stays there in pUSD. A transfer that replaces this one passes the conversion’s id. Never prepare another conversion to recover an unknown broadcast.

Wallet delivery

A take can transfer what it buys to any address on the receiving escrow’s chain instead of the linked account: send destination: "wallet" and recipient.
  • Only where chain.wallet is set in GET /v1/venues, never on the paying venue’s own chain (its withdrawal does that), and on a route only as the last take (then.destination).
  • No account, setup or release_minimum on to; each part of a take delivers at least chain.wallet.minimum (0.01 USDC on Polygon). The recipient is any address but zero, the escrow, Polygon’s converter, the escrow’s and the wallet’s token contracts and, on HyperEVM, a HyperCore system address.
  • The pay_take signs the recipient as receiveRecipient and the wallet token as receiveToken; each fill’s swap_id starts with a wallet tag (0x1b4c4374729e, or 0xfcb0d9ddb285 with a fee paid inside a venue), which the escrow reads: it pays such a swap id only by transfer, never into a venue. A separate signer reads the recipient and the destination from the take’s attestation (WalletTakeTerms).
  • amount_out, min_out and fees stay in the escrow token. On Polygon each take’s recipient receives at least ceil(amount_out × 9,995 / 10,000); the conversion goes through Polymarket’s offramp (pUSD to USDC.e, 1:1) and a Uniswap v4 USDC.e/USDC pool, and refuses less.
  • The fill then shows maker_destination wallet and received (token, amount, sender): its share of the one transfer per recipient, the escrow (on Polygon the converter) sending it, in the transaction its deliver entry lists.
  • A transfer the token refuses reverts the delivery: an escrow payment returns to the available balance as any undelivered one.

Paying from Lighter

A take from Lighter into an escrow venue is one fill, where the deployment enables it (VALIDATION_ERROR otherwise).
  1. Once per account, do the api_key setup step. The key can place orders but never move funds to another owner. Replaced on Lighter, it is asked for again.
  2. to_sign holds one lighter_transfer. Check on Lighter that to_account_index belongs to the maker’s maker_recipient and from_account_index to you.
  3. Build Lighter’s transfer owner message from its terms, sign it with personal_sign and submit it before pay_by. Your account must hold amount plus usdc_fee, Lighter’s fee, 0 or 1 USDC; the SDK signs no transfer whose fee is above that.
  4. The operator simulates the delivery to you on the escrow. If it would fail, nothing is sent and the fill expires.
  5. Then it signs your transfer with its key and sends it. The fill stays RESERVED until the transfer executes, then is PAID until the delivery, or EXPIRED if it ends unexecuted.
An executed transfer cannot return: the delivery is tried until t1, an hour after the take by default. An account backing a Lighter pool cannot pay.

Paying from Aster

A take from Aster into an escrow venue is one fill, paid from your Spot wallet. LaMarge’s agent moves any shortfall there from your margin.
  1. to_sign holds one aster_transfer, the transfer request itself: Message{msg} at chain 1666, from your address to the maker’s maker_recipient, of amount_in rounded up to six decimals, with the fill ID as clientTranId (32 hex characters) and a nonce 55 seconds ahead. Check those fields. Right before your wallet signs, issue it again with its nonce: the same request with a nonce 55 seconds after now, so a slow review never shortens its life (matched false: you held an older one, call again with the one returned).
  2. Sign it with eth_signTypedData_v4 on chain 1666 (add that network once, with POST /v1/venues/aster/rpc as its RPC URL), then submit it before pay_by.
  3. The operator checks the delivery would land, as from Lighter, then relays your request. Aster accepts it until about a minute after its nonce.
  4. Its execution, shown in both accounts’ Spot histories, starts the delivery to you, tried until t1.
Your account must be public and hold the amount when the transfer is sent. An account backing an Aster pool cannot pay. Two payments failed within 24 hours because of your account (key replaced, balance short, private account) suspend paying from Lighter and Aster (403 FORBIDDEN).

Paying from venue margin

To pay from venue margin on an escrow venue, create a transfer first (from_dex: "xyz" to withdraw from a standard Hyperliquid account’s trade.xyz). Its funding_plan gives the margin transfer still needed, in whole millionths of the token. Prepare it, then:
  • signed_at_once true (your permit done): take with the transfer’s terms, client_take_id and transfer_intent_id right away, then submit the pay_take and the withdrawal’s margin_move signature together. LaMarge sends the withdrawal, then the payment as soon as a chain read shows the funds at the linked address. The take’s pay_by is a route’s (limits.route_pay_window_seconds). Nothing moves unless both are signed.
  • Otherwise submit the withdrawal, wait for relayed and the funds at the linked address, then take.
After a lost response, recover the transfer and its take before computing another shortfall: a payment may already have spent the wallet balance.

Routes through another venue

No take joins Lighter and Aster. GET /v1/routes (session) returns the best route now: one take, or two through an intermediate venue when that pays at least 10 bps more.
  1. Create the first transfer with then: the final venue, your account there, the second amount_in and its minimum.
  2. Once its take can deliver nothing more, continuable shows what arrived, less what continuations hold and the next payment’s fee.
  3. Create the second from the intermediate venue with previous_transfer_id, for at most continuable. A continuation that never took is replaced by the next.
The two takes are not atomic: the second is priced after the first delivers, and the funds wait in your account on the intermediate venue. Cancelling the first, once final, ends the route. Taken take by take, the second transfer pays from your account on the intermediate venue, as any transfer from there: from Hyperliquid or Polymarket it first withdraws from that account, from Lighter or Aster its take pays from it. That account signs these requests, whatever venue the route started from.

Grouped routes

A route whose first take pays from Lighter or Aster through an escrow venue can be grouped: signed at once.
  1. With the first take prepared and unsigned, prepare the route. LaMarge creates the second transfer and prepares its take, priced on the book now, for what the first take delivers.
  2. Sign the first take’s request and the second take’s pay_take, the requests this preparation returns: for Aster prepared with reissue, the pay_take first, then the Aster request issued again right before you sign it (sign the one that call returns).
  3. Commit them together before commit_by.
  4. Each fill either take delivers on Lighter or Aster waits for its maker’s acceptance. Then both takes’ pools are reserved together, just before the first payment.
  5. The first take is delivered into your available balance on the intermediate chain, and LaMarge pays the second take from it. Nothing is left to sign.
  • For Aster, preparation gives the first take about 90 seconds until commit_by. Prepare with {"reissue": true}, sign the second take’s pay_take first, then issue the Aster request again and sign it last: it is sent as soon as you commit. Without reissue, its nonce is dated 20 seconds after commit_by, and the relay waits until 55 seconds before that nonce, so a fast signature can wait about 55 seconds before Aster is paid.
  • grouped_unavailable, TAKE_EXPIRED on the commit, or an abort ends the grouped attempt. Continuing take by take is a separate decision of yours.
  • While the route is prepared or committed, only the route moves its takes and transfers (grouped_route). Your other takes go on; one grouped route is open at a time.
  • Once closed, what is left continues from the first transfer’s continuable, through a successor of the second, paid from your available balance.

Moves and bridges

A move takes amount_in from one endpoint to another and follows every part under one ID. LaMarge’s makers fill first, at the floor rate min_out / amount_in; an external bridge, Relay, carries the rest when LaMarge lacks liquidity or a route. Each part’s floor is its share of min_out, rounded up. GET /v1/moves/quote plans it: lamarge (a route and its budget), bridge (an estimate), what neither carries (unallocated) and why a part is missing (lamarge_unavailable, bridge_unavailable). Nothing is reserved.
  1. Create the move with its terms; the same client_move_id returns it.
  2. Run LaMarge’s part as a transfer with move_id (a route’s first transfer only).
  3. Once its payment is accepted (from a wallet: once paid), create the bridge for the rest, and check every payload against its order before signing.
    • From Hyperliquid: sign the nonce mapping and the SendAsset the order names, from the bridge’s source_dex ("" perps for a standard account, spot for a unified one), then submit both.
    • From a wallet: fence, approve the depository when short, deposit, report each hash.
    • From Polymarket or GMX: first move amount_in to your wallet with move_id (a withdrawal or a GMX withdrawal), then bridge with from_wallet.
  4. Close the move with what no part carries. It is settling until every part is final, then final.
  • LaMarge returns an order only when it pays and refunds no one but the move’s payer and recipient, through the provider’s pinned contracts, and its id is its hash. Check it again from your own terms before you sign, as the SDKs do: your signature should not rest on the API alone.
  • A Polymarket, GMX or Aster account receives the bridge’s whole output, at least account_credit, the part’s floor (Polymarket: at least 5 pUSD); wallet_surplus is zero.
  • Bridge states: prepared, submitting, pending, then completed, refunded (refund says what and where) or stuck (contact the provider with request_id); failed and expired debited nothing. A fenced deposit never expires: report unsent only when the wallet refused before broadcasting.
  • The provider’s solver holds the funds between the deposit and the fill or the refund; LaMarge never holds them and signs nothing for you. Refunds go to the payer, or on the destination chain to the recipient, in an asset the provider chooses.
  • Not bridged yet: from Lighter, from Aster, from a portfolio-margin Hyperliquid account (hyperliquid_mode). LaMarge’s own part still serves them.

Deadlines and outcomes

  • Defaults count from the take’s preparation. /v1/info reports the deployment’s timings (pay_window_seconds; route_pay_window_seconds for a grouped route’s second take and a take signed at once); each fill carries its own.
  • A fill delivered on Lighter or Aster adds maker_accept_by, deliver_by and report_by (deadlines).
  • Admission stops while chain observations, escrow integrity, operator gas or relay capacity are not ready (OPERATOR_UNAVAILABLE).
A fill ends SETTLED, EXPIRED, REFUNDED, TAKER_LOSS or MAKER_LOSS. payment_leg and maker_leg give each side’s state.
  • MAKER_LOSS: a delivery whose payment was refunded unclaimed.
  • TAKER_LOSS: a payment that could no longer return (executed on Lighter or Aster, or claimed early) and was not delivered by t1.
Each fill is delivered on its own, so a take can settle in part.
  • A fill undelivered into an escrow venue by t1 is abandoned. LaMarge returns its payment to the payer’s available balance at once, or, from a minute before t2, by the ordinary refund after it.
  • A fill abandoned on Lighter or Aster, its delivery not reported in time, returns early only with its maker’s consent. The maker prepares it, verifies both chains, signs RefundPayment with its wallet and submits it with its master session. It credits the payer’s available balance on the source chain; otherwise the payment waits for t2.
  • If the operator stops, payments and claims are recoverable on chain (recovery).
A fee replacement changes a transaction’s hash: follow the resource’s state, not the first hash.

Signing

SIWE and link messages, lighter_api_key and lighter_transfer use personal_sign. Every other item uses EIP-712, aster_transfer at chain 1666. An authenticated response is no reason to sign: compare each item with your own request and configuration first. @lamarge/sdk/protocol implements these checks.
  • Escrow items (fund, quote_set, pay_take, refund_payment, escrow_withdrawal, close_orders) use domain LaMarge, version 1, their venue’s escrow chain and the escrow pinned for it (deployment values). close_orders always uses HyperEVM’s.
  • A fill delivered on Lighter or Aster has its pay_take and refund_payment in the paying venue’s domain.
  • A Lighter or Aster pool’s quote_set uses that venue’s chain ID and contract from the deployment values (Lighter’s contract, Aster’s vault), where nothing is sent, with the pool’s linked address as owner. Each quote names its destination’s chain, token and your linked account there.
A quote_set signs, under primaryType QuoteSet:

Deployment values

Pin these from this page, never from /v1/info or /v1/venues.