openapi: 3.1.0 info: title: LaMarge API version: 1.0.0 description: >- Makers publish short-lived quotes; takers reserve and pay cross-venue fills. The operator is trusted across chains ([trust model](/how-it-works#trust-model)). Routes are under `/v1` except `/health` and `/share` ([conventions](/api-reference/overview#conventions)). Any route may answer the shared `RateLimited` (429) and `Internal` (500) responses ([errors](/api-reference/overview#errors)). servers: - url: https://api.lamarge.trade description: API for this documentation environment. tags: - {name: Market data} - {name: Link previews} - {name: Authentication} - {name: Credentials} - {name: Account} - {name: Orders} - {name: Quotes} - {name: Closes} - {name: Escrow} - {name: Transfers} - {name: Takes and fills} - {name: Withdrawals} - {name: Events and recovery} - {name: Admin} security: [] paths: /share/v1/{filename}: get: tags: [Link previews] summary: Get a site sharing image operationId: getSiteShareImage description: Public 1200 by 630 PNG; both filenames return the same image. Cacheable for one hour. parameters: - name: filename in: path required: true schema: {type: string, enum: [landing.png, app.png]} responses: '200': description: Social card image. content: {image/png: {schema: {type: string, format: binary}}} '404': {description: Unknown image., content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} /share/trade: get: tags: [Link previews] summary: Get explorer sharing metadata operationId: getTradeShareMetadata description: >- HTML head tags for a trade's explorer page, absolute URLs on the primary app origin; generic tags for a missing, invalid or unpublished trade or a lookup over two seconds. Not cached. parameters: - name: trade in: query schema: {type: string} responses: '200': description: Escaped title, description, canonical URL, Open Graph and card tags. content: {text/html: {schema: {type: string}}} /v1/venues: get: tags: [Market data] summary: List venues description: >- Every venue in display order, with its settlement terms, token, permit domain, margin-transfer format and deposit minimum, all null when disabled. Check them against the [deployment values](/how-it-works#deployment-values) before signing. operationId: getVenues parameters: - name: all in: query required: false deprecated: true schema: {type: boolean, default: false} description: Ignored. responses: '200': description: Every venue, enabled or not. content: {application/json: {schema: {type: array, items: {$ref: '#/components/schemas/Venue'}}}} /v1/venues/aster/rpc: post: tags: [Market data] summary: Aster signing network description: >- RPC URL of chain 1666 (`0x682`), which a wallet adds with `wallet_addEthereumChain` to sign an Aster transfer: wallets sign typed data only for their current chain. It answers only `eth_chainId` and `net_version`; other methods get JSON-RPC error -32601. operationId: postAsterSigningRpc requestBody: required: true content: {application/json: {schema: {}}} responses: '200': description: The JSON-RPC answer, or answers for a batch. content: {application/json: {schema: {}}} '400': {$ref: '#/components/responses/ValidationError'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '415': {description: 'Body not sent as `Content-Type: application/json`.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} /v1/books: get: tags: [Market data] summary: Get a book description: >- Levels the taker pays on `from` and receives on `to`; they are not reservations. A level is a quote that [admits takes](/how-it-works#quotes), with a signed expiry at least the maker timeout away and `min(available, max_fill)` at least `min_fill`. With a Hyperliquid `from`, or a Lighter or Aster pool (approved makers only), the maker's balance must have been read within two minutes ([before quoting](/market-making#before-quoting)); such a pool also leaves the book once its bot's lease is two minutes old ([bot loop](/market-making#bot-loop)). operationId: getBook parameters: - name: from in: query required: true description: The venue the taker pays on. schema: {$ref: '#/components/schemas/VenueId'} - name: to in: query required: true description: The venue the taker receives on. schema: {$ref: '#/components/schemas/VenueId'} responses: '200': description: The book. content: {application/json: {schema: {$ref: '#/components/schemas/Book'}}} '400': {$ref: '#/components/responses/ValidationError'} '422': {$ref: '#/components/responses/VenueDisabled'} '503': {$ref: '#/components/responses/SnapshotTooLarge'} /v1/routes: get: tags: [Market data] summary: Get the best route description: >- What takes would pay now on `to` for `amount_in` on `from`, reserving nothing: one take, or two through another venue when no direct take is possible (Lighter and Aster) or finds nothing, or when two pay at least 10 bps more and spend no less ([routes](/how-it-works#routes-through-another-venue)). Where the second take carries less than the first delivers, the first shrinks to fit; with `min_out`, a route under that price shrinks to the largest amount that meets it, rather than none. Takes are admitted as `POST /v1/takes` admits them, your own orders excluded, but without its access check and `limits.max_unpaid_takes`; no route goes through Lighter without a linked account and a known fee, nor through Polymarket where your account holds funds but can withdraw none. A refusal of paying from `from` or delivering on `to` is the answer; without a route, so is the first refusal met, of the direct take or of an intermediate venue, else `INSUFFICIENT_LIQUIDITY`. operationId: getRoute security: [{session: []}] parameters: - name: funding in: query schema: {$ref: '#/components/schemas/Funding'} - name: from in: query required: true description: The venue the taker pays on. schema: {$ref: '#/components/schemas/VenueId'} - name: to in: query required: true description: The venue the taker receives on. schema: {$ref: '#/components/schemas/VenueId'} - name: destination in: query description: '`wallet` prices a wallet delivery on `to`: no deposit minimum, `minimum_received` set.' schema: {$ref: '#/components/schemas/Destination'} - name: amount_in in: query required: true description: Most the taker pays, in `from` base units. schema: {$ref: '#/components/schemas/Amount'} - name: min_out in: query required: false description: >- Least the taker receives for `amount_in`, in `to` base units: the worst price it takes. A smaller amount is held to the same price, in proportion. schema: {$ref: '#/components/schemas/Amount'} - name: max_fee_bps in: query required: false description: >- The highest taker fee the takes would accept: each leg is priced at its pair's fee, a leg whose fee is higher left out, as the take would refuse it. Without it, legs pay no fee, as takes without `max_fee_bps` do. schema: {$ref: '#/components/schemas/FeeBps'} - name: all in: query required: false deprecated: true schema: {type: boolean, default: false} description: Ignored. responses: '200': description: The route. content: {application/json: {schema: {$ref: '#/components/schemas/Route'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {description: '`FORBIDDEN`: paying from a venue is suspended after failed payments.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '409': {description: '`INSUFFICIENT_LIQUIDITY`: no route takes this amount.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '422': {$ref: '#/components/responses/VenueDisabled'} '503': {description: '`OPERATOR_UNAVAILABLE`, retryable: settlement is not ready for new commitments; or `SNAPSHOT_TOO_LARGE`.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} /v1/trades/{id}/proof: get: tags: [Market data] summary: Get signed trade proof operationId: getTradeProof description: >- The settled trade's signed maker `QuoteSet`, funding authorization (`FundOffer`, or the delivery for a Lighter or Aster pool) and taker `PayTake` (or the executed `payment` when paid from Lighter or Aster), with digests and relayed transactions. Public once all three are recorded. parameters: [{$ref: '#/components/parameters/Id'}] responses: '200': description: Signed maker and taker agreements. content: {application/json: {schema: {$ref: '#/components/schemas/TradeProof'}}} '400': {$ref: '#/components/responses/ValidationError'} '404': {description: '`NOT_FOUND`: unknown, unsettled or unpublished trade.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} /v1/volume: get: tags: [Market data] summary: Get 24h volume description: Public trades between `a` and `b`, either way, settled in the last 24 hours, in `b` base units. operationId: getVolume parameters: [{$ref: '#/components/parameters/PairA'}, {$ref: '#/components/parameters/PairB'}] responses: '200': description: The pair's 24-hour volume. content: {application/json: {schema: {$ref: '#/components/schemas/Volume'}}} '400': {$ref: '#/components/responses/ValidationError'} '422': {$ref: '#/components/responses/VenueDisabled'} /v1/markets: get: tags: [Market data] summary: Get venue prices description: >- Per enabled venue, among the quote identities whose quotes the books show: `best_buy`, the highest price a maker pays to receive the venue's token there, and `best_sell`, the lowest it asks to deliver it there, in USDC ([quote lines](/how-it-works#quote-lines)); its `liquidity` and `volume_24h`. An answer is reused for two seconds. operationId: getMarkets responses: '200': description: The venues in registry order. content: {application/json: {schema: {$ref: '#/components/schemas/Markets'}}} '503': {$ref: '#/components/responses/SnapshotTooLarge'} /health: get: tags: [Market data] summary: Health description: Settlement readiness; 503 with the same body when a chain is not `ready`. operationId: getHealth responses: '200': description: Every chain is ready. content: {application/json: {schema: {$ref: '#/components/schemas/Health'}}} '503': description: Not ready for new settlement commitments. content: {application/json: {schema: {$ref: '#/components/schemas/Health'}}} /v1/info: get: tags: [Market data] summary: Get deployment info operationId: getV1Info description: >- API version, limits, settlement timings, operator, deployments and access mode. Not a signing trust root: compare with independently reviewed configuration. responses: '200': description: The deployment. content: {application/json: {schema: {$ref: '#/components/schemas/Info'}}} /v1/auth/challenge: post: tags: [Authentication] summary: Request a sign-in message description: >- A one-use EIP-4361 message for the master address, valid ten minutes, on the request's `Origin` if allowed, else the main app origin. Check domain, URI, address and expiry before `personal_sign`. operationId: postAuthChallenge requestBody: required: true content: application/json: schema: type: object required: [address] properties: address: $ref: '#/components/schemas/Address' description: The master address. additionalProperties: false responses: '200': description: The message to sign. content: {application/json: {schema: {$ref: '#/components/schemas/Challenge'}}} '400': {$ref: '#/components/responses/ValidationError'} '413': {$ref: '#/components/responses/PayloadTooLarge'} /v1/auth/verify: post: tags: [Authentication] summary: Verify a signed message description: >- Consumes the challenge and returns a revocable master session; a failed attempt leaves the challenge usable. The first sign-in creates the user; beyond 32 active sessions, the oldest are revoked. operationId: postAuthVerify requestBody: required: true content: application/json: schema: type: object required: [address, nonce, signature] properties: address: {$ref: '#/components/schemas/Address'} nonce: {type: string} signature: {$ref: '#/components/schemas/Signature'} additionalProperties: false responses: '200': description: The session. content: {application/json: {schema: {$ref: '#/components/schemas/Session'}}} '400': {$ref: '#/components/responses/BadSignature'} '413': {$ref: '#/components/responses/PayloadTooLarge'} /v1/auth/sessions/{id}: delete: tags: [Authentication] summary: Revoke a master session operationId: deleteV1AuthSessionsId description: >- Revokes one of the user's sessions, the current one included; a repeat answers 204. Credentials are unaffected. security: [{session: []}] parameters: [{$ref: '#/components/parameters/Id'}] responses: '204': description: Revoked. '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {$ref: '#/components/responses/NotFound'} /v1/me: get: tags: [Account] summary: Get my account description: The master address, its linked venue accounts and its access. operationId: getMe security: [{session: []}] responses: '200': description: The user. content: {application/json: {schema: {$ref: '#/components/schemas/Me'}}} '401': {$ref: '#/components/responses/Unauthenticated'} /v1/partner/admissions: post: tags: [Account] summary: Admit an address for a partner x-excluded: true description: >- Server to server: admits the address without a code or captcha, also before its first sign-in, and records the partner as who admitted it. An address already admitted is returned unchanged. A suspended user is not restored (`STATE_CONFLICT`); only an admin does that. Without `PARTNER_KEYS` the route does not exist (`NOT_FOUND`). With `PARTNER_ALLOWED_IPS`, a call from another address is `FORBIDDEN`. operationId: postPartnerAdmissions security: [{partnerKey: []}] requestBody: required: true content: application/json: schema: type: object required: [address] properties: {address: {$ref: '#/components/schemas/Address'}} additionalProperties: false responses: '200': description: The address's admission. content: {application/json: {schema: {$ref: '#/components/schemas/PartnerAdmission'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {description: '`UNAUTHENTICATED`: missing or unknown partner key.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '403': {description: '`FORBIDDEN`: the caller''s address is not in `PARTNER_ALLOWED_IPS`.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '404': {description: '`NOT_FOUND`: no partner is configured.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '409': {description: '`STATE_CONFLICT`: the user is suspended.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '413': {$ref: '#/components/responses/PayloadTooLarge'} /v1/access/redeem: post: tags: [Account] summary: Redeem an access code x-excluded: true description: >- Admits the master user and counts one use of the code, read as Crockford base32 (case and hyphens ignored, O as 0, I and L as 1). `captcha` is required, and checked first, when `GET /v1/info` names a site key. An unknown, revoked, expired or exhausted code is `VALIDATION_ERROR`. An already admitted user or an admin does not use up the code. operationId: postAccessRedeem security: [{session: []}] requestBody: required: true content: application/json: schema: type: object required: [code] properties: code: type: string description: The access code, `XXXX-XXXX-XXXX`. captcha: type: string maxLength: 2048 description: A Cloudflare Turnstile token for the deployment's site key. additionalProperties: false responses: '200': description: The user, with its access. content: {application/json: {schema: {$ref: '#/components/schemas/Me'}}} '400': {description: '`VALIDATION_ERROR`, or `CAPTCHA_FAILED` for a missing, refused or unverifiable captcha token.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {description: '`FORBIDDEN`: the user is suspended.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '413': {$ref: '#/components/responses/PayloadTooLarge'} /v1/accounts/link/challenge: post: tags: [Account] summary: Request a link message description: >- The EIP-191 message `address` signs to prove it controls the venue account: single use, valid ten minutes, not needed for the master address. operationId: postLinkChallenge security: [{session: []}] requestBody: required: true content: application/json: schema: type: object required: [venue, address] properties: venue: {$ref: '#/components/schemas/VenueId'} address: $ref: '#/components/schemas/Address' description: Owner of the venue account; signs its transfers. additionalProperties: false responses: '200': description: The message to sign. content: {application/json: {schema: {$ref: '#/components/schemas/Challenge'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/AccessRequired'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '422': {$ref: '#/components/responses/VenueDisabled'} /v1/accounts/{venue}/setup: parameters: - {name: venue, in: path, required: true, schema: {$ref: '#/components/schemas/VenueId'}} get: tags: [Account] operationId: getVenueSetup summary: Read account setup description: >- The linked account's setup steps, each read from the venue now: one the venue shows is recorded `done` ([setup steps](/quickstart#setup-steps)). A permit prepared but not signed carries its `to_sign`. security: [{session: []}] responses: '200': description: The steps. content: {application/json: {schema: {$ref: '#/components/schemas/VenueSetup'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/AccessRequired'} '422': {$ref: '#/components/responses/AccountNotLinked'} '502': {$ref: '#/components/responses/VenueUnavailable'} /v1/accounts/{venue}/setup/{step}: parameters: - {name: venue, in: path, required: true, schema: {$ref: '#/components/schemas/VenueId'}} - name: step in: path required: true description: One of the venue's steps (`permit`, `agent`, `api_key`). schema: {type: string} post: tags: [Account] operationId: postVenueSetupStep summary: Prepare or submit a setup step description: >- With `{}`, the request the linked address signs for the step, in `to_sign`, unless the step is done or pending ([setup steps](/quickstart#setup-steps)). With its `ref` and the `signature`, submits it: Aster's agent is `done` at once, the permit and Lighter's key `pending` until the venue shows them. security: [{session: []}] requestBody: required: true content: application/json: schema: type: object properties: ref: {type: string, description: The prepared request's `ref`.} signature: {$ref: '#/components/schemas/Signature'} additionalProperties: false responses: '200': description: The step. content: {application/json: {schema: {$ref: '#/components/schemas/SetupStep'}}} '400': {$ref: '#/components/responses/BadSignature'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/AccessRequired'} '404': {description: '`NOT_FOUND`: the venue has no such step, or no such prepared permit.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '409': {description: '`STATE_CONFLICT` once the permit expired, or with `reason` `no_deposit` for Lighter''s key before the account''s first deposit; `FILL_IN_PROGRESS` while a payment from Lighter may still use its key''s nonce.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '413': {$ref: '#/components/responses/PayloadTooLarge'} '422': {$ref: '#/components/responses/AccountNotLinked'} '502': {description: '`VENUE_UNAVAILABLE`, or `VENUE_REJECTED` when the venue refuses the step.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} /v1/accounts/link: post: tags: [Account] summary: Link a venue account description: >- One account per venue. The master address links without `nonce` or `signature`; another address sends the link challenge's. `setup` lists the steps left ([setup](/api-reference/account/setup)); relinking another address drops the steps done for the previous one. `venue_wallet` is the signer's Polymarket wallet, without one `WALLET_NOT_FOUND`, or the Lighter master account index, null until the address's first deposit ([opening an account](/how-it-works#opening-an-account)). operationId: postLink security: [{session: []}] requestBody: required: true content: application/json: schema: type: object required: [venue, address] properties: venue: {$ref: '#/components/schemas/VenueId'} address: {$ref: '#/components/schemas/Address'} nonce: type: string description: From the link challenge; omitted for the master address. signature: $ref: '#/components/schemas/Signature' description: The link message signed by `address`; omitted for the master address. additionalProperties: false responses: '200': description: The linked account. content: {application/json: {schema: {$ref: '#/components/schemas/LinkedAccount'}}} '400': {$ref: '#/components/responses/BadSignature'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/AccessRequired'} '409': {$ref: '#/components/responses/AccountInUse'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '422': {description: '`WALLET_NOT_FOUND` or `VENUE_DISABLED`.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '502': {$ref: '#/components/responses/VenueUnavailable'} /v1/accounts/{venue}: delete: tags: [Account] summary: Unlink a venue account description: >- `ACCOUNT_IN_USE` while an order on or quoting the venue is not `closed` (close `failed` ones too) or a fill or withdrawal is unfinished. Works on a disabled venue. operationId: deleteLink security: [{session: []}] parameters: [{name: venue, in: path, required: true, schema: {$ref: '#/components/schemas/VenueId'}}] responses: '204': description: Unlinked. '401': {$ref: '#/components/responses/Unauthenticated'} '404': {description: '`NOT_FOUND`: no account linked on that venue.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '409': {$ref: '#/components/responses/AccountInUse'} /v1/direct: post: tags: [Transfers] summary: Prepare a direct deposit or GMX withdrawal operationId: createDirectOperation security: [{session: []}] description: >- No maker or quote; `owner` sends the transaction and pays gas. A deposit goes from its wallet into `recipient`'s linked account on `venue`, in the escrow token or, on Polygon, native USDC converted into at least `min_out` pUSD; a GMX withdrawal goes from its GMX Account to its own wallet. Persist `client_operation_id` first: the same terms return the operation, before any access, capability or link check. requestBody: required: true content: {application/json: {schema: {$ref: '#/components/schemas/DirectRequest'}}} responses: '200': {description: Existing operation., content: {application/json: {schema: {$ref: '#/components/schemas/DirectOperation'}}}} '201': {description: Prepared operation., content: {application/json: {schema: {$ref: '#/components/schemas/DirectOperation'}}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {description: '`ACCESS_REQUIRED`: a new operation without access; an exact retry returns the operation first.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '404': {$ref: '#/components/responses/NotFound'} '409': {$ref: '#/components/responses/StateConflict'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '422': {$ref: '#/components/responses/AccountNotLinked'} '502': {description: '`VENUE_UNAVAILABLE`: the chain''s head or, for a withdrawal, the owner''s nonce could not be read; retry.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} /v1/direct/{id}: parameters: [{name: id, in: path, required: true, schema: {$ref: '#/components/schemas/Uuid'}}] get: tags: [Transfers] summary: Read a direct operation operationId: getDirectOperation security: [{session: []}] description: >- Readable whatever access or links became. `confirmed`: accepted on chain, before HyperCore's asynchronous credit. A deposit is matched by its nonce, hash reported or not; a GMX withdrawal whose hash is lost stays `pending`: never resend it. responses: '200': {description: Current operation., content: {application/json: {schema: {$ref: '#/components/schemas/DirectOperation'}}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {$ref: '#/components/responses/NotFound'} '409': {description: '`STATE_CONFLICT`: a pending GMX withdrawal''s transaction already belongs to another operation.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '502': {description: '`VENUE_UNAVAILABLE`: a pending GMX withdrawal''s transactions could not be read; retry.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} post: tags: [Transfers] summary: Fence or report a direct transaction operationId: reportDirectOperation security: [{session: []}] description: >- An empty body, once, before the wallet prompt, fences other tabs and devices; after a lost answer, never prompt again. Then report each `tx_hash`, replacements included: a hint, only matching chain evidence confirms. requestBody: required: true content: application/json: schema: type: object properties: tx_hash: {$ref: '#/components/schemas/Bytes32'} additionalProperties: false responses: '200': {description: Current operation., content: {application/json: {schema: {$ref: '#/components/schemas/DirectOperation'}}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {description: '`ACCESS_REQUIRED`: an empty body without access.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '404': {$ref: '#/components/responses/NotFound'} '409': {$ref: '#/components/responses/StateConflict'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '422': {description: '`ACCOUNT_NOT_LINKED`, or `SETUP_REQUIRED` with `venue` and `step`: for an empty body, the owner or a deposit''s recipient is no longer linked, or the recipient''s setup is not done.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '502': {description: '`VENUE_UNAVAILABLE`: the reported transaction or its receipt could not be read; retry.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} /v1/direct/{id}/funding: get: tags: [Transfers] summary: Read direct operation funds operationId: getDirectFunding security: [{session: []}] parameters: [{name: id, in: path, required: true, schema: {$ref: '#/components/schemas/Uuid'}}] responses: '200': description: Fresh token balance and allowance; GMX Account balance for withdrawals. content: application/json: schema: type: object required: [owner, token, spender, balance, allowance, block, observed_at] properties: owner: {$ref: '#/components/schemas/Address'} token: {$ref: '#/components/schemas/Address'} spender: {$ref: '#/components/schemas/Address'} balance: {$ref: '#/components/schemas/Amount'} allowance: {$ref: '#/components/schemas/Amount'} block: {type: integer} observed_at: {type: string, format: date-time} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {$ref: '#/components/responses/NotFound'} '502': {description: '`VENUE_UNAVAILABLE`: the chain read failed, was stale or changed block; retry.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} /v1/moves/quote: get: tags: [Transfers] summary: Plan a move operationId: quoteMove security: [{session: []}] description: >- What LaMarge's makers fill now and what an external bridge would carry of the rest, at the floor rate `min_out / amount_in` ([moves](/how-it-works#moves-and-bridges)). A plan, not a reservation: each part is quoted again before signing. A refusal only LaMarge's part meets (no route, no liquidity, an Aster account without a deposit…) is `lamarge_unavailable`; the bridge's, `bridge_unavailable`. parameters: - {name: from, in: query, required: true, schema: {$ref: '#/components/schemas/MoveVenue'}} - {name: from_chain_id, in: query, schema: {type: integer}, description: 'With `from: wallet`.'} - {name: from_token, in: query, schema: {$ref: '#/components/schemas/Address'}, description: 'With `from: wallet`.'} - {name: to, in: query, required: true, schema: {$ref: '#/components/schemas/MoveVenue'}} - {name: to_chain_id, in: query, schema: {type: integer}, description: 'With `to: wallet`.'} - {name: to_token, in: query, schema: {$ref: '#/components/schemas/Address'}, description: 'With `to: wallet`.'} - {name: amount_in, in: query, required: true, schema: {$ref: '#/components/schemas/Amount'}} - {name: min_out, in: query, required: true, schema: {$ref: '#/components/schemas/Amount'}} - {name: payer, in: query, schema: {$ref: '#/components/schemas/Address'}, description: The master address when omitted.} - {name: recipient, in: query, required: true, schema: {type: string}, description: 'An address; on `to: lighter`, the Lighter account index.'} - {name: max_fee_bps, in: query, schema: {$ref: '#/components/schemas/FeeBps'}} responses: '200': {description: The plan., content: {application/json: {schema: {$ref: '#/components/schemas/MoveQuote'}}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '422': {$ref: '#/components/responses/AccountNotLinked'} /v1/moves: post: tags: [Transfers] summary: Create a move operationId: createMove security: [{session: []}] description: >- Records the move's terms, the one ID that follows every part: LaMarge transfers, the withdrawals that feed a bridge, and bridges. Reserves and moves nothing. The same `client_move_id` and terms return the move. requestBody: required: true content: {application/json: {schema: {$ref: '#/components/schemas/MoveRequest'}}} responses: '200': {description: Existing move., content: {application/json: {schema: {$ref: '#/components/schemas/Move'}}}} '201': {description: Created., content: {application/json: {schema: {$ref: '#/components/schemas/Move'}}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {description: '`ACCESS_REQUIRED`: a new move without access.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '409': {$ref: '#/components/responses/StateConflict'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '422': {$ref: '#/components/responses/AccountNotLinked'} /v1/moves/{id}: parameters: [{name: id, in: path, required: true, schema: {$ref: '#/components/schemas/Uuid'}}] get: tags: [Transfers] summary: Read a move operationId: getMove security: [{session: []}] description: Every attached part and the move's state; each part's own view holds its details. responses: '200': {description: The move., content: {application/json: {schema: {$ref: '#/components/schemas/Move'}}}} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {$ref: '#/components/responses/NotFound'} /v1/moves/{id}/close: parameters: [{name: id, in: path, required: true, schema: {$ref: '#/components/schemas/Uuid'}}] post: tags: [Transfers] summary: Close a move operationId: closeMove security: [{session: []}] description: >- Declares that no part will be added, with what no part carries. Idempotent with the same body; refused while a bridge is `prepared`. Then the move is `settling` until every part is final. requestBody: required: true content: application/json: schema: type: object required: [unallocated] properties: unallocated: {$ref: '#/components/schemas/Amount'} unallocated_reason: {type: [string, 'null'], maxLength: 64} additionalProperties: false responses: '200': {description: The move., content: {application/json: {schema: {$ref: '#/components/schemas/Move'}}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {$ref: '#/components/responses/NotFound'} '409': {$ref: '#/components/responses/StateConflict'} /v1/moves/{id}/bridges: parameters: [{name: id, in: path, required: true, schema: {$ref: '#/components/schemas/Uuid'}}] post: tags: [Transfers] summary: Create a bridge operationId: createBridge security: [{session: []}] description: >- Quotes the external bridge for `amount_in` of the move, from a Hyperliquid or wallet origin or, with `from_wallet`, from the payer's wallet on the origin chain (after a withdrawal from Polymarket or GMX), and returns its order to check and sign. The move's bridges not `failed`, `expired` or `refunded` stay within its `amount_in`. The same `client_bridge_id` and terms return the bridge. requestBody: required: true content: {application/json: {schema: {$ref: '#/components/schemas/BridgeRequest'}}} responses: '200': {description: Existing bridge., content: {application/json: {schema: {$ref: '#/components/schemas/Bridge'}}}} '201': {description: Quoted bridge., content: {application/json: {schema: {$ref: '#/components/schemas/Bridge'}}}} '400': {description: '`VALIDATION_ERROR`: no bridge leaves this origin (Lighter, Aster, or Polymarket and GMX without `from_wallet`), or `from_wallet` is not a token on the origin''s chain; `reason` `unsupported` when the bridge provider refuses the route.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {description: '`ACCESS_REQUIRED`: a new bridge without access; an existing one is returned first.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '404': {$ref: '#/components/responses/NotFound'} '409': {description: '`STATE_CONFLICT`: the move is closed, its bridges would exceed its `amount_in`, a client id reused with other terms, the provider''s nonce already used (create the bridge again), or `reason` `hyperliquid_mode` for a portfolio-margin Hyperliquid account or one in an unsupported mode; `SLIPPAGE`: the bridge''s guaranteed output is below the part''s floor.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '413': {$ref: '#/components/responses/PayloadTooLarge'} '422': {$ref: '#/components/responses/AccountNotLinked'} '502': {description: '`VENUE_UNAVAILABLE`: the bridge provider refused or did not answer; `reason` `insufficient_liquidity`, `below_minimum` or `provider_unavailable`.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} /v1/bridges/{id}: parameters: [{name: id, in: path, required: true, schema: {$ref: '#/components/schemas/Uuid'}}] get: tags: [Transfers] summary: Read a bridge operationId: getBridge security: [{session: []}] responses: '200': {description: The bridge., content: {application/json: {schema: {$ref: '#/components/schemas/Bridge'}}}} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {$ref: '#/components/responses/NotFound'} /v1/bridges/{id}/funding: parameters: [{name: id, in: path, required: true, schema: {$ref: '#/components/schemas/Uuid'}}] get: tags: [Transfers] summary: Read bridge deposit funds operationId: getBridgeFunding security: [{session: []}] description: A wallet-origin bridge's fresh token balance and allowance of the payer toward the provider's depository, on the origin chain. responses: '200': description: Fresh token balance and allowance. content: application/json: schema: type: object required: [owner, token, spender, balance, allowance, block, observed_at] properties: owner: {$ref: '#/components/schemas/Address'} token: {$ref: '#/components/schemas/Address'} spender: {$ref: '#/components/schemas/Address'} balance: {$ref: '#/components/schemas/Amount'} allowance: {$ref: '#/components/schemas/Amount'} block: {type: integer} observed_at: {type: string, format: date-time} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {$ref: '#/components/responses/NotFound'} '409': {description: '`STATE_CONFLICT`: a HyperCore bridge, which spends no wallet funds.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '502': {description: '`VENUE_UNAVAILABLE`, `reason` `chain_unread` when LaMarge reads no node of the origin chain (BSC), `chain_unavailable` when it did not answer: retry later.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} /v1/bridges/{id}/signatures: parameters: [{name: id, in: path, required: true, schema: {$ref: '#/components/schemas/Uuid'}}] post: tags: [Transfers] summary: Submit a HyperCore bridge's signatures operationId: signBridge security: [{session: []}] description: >- The payer's signatures of the order's nonce mapping and of the `SendAsset` to the provider's depository from the bridge's `source_dex`, as the SDK rebuilds them from the order. LaMarge registers the mapping, then relays the send as a withdrawal (`withdrawal_id`). Resubmitting the same signatures returns the bridge. requestBody: required: true content: application/json: schema: type: object required: [authorization, send_asset] properties: authorization: {$ref: '#/components/schemas/Signature'} send_asset: {$ref: '#/components/schemas/Signature'} additionalProperties: false responses: '200': {description: The bridge., content: {application/json: {schema: {$ref: '#/components/schemas/Bridge'}}}} '400': {description: '`VALIDATION_ERROR` (also when the account''s mode no longer holds its USDC in `source_dex`), `BAD_SIGNATURE`, or `WITHDRAWAL_EXPIRED` once the send is past its signing window.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {$ref: '#/components/responses/NotFound'} '409': {description: '`STATE_CONFLICT`: the bridge is not a HyperCore one awaiting signatures, its mapping is being registered (`Retry-After`), or the send is refused as a withdrawal would be (an earlier transfer unresolved or still being sent (`Retry-After`), margin short, nonce used); `FILL_IN_PROGRESS` with `reason` `withdrawal_unsigned`: another transfer signed at once from Hyperliquid awaits its signatures (`Retry-After`).', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '422': {description: '`VENUE_DISABLED` while Hyperliquid is disabled, or `ACCOUNT_NOT_LINKED` once the payer is no longer the linked account.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '502': {description: '`VENUE_UNAVAILABLE`: the provider did not confirm the mapping, or was busy (`Retry-After`); resubmit.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} /v1/bridges/{id}/transactions: parameters: [{name: id, in: path, required: true, schema: {$ref: '#/components/schemas/Uuid'}}] post: tags: [Transfers] summary: Fence or report a bridge deposit operationId: reportBridgeTransaction security: [{session: []}] description: >- A wallet-origin bridge. An empty body, before the deposit prompt, fences other tabs and devices; after a lost answer, never prompt again. Only the request that takes the fence succeeds: a second one is `STATE_CONFLICT` with reason `fenced`. Then report each broadcast deposit `tx_hash`, replacements included (at most eight). `unsent: true`, only while no hash is reported, states that the wallet refused before broadcasting: the bridge fails. requestBody: required: true content: application/json: schema: type: object properties: tx_hash: {$ref: '#/components/schemas/Bytes32'} unsent: {type: boolean} additionalProperties: false responses: '200': {description: The bridge., content: {application/json: {schema: {$ref: '#/components/schemas/Bridge'}}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {$ref: '#/components/responses/NotFound'} '409': {$ref: '#/components/responses/StateConflict'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '502': {description: '`VENUE_UNAVAILABLE`: the origin chain did not answer for the reported transaction or its receipt; retry.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} /v1/wallets/{venue}: get: tags: [Accounts] summary: Read wallet funding operationId: getWalletFunding description: >- Fresh escrow-token balances of the payer, net of what its other takes hold ([wallet funding](/how-it-works#wallet-funding)); the master needs no link. On Polygon, also its native USDC balance and allowance toward the escrow (`conversion`). security: [{session: []}] parameters: - {name: venue, in: path, required: true, schema: {$ref: '#/components/schemas/VenueId'}} - {name: payer, in: query, schema: {$ref: '#/components/schemas/Address'}, description: 'Master by default, or the linked source address.'} - {name: take_id, in: query, schema: {$ref: '#/components/schemas/Uuid'}, description: 'Your take, left out of the commitments, to check its funds before signing.'} responses: '200': description: The balances. content: {application/json: {schema: {$ref: '#/components/schemas/WalletFunding'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {$ref: '#/components/responses/NotFound'} '409': {$ref: '#/components/responses/StateConflict'} '422': {$ref: '#/components/responses/AccountNotLinked'} '502': {$ref: '#/components/responses/VenueUnavailable'} /v1/wallets/{venue}/permit: post: tags: [Accounts] summary: Authorize wallet funding operationId: postWalletPermit description: >- The payer's escrow-token `permit`: without `ref` and `signature`, prepares it to sign; with both, submits it ([wallet funding](/how-it-works#wallet-funding)). security: [{session: []}] parameters: - {name: venue, in: path, required: true, schema: {$ref: '#/components/schemas/VenueId'}} requestBody: required: true content: application/json: schema: type: object properties: payer: {$ref: '#/components/schemas/Address'} ref: {$ref: '#/components/schemas/Uuid'} signature: {$ref: '#/components/schemas/Signature'} additionalProperties: false responses: '200': description: The permit to sign, or its state once submitted. content: {application/json: {schema: {$ref: '#/components/schemas/WalletPermission'}}} '400': {$ref: '#/components/responses/BadSignature'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {description: '`ACCESS_REQUIRED`: access not granted, or suspended.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '404': {description: '`NOT_FOUND`: no such prepared permit.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '409': {$ref: '#/components/responses/StateConflict'} '422': {$ref: '#/components/responses/AccountNotLinked'} '502': {$ref: '#/components/responses/VenueUnavailable'} /v1/balances: get: tags: [Account] summary: Get balances description: >- Cached balances per linked venue, in venue order ([fields](/how-it-works#balances)); a read 15 seconds old queues a refresh. Unknown values are null; a value with its `error` or `chain_error` set is stale. operationId: getBalances security: [{session: []}] responses: '200': description: One entry per linked venue. content: {application/json: {schema: {type: array, items: {$ref: '#/components/schemas/Balance'}}}} '401': {$ref: '#/components/responses/Unauthenticated'} /v1/me/stats: get: tags: [Account] summary: Get my trading stats description: >- Settled output volume of the last 30 days per venue, Lighter and Aster included, and what the user's orders received and delivered since the first fill ([maker results](/how-it-works#maker-results)). Fees are zero. operationId: getStats security: [{session: []}] responses: '200': description: The stats. content: {application/json: {schema: {$ref: '#/components/schemas/Stats'}}} '401': {$ref: '#/components/responses/Unauthenticated'} /v1/me/exposure: get: tags: [Account] summary: Get my exposure operationId: getV1MeExposure description: >- A consistent snapshot per venue, Lighter and Aster included; a credential sees its identity's amounts. On escrow venues, check `chain_observation.current`; it is null on Lighter and Aster. Credential scope: `read`. security: [{session: []}, {makerCredential: []}] responses: '200': description: The exposure. content: {application/json: {schema: {$ref: '#/components/schemas/Exposure'}}} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} /v1/quote-lines: get: tags: [Quotes] summary: Read quote lines description: >- The quote identity's published lines ([quote lines](/how-it-works#quote-lines)) and their `revision`, `0` before any. A credential reads its own identity. Credential scope: `read`. operationId: getQuoteLines security: [{session: []}, {makerCredential: []}] parameters: - name: quote_identity_id in: query required: false description: The identity; the browser identity by default, a credential's own with a credential. schema: {$ref: '#/components/schemas/Uuid'} responses: '200': description: The lines. content: {application/json: {schema: {$ref: '#/components/schemas/QuoteLines'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} '404': {$ref: '#/components/responses/NotFound'} post: tags: [Quotes] summary: Publish quote lines description: >- Accepts every draft and cancellation of a preparation and replaces the identity's lines, in one transaction, or none ([quotes](/how-it-works#quotes)). `STATE_CONFLICT` when the lines' revision moved since the preparation or a draft was accepted with another signature; `STALE_QUOTE` once the preparation is five minutes old, or unless each draft's pool is `live`, its lease current, before `valid_until`, at the current generation and `cancel_epoch`; `STALE_SEQUENCE` unless each draft's sequence exceeds every published one. A cancellation is an unguarded `DELETE /v1/orders/{id}/quotes`; retries never restore a cancelled set. Publishing an accepted preparation again returns the lines. Credential scope: `quote`, and `cancel` when it cancels. operationId: publishQuoteLines security: [{session: []}, {makerCredential: []}] requestBody: required: true content: {application/json: {schema: {$ref: '#/components/schemas/QuoteLinesPublication'}}} responses: '200': description: The published lines. content: {application/json: {schema: {$ref: '#/components/schemas/QuoteLines'}}} '400': {$ref: '#/components/responses/BadSignature'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/QuoteForbidden'} '404': {$ref: '#/components/responses/NotFound'} '409': {description: '`STALE_QUOTE`, `STALE_SEQUENCE` or `STATE_CONFLICT`.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '413': {$ref: '#/components/responses/PayloadTooLarge'} '422': {$ref: '#/components/responses/AccountNotLinked'} '502': {$ref: '#/components/responses/VenueUnavailable'} /v1/quote-lines/prepare: post: tags: [Quotes] summary: Prepare quote lines description: >- Compiles a complete replacement of the identity's lines into one draft per live pool with stock and one cancellation per other quoted pool ([quote lines](/how-it-works#quote-lines)); publish them within five minutes. `VALIDATION_ERROR` for stock without a pool on its venue, under one token or its minimum fill, or without a sell price and a buy price elsewhere that can pay for it. `STATE_CONFLICT` while a pool of the identity moves capital, or unless each draft's pool is `live` under a current lease; each quote needs a linked, set-up account on its venue. At most 100 unpublished, unexpired drafts per identity, else `RATE_LIMITED`. Credential scope: `quote`, and `cancel` when it cancels. operationId: prepareQuoteLines security: [{session: []}, {makerCredential: []}] requestBody: required: true content: {application/json: {schema: {$ref: '#/components/schemas/QuoteLinesInput'}}} responses: '200': description: The drafts to sign. content: {application/json: {schema: {$ref: '#/components/schemas/QuoteLinesPreparation'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {description: '`ACCESS_REQUIRED`, `FORBIDDEN` (no `quote` or `cancel` scope, quote identity revoked, or quoting disabled by an admin), or `MAKER_NOT_APPROVED` for a Lighter or Aster pool.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '404': {$ref: '#/components/responses/NotFound'} '409': {$ref: '#/components/responses/StateConflict'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '422': {$ref: '#/components/responses/AccountNotLinked'} /v1/maker/{venue}/prepare: post: tags: [Orders] summary: Prepare maker funds description: >- Funds the quote identity's capital pool on `venue` ([maker capital](/how-it-works#maker-capital)); prices go through [quote lines](/how-it-works#quote-lines). Idempotent on `client_request_id`. A Lighter or Aster pool ([before quoting](/market-making#before-quoting)) takes `funding_source: venue`, one pool per account; a Lighter account without a deposit is `STATE_CONFLICT` with `reason` `no_deposit`, an unreadable Lighter transfer fee `VENUE_UNAVAILABLE`. operationId: prepareMaker security: [{session: []}] parameters: [{name: venue, in: path, required: true, schema: {$ref: '#/components/schemas/VenueId'}}] requestBody: required: true content: {application/json: {schema: {$ref: '#/components/schemas/MakerInput'}}} responses: '200': description: The preparation. content: {application/json: {schema: {$ref: '#/components/schemas/MakerPreparation'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {description: '`ACCESS_REQUIRED`, `FORBIDDEN` when the quote identity is unavailable, or `MAKER_NOT_APPROVED` for a Lighter or Aster pool.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '409': {description: '`STATE_CONFLICT`: the order''s state forbids it, a `client_request_id` reused with other terms, another funding, take payment, escrow withdrawal or direct operation pending on the venue, or `reason` `no_deposit`.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '413': {$ref: '#/components/responses/PayloadTooLarge'} '422': {$ref: '#/components/responses/AccountNotLinked'} '502': {$ref: '#/components/responses/VenueUnavailable'} '503': {$ref: '#/components/responses/OperatorUnavailable'} /v1/maker/preparations/{id}: get: tags: [Orders] summary: Read a maker preparation operationId: getMakerPreparation security: [{session: []}] parameters: [{$ref: '#/components/parameters/Id'}] responses: '200': description: The preparation. content: {application/json: {schema: {$ref: '#/components/schemas/MakerPreparation'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {$ref: '#/components/responses/NotFound'} delete: tags: [Orders] summary: Cancel an unsigned maker preparation description: >- Cancels a `preparing` preparation and restores its order's state; repeating returns it, other states are `STATE_CONFLICT`. An unsigned preparation also cancels at expiry. operationId: cancelMakerPreparation security: [{session: []}] parameters: [{$ref: '#/components/parameters/Id'}] responses: '200': description: The preparation. content: {application/json: {schema: {$ref: '#/components/schemas/MakerPreparation'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {$ref: '#/components/responses/NotFound'} '409': {$ref: '#/components/responses/StateConflict'} /v1/maker/preparations/{id}/signatures: post: tags: [Orders] summary: Submit maker signatures description: >- Accepts every requested signature at once, before `expires_at` ([maker capital](/how-it-works#maker-capital)). A `margin_move` signed over ten minutes ago is `WITHDRAWAL_EXPIRED`. Once accepted, a retry returns it. operationId: submitMakerSignatures security: [{session: []}] parameters: [{$ref: '#/components/parameters/Id'}] requestBody: required: true content: {application/json: {schema: {$ref: '#/components/schemas/Signatures'}}} responses: '200': description: The preparation. content: {application/json: {schema: {$ref: '#/components/schemas/MakerPreparation'}}} '400': {description: '`VALIDATION_ERROR`, `BAD_SIGNATURE` or `WITHDRAWAL_EXPIRED`.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {description: '`ACCESS_REQUIRED`, or `FORBIDDEN` when the quote identity changed or, with a `quote_set` item, its lease expired.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '404': {$ref: '#/components/responses/NotFound'} '409': {description: '`STATE_CONFLICT`, or `STALE_QUOTE` after the quote''s `valid_until`.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '413': {$ref: '#/components/responses/PayloadTooLarge'} '422': {$ref: '#/components/responses/AccountNotLinked'} '502': {$ref: '#/components/responses/VenueUnavailable'} '503': {$ref: '#/components/responses/OperatorUnavailable'} /v1/orders: get: tags: [Orders] summary: List my orders description: >- Capital pools, nonterminal orders and orders holding funds, plus the 50 latest empty `closed` or `failed` ones, oldest first; a credential sees its identity's only. Over 1000 is 503 `SNAPSHOT_TOO_LARGE`: page with `/v1/orders/history`. Credential scope: `read`. operationId: getOrders security: [{session: []}, {makerCredential: []}] parameters: - name: client_order_id in: query schema: {type: string} description: 'Exact match: zero or one order.' responses: '200': description: The orders. content: {application/json: {schema: {type: array, items: {$ref: '#/components/schemas/Order'}}}} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} '503': {$ref: '#/components/responses/SnapshotTooLarge'} /v1/orders/{id}: get: tags: [Orders] summary: Get an order description: 'Credential scope: `read`.' operationId: getOrder security: [{session: []}, {makerCredential: []}] parameters: [{$ref: '#/components/parameters/OrderId'}] responses: '200': description: The order. content: {application/json: {schema: {$ref: '#/components/schemas/Order'}}} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} '404': {$ref: '#/components/responses/NotFound'} /v1/orders/{id}/quotes: delete: tags: [Quotes] summary: Pull the quotes description: >- Removes the order from admission and advances `cancel_epoch` on every call ([cancellation](/how-it-works#cancellation)). Credential scope: `cancel`. operationId: deleteQuotes security: [{session: []}, {makerCredential: []}] parameters: [{$ref: '#/components/parameters/OrderId'}] responses: '200': description: The cancellation receipt. content: {application/json: {schema: {$ref: '#/components/schemas/QuoteCancellation'}}} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} '404': {$ref: '#/components/responses/NotFound'} /v1/quote-identities/{id}/lease: put: tags: [Quotes] summary: Renew quote lease operationId: putV1QuoteIdentitiesIdLease description: >- Dead-man switch for new admissions, in server time ([quotes](/how-it-works#quotes)): `ttl_seconds` for a credential identity, 9999-12-31T00:00:00Z for a browser one. Credential scope: `quote`. security: [{session: []}, {makerCredential: []}] parameters: [{$ref: '#/components/parameters/Id'}] requestBody: {required: true, content: {application/json: {schema: {$ref: '#/components/schemas/LeaseInput'}}}} responses: '200': description: The lease. content: {application/json: {schema: {$ref: '#/components/schemas/Lease'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/QuoteForbidden'} '404': {description: '`NOT_FOUND`: a credential named another identity.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '413': {$ref: '#/components/responses/PayloadTooLarge'} /v1/quote-identities/{id}/quotes: delete: tags: [Quotes] summary: Cancel all identity quotes operationId: deleteV1QuoteIdentitiesIdQuotes description: >- Atomically advances the identity's generation and every one of its orders' `cancel_epoch`; `orders` counts them, in any state. Reserved fills continue. Credential scope: `cancel`. security: [{session: []}, {makerCredential: []}] parameters: [{$ref: '#/components/parameters/Id'}] responses: '200': description: The cancellation. content: {application/json: {schema: {$ref: '#/components/schemas/IdentityCancellation'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} '404': {description: '`NOT_FOUND`: a credential named another identity.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} /v1/closes: post: tags: [Closes] summary: Request a close description: >- Closes 1 to 50 of the user's orders (repeated ids count once) into their owners' venue margin ([releasing capital](/how-it-works#releasing-capital)); `closing` ones are skipped. `STATE_CONFLICT` while an order is `preparing`, `moving` or `funding`. operationId: postCloses security: [{session: []}] requestBody: required: true content: application/json: schema: type: object required: [orders] properties: orders: {type: array, minItems: 1, items: {$ref: '#/components/schemas/Bytes32'}} additionalProperties: false responses: '200': description: The close to sign, or none. content: application/json: schema: type: object required: [id, to_sign] properties: id: type: [string, 'null'] format: uuid description: Null when no order needs a signature. to_sign: {type: array, items: {$ref: '#/components/schemas/ToSign'}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {description: '`NOT_FOUND`: an unknown, malformed or foreign order.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '409': {$ref: '#/components/responses/StateConflict'} '413': {$ref: '#/components/responses/PayloadTooLarge'} /v1/closes/{id}/signatures: post: tags: [Closes] summary: Submit close signature description: >- The master's `CloseOrders` signature, before its deadline: the orders become `closing` and leave the books ([releasing capital](/how-it-works#releasing-capital)). A retry returns the same orders. operationId: postCloseSignatures security: [{session: []}] parameters: [{$ref: '#/components/parameters/Id'}] requestBody: {required: true, content: {application/json: {schema: {$ref: '#/components/schemas/Signatures'}}}} responses: '200': description: The orders of the close. content: application/json: schema: type: object required: [orders] properties: {orders: {type: array, items: {$ref: '#/components/schemas/Order'}}} '400': {$ref: '#/components/responses/BadSignature'} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {description: '`NOT_FOUND`: no close with this id, or an expired one removed by a later `POST /v1/closes`.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '409': {description: '`STATE_CONFLICT`: the close expired.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '413': {$ref: '#/components/responses/PayloadTooLarge'} /v1/escrow: get: tags: [Escrow] summary: List my funds in escrow description: >- Orders with unlocked funds that your linked addresses own in each venue's current escrow, under any operator; close `managed` ones with `POST /v1/closes`, withdraw any by signature ([releasing capital](/how-it-works#releasing-capital)). Per address, at most 50 unmanaged orders are read: the available balance (`order_id` zero), then the latest funded. operationId: getEscrow security: [{session: []}] parameters: - name: owner in: query description: Explicit master reads its available balance without a venue link; omission lists linked owners. schema: {$ref: '#/components/schemas/Address'} responses: '200': description: Orders holding funds. content: {application/json: {schema: {type: array, items: {$ref: '#/components/schemas/EscrowOrder'}}}} '400': {description: '`VALIDATION_ERROR`: `owner` is not an address, or not the signed-in master.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '401': {$ref: '#/components/responses/Unauthenticated'} '502': {$ref: '#/components/responses/VenueUnavailable'} /v1/escrow/withdraw/prepare: post: tags: [Escrow] summary: Prepare a withdrawal description: >- The `Withdrawal` your linked address signs, valid one hour, to release `amount` of an order's unlocked funds into your margin, or with `to_margin: false` into your wallet ([releasing capital](/how-it-works#releasing-capital)). `VALIDATION_ERROR` above the order's funds, under 1 token unless all of them, or for an available-balance release to margin below `release_minimum`. `STATE_CONFLICT` while a release of the order or a capital operation on it is pending, above what is free of reserved fills, for an unrecorded order under 1 token (the available balance excepted), or for another operator's order before its owner's exit has run. operationId: postEscrowWithdrawPrepare security: [{session: []}] requestBody: required: true content: application/json: schema: type: object required: [venue, order_id, amount, to_margin] properties: owner: $ref: '#/components/schemas/Address' description: 'The master: order zero only, to its wallet, without a link. Otherwise the linked owner.' venue: {$ref: '#/components/schemas/VenueId'} order_id: {$ref: '#/components/schemas/Bytes32'} amount: {$ref: '#/components/schemas/Amount'} to_margin: type: boolean description: False withdraws to the owner wallet. additionalProperties: false responses: '200': description: The terms for `POST /v1/escrow/withdraw` and the item to sign. content: application/json: schema: type: object required: [venue, order_id, amount, to_margin, dex, nonce, deadline, to_sign] properties: owner: {$ref: '#/components/schemas/Address'} venue: {$ref: '#/components/schemas/VenueId'} order_id: {$ref: '#/components/schemas/Bytes32'} amount: {$ref: '#/components/schemas/Amount'} to_margin: {type: boolean} dex: type: integer description: 'Hyperliquid destination: `0` perps, `4294967295` spot; `0` elsewhere.' nonce: type: string description: A random decimal integer. deadline: type: integer description: Unix seconds, one hour ahead. to_sign: {type: array, items: {$ref: '#/components/schemas/ToSign'}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {description: '`NOT_FOUND`: unknown or malformed order, or no unlocked funds.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '409': {$ref: '#/components/responses/StateConflict'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '422': {$ref: '#/components/responses/AccountNotLinked'} '502': {$ref: '#/components/responses/VenueUnavailable'} '503': {$ref: '#/components/responses/OperatorUnavailable'} /v1/escrow/withdraw: post: tags: [Escrow] summary: Withdraw description: >- Relays the prepared terms, signed by the linked address, as `withdrawBySig`; LaMarge pays gas. The terms are rechecked as at preparation (a stale `dex` is `VALIDATION_ERROR`). A refused venue deposit stays in your available escrow balance. After a revert, or once the finalized chain is past its deadline, sign again. `STATE_CONFLICT` during a financial operation on the venue, while a release of the order is pending, at 10 pending releases per owner and chain, or for a nonce reused with other terms; the same terms return the same withdrawal. operationId: postEscrowWithdraw security: [{session: []}] requestBody: required: true content: application/json: schema: type: object required: [venue, order_id, amount, to_margin, dex, nonce, deadline, signature] properties: owner: $ref: '#/components/schemas/Address' description: 'The master: order zero only, to its wallet, without a link. Otherwise the linked owner.' venue: {$ref: '#/components/schemas/VenueId'} order_id: {$ref: '#/components/schemas/Bytes32'} amount: {$ref: '#/components/schemas/Amount'} to_margin: type: boolean description: False withdraws to the owner wallet. dex: {type: integer, minimum: 0, maximum: 4294967295} nonce: type: string description: Decimal unsigned 64-bit integer. deadline: type: integer description: Unix seconds, in the future and at most 3660 s ahead. signature: {$ref: '#/components/schemas/Signature'} additionalProperties: false responses: '200': description: The order as `GET /v1/escrow` shows it. content: {application/json: {schema: {$ref: '#/components/schemas/EscrowOrder'}}} '400': {$ref: '#/components/responses/BadSignature'} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {description: '`NOT_FOUND`: unknown or malformed order, or no unlocked funds.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '409': {$ref: '#/components/responses/StateConflict'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '422': {$ref: '#/components/responses/AccountNotLinked'} '502': {$ref: '#/components/responses/VenueUnavailable'} '503': {$ref: '#/components/responses/OperatorUnavailable'} /v1/transfers: post: tags: [Transfers] operationId: postTransfer summary: Create a recoverable transfer description: >- Records a take to come and, from venue margin (not Lighter or Aster), the withdrawal it needs ([paying from venue margin](/how-it-works#paying-from-venue-margin)); moves no funds and reserves nothing. No payment setup needed; `funding_plan` asks for a permit when wallet funds need one. security: [{session: []}] requestBody: {required: true, content: {application/json: {schema: {$ref: '#/components/schemas/TransferInput'}}}} responses: '200': description: Existing identical intent. content: {application/json: {schema: {$ref: '#/components/schemas/TransferIntent'}}} '201': description: Created. content: {application/json: {schema: {$ref: '#/components/schemas/TransferIntent'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/AccessRequired'} '404': {description: '`NOT_FOUND`: unknown `previous_transfer_id`, `move_id` or `conversion.id`.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '409': {description: '`STATE_CONFLICT`: the resource''s state forbids this, or a client id reused with other terms; reason `no_deposit`: the Aster account it or its route delivers to never received a deposit, which Aster refuses transfers to; reason `grouped_route`: an open grouped route holds it until it ends (a continuation of its first transfer).', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '413': {$ref: '#/components/responses/PayloadTooLarge'} '422': {description: '`ACCOUNT_NOT_LINKED`, `VENUE_DISABLED`, or `SETUP_REQUIRED` for the `agent` step of an Aster account it delivers to.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '502': {description: '`VENUE_UNAVAILABLE`: the Lighter transfer fee a continuation (`previous_transfer_id`) pays is unknown, or the Aster account it delivers to could not be read.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} get: tags: [Transfers] operationId: getTransfers summary: List my recoverable transfers description: >- Newest first, cancelled and completed included; follow `next_cursor` until null. Status lives in the linked withdrawal and take. security: [{session: []}] parameters: - {$ref: '#/components/parameters/HistoryAfter'} - {$ref: '#/components/parameters/Limit'} responses: '200': description: A page of intents. content: {application/json: {schema: {$ref: '#/components/schemas/TransferPage'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} /v1/transfers/{id}: get: tags: [Transfers] operationId: getTransfer summary: Recover a transfer description: The intent and its linked operations; read before preparing more funding. security: [{session: []}] parameters: - {$ref: '#/components/parameters/Id'} - name: funding_plan in: query schema: {type: boolean, default: false} description: Compute `funding_plan` from fresh balances and allowances, for a wallet review; not when polling. responses: '200': description: The intent. content: {application/json: {schema: {$ref: '#/components/schemas/TransferIntent'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {$ref: '#/components/responses/NotFound'} delete: tags: [Transfers] operationId: cancelTransfer summary: Dismiss a transfer without a take description: >- Blocks the intent's take and prepared withdrawal; repeats answer 204. Refused with a take, a `queued`, `submitting` or `unknown` withdrawal, or a `prepared` or `pending` conversion; relayed funds stay put. A route's first transfer (with `then`) whose take is final can be dismissed: its continuations that neither took nor hold a withdrawal in flight are cancelled with it, and what it delivered stays on the intermediate venue. security: [{session: []}] parameters: [{$ref: '#/components/parameters/Id'}] responses: '204': description: Cancelled. '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {$ref: '#/components/responses/NotFound'} '409': {description: '`STATE_CONFLICT`; with `reason` `grouped_route`: an open grouped route holds it until it ends.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} /v1/transfers/{id}/conversion/prepare: post: tags: [Transfers] operationId: prepareTransferConversion summary: Prepare the transfer’s native-USDC conversion description: >- For a transfer with `conversion`: the payer's own Polygon transaction converting native USDC into its available pUSD, valid 30 minutes. Retries, and replacement transfers naming its `id`, return it, also after access is withdrawn; another is refused while it is unresolved: never prepare one to recover an unknown broadcast. Take once it is `ready`, which only the finalized escrow event sets. security: [{session: []}] parameters: [{$ref: '#/components/parameters/Id'}] responses: '200': description: The conversion. content: application/json: schema: {$ref: '#/components/schemas/WalletConversion'} '400': {description: '`VALIDATION_ERROR`: the transfer has no `conversion`.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/AccessRequired'} '404': {$ref: '#/components/responses/NotFound'} '409': {description: '`STATE_CONFLICT`: the payer has an unresolved conversion, the transfer took or is cancelled, or conversion is unavailable.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '422': {description: '`ACCOUNT_NOT_LINKED`, `SETUP_REQUIRED` or `VENUE_DISABLED`.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '502': {$ref: '#/components/responses/VenueUnavailable'} /v1/transfers/{id}/conversion: post: tags: [Transfers] operationId: reportTransferConversion summary: Fence a conversion prompt or report a broadcast hash description: >- An empty body, once, before the wallet prompt, moves it to `pending`, fencing other tabs and devices; after a lost answer, never prompt again. Then report each `tx_hash`, replacements included, also after access is withdrawn: a hint, `ready` comes from the escrow event only. security: [{session: []}] parameters: [{$ref: '#/components/parameters/Id'}] requestBody: required: true content: application/json: schema: type: object properties: tx_hash: {type: string, pattern: '^0x[0-9a-fA-F]{64}$'} additionalProperties: false responses: '200': description: The conversion. content: application/json: schema: {$ref: '#/components/schemas/WalletConversion'} '400': {description: '`VALIDATION_ERROR`: a malformed hash, or a transaction other than this conversion.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/AccessRequired'} '404': {$ref: '#/components/responses/NotFound'} '409': {description: '`STATE_CONFLICT`: no conversion prepared, an empty body after the first or past the deadline, or a new hash past eight.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '422': {description: '`ACCOUNT_NOT_LINKED`, `SETUP_REQUIRED` or `VENUE_DISABLED`.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '502': {$ref: '#/components/responses/VenueUnavailable'} /v1/transfers/{id}/withdrawal/prepare: post: tags: [Transfers] operationId: prepareTransferWithdrawal summary: Prepare this transfer's funding description: >- One withdrawal of `amount`, at most `amount_in`, from the payer's `from` margin to its escrow-chain address, for the take to deposit ([paying from venue margin](/how-it-works#paying-from-venue-margin)); none from Lighter, Aster or GMX (`VALIDATION_ERROR`). Retries return the same typed data until `WITHDRAWAL_EXPIRED`, then cancel and create another transfer. Another amount conflicts. security: [{session: []}] parameters: [{$ref: '#/components/parameters/Id'}] requestBody: required: true content: application/json: schema: type: object required: [amount] properties: {amount: {$ref: '#/components/schemas/Amount'}} additionalProperties: false responses: '200': description: The typed data to sign. content: application/json: schema: type: object required: [typed_data] properties: {typed_data: {$ref: '#/components/schemas/TypedData'}} additionalProperties: false '400': {description: '`VALIDATION_ERROR`, or `WITHDRAWAL_EXPIRED` ten minutes after the first preparation.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/AccessRequired'} '404': {$ref: '#/components/responses/NotFound'} '409': {description: '`STATE_CONFLICT`; with `reason` `grouped_route`: an open grouped route holds it until it ends; with `reason` `funds_arriving`: an earlier withdrawal of the route is still arriving, nothing more is withdrawn.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '413': {$ref: '#/components/responses/PayloadTooLarge'} '422': {description: '`ACCOUNT_NOT_LINKED`, `SETUP_REQUIRED` for the payer''s `permit`, or `VENUE_DISABLED`.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '502': {$ref: '#/components/responses/VenueUnavailable'} /v1/transfers/{id}/withdrawal: post: tags: [Transfers] operationId: submitTransferWithdrawal summary: Submit this transfer's funding signature description: >- Submits the signed preparation, recorded before the venue is called; answers 200 with the withdrawal, even `refused`, and retries return it. Never sign another for an `unknown` one. security: [{session: []}] parameters: [{$ref: '#/components/parameters/Id'}] requestBody: required: true content: application/json: schema: type: object required: [signature] properties: signature: {$ref: '#/components/schemas/Signature'} envelope: {$ref: '#/components/schemas/AsterEnvelope'} additionalProperties: false responses: '200': description: The withdrawal. content: {application/json: {schema: {$ref: '#/components/schemas/Withdrawal'}}} '400': {description: '`VALIDATION_ERROR`, `BAD_SIGNATURE`, or `WITHDRAWAL_EXPIRED` ten minutes after preparation.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/AccessRequired'} '404': {$ref: '#/components/responses/NotFound'} '409': {description: '`STATE_CONFLICT`; with `reason` `grouped_route`: an open grouped route holds it until it ends; with `reason` `funds_arriving`: an earlier withdrawal of the route is still arriving, nothing more is withdrawn. `FILL_IN_PROGRESS` with `reason` `withdrawal_unsigned`: another transfer signed at once from this venue awaits its signatures (`Retry-After`).', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '413': {$ref: '#/components/responses/PayloadTooLarge'} '422': {$ref: '#/components/responses/AccountNotLinked'} '502': {description: '`VENUE_UNAVAILABLE`: Hyperliquid''s gas reserve is unknown or the destination Aster account could not be read, before anything was recorded; retry.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} /v1/transfers/{id}/grouped: post: tags: [Transfers] operationId: prepareGroupedRoute summary: Prepare a grouped route description: >- For a route's first transfer whose take is prepared and unsigned, paid from Lighter or Aster through an escrow venue: creates the second transfer and prepares its take, reserving nothing, paid from the available balance the first delivers into, with no withdrawal ([grouped routes](/how-it-works#grouped-routes)). For Aster, the first take is signed by `commit_by`: with `reissue`, its request is left as is, to [issue again](/api-reference/takes/reissue-aster) right before signing it last; without it, its nonce is dated 20 seconds after `commit_by` and it is sent only from 55 seconds before that nonce. Idempotent while prepared: a repeat returns the same requests and deadline, whatever it asks. `STATE_CONFLICT` with `reason` `grouped_unavailable`: the route cannot be grouped now (not eligible, the book or the accounts on the intermediate venue do not carry it, too little time left, or aborted); with `grouped_route`: another request is preparing this route. security: [{session: []}] parameters: [{$ref: '#/components/parameters/Id'}] requestBody: required: false content: application/json: schema: type: object properties: reissue: {type: boolean, default: false, description: 'The client issues the first take''s Aster request again right before signing it.'} additionalProperties: false responses: '200': description: The route and its two takes. content: {application/json: {schema: {$ref: '#/components/schemas/GroupedPreparation'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/AccessRequired'} '404': {$ref: '#/components/responses/NotFound'} '409': {$ref: '#/components/responses/StateConflict'} '413': {$ref: '#/components/responses/PayloadTooLarge'} delete: tags: [Transfers] operationId: abortGroupedRoute summary: Abort a prepared route description: >- Ends a route not committed: its second take and second transfer are released at once. The first take stays prepared, to sign alone. Idempotent. `STATE_CONFLICT` with `reason` `grouped_route` for a committed route, which runs to its end. security: [{session: []}] parameters: [{$ref: '#/components/parameters/Id'}] responses: '204': {description: 'Aborted, or never prepared.'} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {$ref: '#/components/responses/NotFound'} '409': {$ref: '#/components/responses/StateConflict'} /v1/transfers/{id}/grouped/signatures: post: tags: [Transfers] operationId: commitGroupedRoute summary: Commit a route's signatures description: >- Every signature of a prepared route at once, each take's items by `fill_id`: accepted together before `commit_by`, or none ([grouped routes](/how-it-works#grouped-routes)). A retry answers the committed route. `TAKE_EXPIRED`: `commit_by` passed and the route is aborted, or a take's `pay_by` passed or one of its fills expired; `STATE_CONFLICT` with `reason` `grouped_unavailable`: the route was aborted. Once aborted, sign the first take alone. security: [{session: []}] parameters: [{$ref: '#/components/parameters/Id'}] requestBody: required: true content: {application/json: {schema: {$ref: '#/components/schemas/Signatures'}}} responses: '200': description: The committed route. content: {application/json: {schema: {$ref: '#/components/schemas/GroupedRoute'}}} '400': {$ref: '#/components/responses/BadSignature'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/AccessRequired'} '404': {$ref: '#/components/responses/NotFound'} '409': {$ref: '#/components/responses/StateConflict'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '422': {$ref: '#/components/responses/AccountNotLinked'} /v1/takes: post: tags: [Takes and fills] summary: Take at market description: >- Prepares up to `max_parts` fills in `PREPARED`, reserving nothing, paid under one `pay_take` from the payer's available balance and wallet on `from`, or in one fill from its Lighter or Aster account ([takes](/how-it-works#takes)); a transfer's take with its withdrawal prepared, not submitted, is signed at once with it ([paying from venue margin](/how-it-works#paying-from-venue-margin)). `PREFUNDING_REQUIRED` when the available balance and wallet fall short; signed at once, the wallet and the withdrawal; from Lighter or Aster, the account with its fee. `SETUP_REQUIRED` when a wallet deposit lacks the payer's `permit` step. `STATE_CONFLICT` while a maker preparation or an escrow withdrawal is open on `from`. From Lighter or Aster, `VALIDATION_ERROR` when the account backs a pool. operationId: postTake security: [{session: []}] requestBody: {required: true, content: {application/json: {schema: {$ref: '#/components/schemas/TakeInput'}}}} responses: '200': description: Existing take for this `client_take_id`. content: {application/json: {schema: {$ref: '#/components/schemas/TakePreparation'}}} '201': description: The take and the items to sign. content: {application/json: {schema: {$ref: '#/components/schemas/TakePreparation'}}} '400': {description: '`VALIDATION_ERROR`, or `WITHDRAWAL_EXPIRED` for a take signed at once whose withdrawal was prepared too long ago to be signed with it: create another transfer.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {description: '`ACCESS_REQUIRED`, or `FORBIDDEN` from Lighter or Aster while paying from a venue is suspended after failed payments.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '409': {description: '`PREFUNDING_REQUIRED`, `STALE_QUOTE`, `INSUFFICIENT_LIQUIDITY`, `SLIPPAGE`, `FILL_IN_PROGRESS` or `STATE_CONFLICT` (reason `no_deposit`: the Aster account it delivers to, or the Lighter account it pays from or delivers to, never received a deposit; reason `withdrawal_submitted`: the transfer''s prepared withdrawal was submitted meanwhile, take again once it arrived). `FILL_IN_PROGRESS` with `reason` `too_many`: `limits.max_unpaid_takes` takes already await payment; `venue_payment`: the Lighter or Aster account pays another take, one at a time, retry after `Retry-After`; `withdrawal_unsigned`: another transfer signed at once from this venue awaits its signatures, retry after `Retry-After`. `STATE_CONFLICT` with `reason` `funds_changed`: another payment took the funds this take was sized on, retry after `Retry-After`.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '413': {$ref: '#/components/responses/PayloadTooLarge'} '422': {$ref: '#/components/responses/AccountNotLinked'} '502': {$ref: '#/components/responses/VenueUnavailable'} '503': {$ref: '#/components/responses/OperatorUnavailable'} /v1/takes/{id}: get: tags: [Takes and fills] summary: Recover a take and its signing intents operationId: getV1TakesId description: The taker's take, with its typed data while unsigned, also after expiry. Never sign an expired payment. security: [{session: []}] parameters: [{$ref: '#/components/parameters/Id'}] responses: '200': description: The take. content: {application/json: {schema: {$ref: '#/components/schemas/TakePreparation'}}} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {$ref: '#/components/responses/NotFound'} delete: tags: [Takes and fills] summary: Cancel a take description: >- Allowed until its signature is accepted, a take signed at once's included, also after an unsigned expiry; repeats answer 204. Its unsigned fills expire (`declined`), releasing their source commitments. operationId: deleteTake security: [{session: []}] parameters: [{$ref: '#/components/parameters/Id'}] responses: '204': description: Cancelled. '401': {$ref: '#/components/responses/Unauthenticated'} '404': {$ref: '#/components/responses/NotFound'} '409': {description: '`STATE_CONFLICT`; with `reason` `grouped_route`: an open grouped route holds it until it ends: abort the route instead.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} /v1/takes/{id}/signatures: post: tags: [Takes and fills] summary: Submit take signatures description: >- The payer's signature, before `pay_by`: the `pay_take`, with the take id as `fill_id`, or, paid from Lighter or Aster, the `lighter_transfer` or `aster_transfer` signature; LaMarge sends that transfer once every maker accepted ([signing](/how-it-works#signing)). A take signed at once also carries its prepared withdrawal as a `margin_move` item without `fill_id` (`VALIDATION_ERROR` without it): LaMarge sends the withdrawal at once, then the payment once a chain read shows its funds in the wallet, with ten seconds left before `pay_by`, else the take expires unpaid; a refused withdrawal ends the take (`EXPIRED`, reason `the withdrawal was refused`). Once accepted, retries return the current fills. operationId: postTakeSignatures security: [{session: []}] parameters: [{$ref: '#/components/parameters/Id'}] requestBody: {required: true, content: {application/json: {schema: {$ref: '#/components/schemas/Signatures'}}}} responses: '200': description: The take's fills. content: application/json: schema: type: object required: [fills] properties: {fills: {type: array, items: {$ref: '#/components/schemas/Fill'}}} '400': {description: '`BAD_SIGNATURE`, `VALIDATION_ERROR`, or `WITHDRAWAL_EXPIRED` for a take signed at once whose withdrawal is too old to send.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/AccessRequired'} '404': {$ref: '#/components/responses/NotFound'} '409': {description: '`TAKE_EXPIRED`: `pay_by` passed (for a take signed at once, its last 30 seconds began) or a fill is no longer awaiting payment; take again. `STATE_CONFLICT` with `reason` `grouped_route`: an open grouped route holds it until it ends: commit or abort the route instead. For a take signed at once, `STATE_CONFLICT` also when another withdrawal on the venue is unresolved or the margin no longer covers the withdrawal, or with `reason` `funds_arriving` when an earlier withdrawal of the route is still arriving.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '413': {$ref: '#/components/responses/PayloadTooLarge'} '422': {$ref: '#/components/responses/AccountNotLinked'} '502': {description: '`VENUE_UNAVAILABLE`, for a take signed at once: Hyperliquid''s gas reserve is unknown or the destination Aster account could not be read, before anything was recorded; retry.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} /v1/takes/{id}/aster-request: post: tags: [Takes and fills] operationId: reissueAsterRequest summary: Reissue an Aster request description: >- For an unsigned take paid from Aster (`aster_reissue`), right before the wallet signs: issues its `aster_transfer` request again with a nonce 55 seconds after now, so LaMarge sends it as soon as its signature is accepted. `nonce` is the nonce of the request you hold (the `nonce` field of its `msg`): `matched` true, the answer is the request issued now (or the same, when a later one already stands: that one is sent from 55 seconds before its nonce); `matched` false, nothing changed and the answer is the current request, to call again with. Deadlines never move. A route's first take while the route is prepared or once aborted; `STATE_CONFLICT` with `reason` `aster_request` for a signed take, or `grouped_route` for any other take a route holds; `TAKE_EXPIRED` after `pay_by` or the route's `commit_by`. security: [{session: []}] parameters: [{$ref: '#/components/parameters/Id'}] requestBody: required: true content: application/json: schema: type: object required: [nonce] properties: nonce: {type: integer, format: int64, minimum: 0, description: 'Microseconds, as in the held request''s `msg`.'} additionalProperties: false responses: '200': description: The take and its current request. content: application/json: schema: allOf: - {$ref: '#/components/schemas/TakePreparation'} - type: object required: [matched] properties: matched: {type: boolean, description: 'Whether `nonce` was the stored request''s.'} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/AccessRequired'} '404': {$ref: '#/components/responses/NotFound'} '409': {description: '`TAKE_EXPIRED`, or `STATE_CONFLICT` with `reason` `aster_request` or `grouped_route`.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} /v1/fills/{id}/refund/prepare: post: tags: [Takes and fills] operationId: preparePaymentRefund summary: Prepare an early payment refund description: >- Maker master session only: the `RefundPayment` consent for the payment's beneficiary to sign, for a fill delivered on Lighter or Aster whose payment is `LOCKED` and delivery `ABANDONED` ([deadlines](/how-it-works#deadlines-and-outcomes)). `STATE_CONFLICT` otherwise, or while one is active. security: [{session: []}] parameters: [{$ref: '#/components/parameters/Id'}] responses: '200': description: Consent for the payment beneficiary to sign. content: application/json: schema: type: object required: [deadline, to_sign] properties: deadline: {type: integer, format: int64} to_sign: {type: array, minItems: 1, maxItems: 1, items: {$ref: '#/components/schemas/ToSign'}} additionalProperties: false '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {$ref: '#/components/responses/NotFound'} '409': {$ref: '#/components/responses/StateConflict'} /v1/fills/{id}/refund: post: tags: [Takes and fills] operationId: submitPaymentRefund summary: Authorize an early payment refund description: >- Submits the beneficiary's `RefundPayment` signature ([deadlines](/how-it-works#deadlines-and-outcomes)); exact retries answer 204, even after settlement. The operator returns only this payment to the payer's available balance (finalized `Refunded` event). Consent ends delivery reports (`refund_authorized`), even of a transfer executed in time. security: [{session: []}] parameters: [{$ref: '#/components/parameters/Id'}] requestBody: required: true content: application/json: schema: type: object required: [deadline, signature] properties: deadline: {type: integer, format: int64} signature: {$ref: '#/components/schemas/Signature'} additionalProperties: false responses: '204': {description: Consent accepted or already recorded.} '400': {description: '`VALIDATION_ERROR`: deadline past, over one hour and 60 seconds ahead, or after `t2`; `BAD_SIGNATURE`: not the beneficiary''s.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {$ref: '#/components/responses/NotFound'} '409': {$ref: '#/components/responses/StateConflict'} '413': {$ref: '#/components/responses/PayloadTooLarge'} /v1/fills/{id}/accept: post: tags: [Takes and fills] operationId: acceptFill summary: Accept an active delivery before taker funding description: >- Commits the maker to deliver this fill, before `maker_accept_by` ([active market making](/market-making#active-market-making)). Retries of an accepted fill return 204, also after the deadline. Credential scope: `quote`. security: [{session: []}, {makerCredential: []}] parameters: [{$ref: '#/components/parameters/Id'}] responses: '204': {description: "Acceptance recorded, also on a retry."} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/QuoteForbidden'} '404': {$ref: '#/components/responses/NotFound'} '409': {description: "`STATE_CONFLICT`: no acceptance asked, the window closed, or the fill's quotes were cancelled.", content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} /v1/fills/{id}/delivery: post: tags: [Takes and fills] operationId: submitDelivery summary: Report an in-venue delivery description: >- Reports the venue transfer that delivers a fill on Lighter or Aster, with the maker's master session or a `quote` credential of the order's identity: a Lighter transaction hash, at least at status `settlement.delivery.min_status` of `/v1/info`, or an Aster `transferId` ([deliver on Lighter](/maker-quickstart#deliver-on-lighter), [on Aster](/maker-quickstart#deliver-on-aster)). Accepted while the payment is `LOCKED` and `maker_leg` is `NONE` or `ABANDONED`, before `report_by` and any refund consent; the operator then claims the payment. Exact retries return the fill. security: [{session: []}, {makerCredential: []}] parameters: [{$ref: '#/components/parameters/Id'}] requestBody: required: true content: application/json: schema: type: object required: [tx_hash] properties: tx_hash: {type: string, maxLength: 128, pattern: '^[A-Za-z0-9_-]+$'} additionalProperties: false responses: '200': description: The fill, its maker leg claimed by the delivery. content: application/json: schema: type: object required: [fill] properties: {fill: {$ref: '#/components/schemas/Fill'}} additionalProperties: false '400': {description: '`VALIDATION_ERROR`: this transaction never delivers the fill. `reason`: `not_a_transfer`; on Lighter `transfer_failed` (status 0 or above 3), `wrong_sender`, `wrong_recipient`, `wrong_asset` (not USDC collateral) or `wrong_memo`; `amount_short`, `executed_late`, `before_fill` (an Aster transfer older than the fill) or `transfer_used` (it already settles another fill). No `reason`: a malformed request or an escrow-settled fill.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {description: '`FORBIDDEN`: a credential without `quote` scope; suspension does not block reports.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '404': {$ref: '#/components/responses/NotFound'} '409': {description: '`STATE_CONFLICT`. `reason`: `not_due` (payment not locked yet, or fill delivered, refunded or expired), `refund_authorized` (refund consented) or `report_window_closed` (past `report_by`); final except `not_due` before the lock.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '413': {$ref: '#/components/responses/PayloadTooLarge'} '422': {description: '`ACCOUNT_NOT_LINKED`: the maker''s venue account is unlinked or changed.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '425': {description: '`DELIVERY_PENDING`: report the same hash after `Retry-After` (1 s). `reason`: `unknown_transaction` (unknown to the venue; on Aster, until both Spot histories show this id as a USDT transfer from the maker to `delivery_to`), `not_final` (Lighter, below the required status) or `send_unresolved` (Aster, a send between these accounts may own the transfer until its outcome is known).', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '502': {description: '`VENUE_UNAVAILABLE`: the venue did not answer, or Lighter''s per-minute read budget is spent. Report the same hash again.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} /v1/fills: get: tags: [Takes and fills] summary: List my fills description: >- Nonfinal fills plus the latest 50 final, newest first: a session's taker and maker fills, a credential's identity's maker fills (scope `read`). Over 1000: 503 `SNAPSHOT_TOO_LARGE`; page with `/v1/fills/history`. operationId: getFills security: [{session: []}, {makerCredential: []}] responses: '200': description: The fills. content: {application/json: {schema: {type: array, items: {$ref: '#/components/schemas/Fill'}}}} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} '503': {$ref: '#/components/responses/SnapshotTooLarge'} /v1/withdrawals/prepare: post: tags: [Withdrawals] summary: Prepare a withdrawal or a send description: >- Polymarket, Hyperliquid and Aster only ([margin transfers](/how-it-works#margin-transfers)); relay within ten minutes. `VALIDATION_ERROR` when `amount`, with the venue fee and a Hyperliquid withdrawal's `withdrawal_reserve`, exceeds a fresh read of the withdrawable balance less what left the account since, when an Aster withdrawal with its fee exceeds a fresh read of its chain's `withdrawable` (`GET /v1/withdrawals/chains`), or for a send (`to: account`) to your own address, venue wallet or deposit address, to no Polymarket Perps account, or, on Hyperliquid, to anything but a user or sub-account in mode `default`, `disabled`, `dexAbstraction`, `unifiedAccount` or `portfolioMargin` without code on HyperEVM. `STATE_CONFLICT` while a withdrawal or send on the venue is `queued`, `submitting` or `unknown`. operationId: postWithdrawalPrepare security: [{session: []}] requestBody: required: true content: application/json: schema: type: object required: [venue, amount, to] properties: venue: {$ref: '#/components/schemas/VenueId'} amount: {$ref: '#/components/schemas/Amount'} to: type: string enum: [wallet, signer, escrow, account] description: >- Polymarket: `wallet` (the linked venue wallet), `signer`, or `escrow` (the signer's deposit address, swept into the available balance). Hyperliquid and Aster: `signer`. All three: `account`, a send to `recipient`. recipient: $ref: '#/components/schemas/Address' description: 'With `to: account` only: the other account. On Polymarket, its Perps owner (signer) address, not its wallet.' dex: type: string enum: [xyz] description: >- Hyperliquid, a standard account: its trade.xyz balance pays the withdrawal or send instead of its perps. A unified account's one balance includes it: `VALIDATION_ERROR`. chain_id: type: integer description: >- An Aster withdrawal (`to: signer`) only: the chain it arrives on, a `chain_id` of `GET /v1/withdrawals/chains` (56 BSC, 42161 Arbitrum, 1 Ethereum), each with its own limit and fee at Aster; BSC when absent. Its `destination Chain` names it; it is signed at BSC's chain id whatever the chain. additionalProperties: false responses: '200': description: The typed data to sign with `eth_signTypedData_v4`. content: application/json: schema: type: object required: [typed_data] properties: typed_data: oneOf: [{$ref: '#/components/schemas/TypedData'}, {$ref: '#/components/schemas/OpTypedData'}] '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '409': {$ref: '#/components/responses/StateConflict'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '422': {$ref: '#/components/responses/AccountNotLinked'} '502': {$ref: '#/components/responses/VenueUnavailable'} /v1/withdrawals/chains: get: tags: [Withdrawals] summary: List withdrawal chains description: >- Aster only: the chains the linked account can withdraw to, read from Aster now. Each chain has its own limit, so a withdrawal refused on one may still fit another (`chain_id` in `POST /v1/withdrawals/prepare`). operationId: getWithdrawalChains security: [{session: []}] parameters: - name: venue in: query required: true description: '`aster`.' schema: {type: string} responses: '200': description: The account's withdrawal chains. content: {application/json: {schema: {$ref: '#/components/schemas/WithdrawalChains'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '422': {$ref: '#/components/responses/AccountNotLinked'} '502': {$ref: '#/components/responses/VenueUnavailable'} /v1/withdrawals: post: tags: [Withdrawals] summary: Relay a withdrawal description: >- Records the exact signed operation, then sends it; retries return the record and never resend ([margin transfers](/how-it-works#margin-transfers)). A `refused` withdrawal answers 502 `VENUE_REJECTED`, also on retry. operationId: postWithdrawal security: [{session: []}] requestBody: required: true content: application/json: schema: type: object required: [venue, typed_data, signature] properties: venue: {$ref: '#/components/schemas/VenueId'} typed_data: oneOf: [{$ref: '#/components/schemas/TypedData'}, {$ref: '#/components/schemas/OpTypedData'}] description: Exactly as `POST /v1/withdrawals/prepare` returned it. signature: {$ref: '#/components/schemas/Signature'} envelope: {$ref: '#/components/schemas/AsterEnvelope'} move_id: $ref: '#/components/schemas/Uuid' description: The move this withdrawal to the signer feeds a bridge for; an exact retry keeps the first. additionalProperties: false responses: '200': description: The withdrawal. content: {application/json: {schema: {$ref: '#/components/schemas/Withdrawal'}}} '400': {description: '`VALIDATION_ERROR`, `BAD_SIGNATURE`, or `WITHDRAWAL_EXPIRED` ten minutes after preparation.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {description: '`NOT_FOUND`: `move_id` names no move of yours.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '409': {description: '`STATE_CONFLICT`, also once `move_id`''s move is closed; with `reason` `funds_arriving`: an earlier withdrawal of a route is still arriving, nothing more is withdrawn. `FILL_IN_PROGRESS` with `reason` `withdrawal_unsigned`: a transfer signed at once from this venue awaits its signatures (`Retry-After`).', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '413': {$ref: '#/components/responses/PayloadTooLarge'} '422': {$ref: '#/components/responses/AccountNotLinked'} '502': {description: '`VENUE_REJECTED`: refused by the venue or before sending; not retryable. `VENUE_UNAVAILABLE`: a venue or chain read did not answer, or Hyperliquid''s gas reserve is unknown, before anything was recorded; retry.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} /v1/credentials: post: tags: [Credentials] summary: Create a maker credential operationId: postV1Credentials description: >- Creates a maker credential and its quote identity (same `id`) with an immutable `quote_signer` ([authentication](/api-reference/overview#authentication)). After a lost response, revoke the credential and create another. security: [{session: []}] requestBody: required: true content: {application/json: {schema: {$ref: '#/components/schemas/CredentialInput'}}} responses: '201': description: The credential and its bearer. content: {application/json: {schema: {$ref: '#/components/schemas/CredentialCreated'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {description: '`ACCESS_REQUIRED`, or `FORBIDDEN` when an admin disabled or archived the maker.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '409': {$ref: '#/components/responses/StateConflict'} '413': {$ref: '#/components/responses/PayloadTooLarge'} /v1/credentials/{id}: delete: tags: [Credentials] summary: Revoke a credential operationId: deleteV1CredentialsId description: >- Atomically revokes bearer and identity, expires the lease, advances the generation and removes current quotes; reserved fills still settle. Irreversible; repeats answer 204. security: [{session: []}] parameters: [{$ref: '#/components/parameters/Id'}] responses: '204': description: Revoked. '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '404': {$ref: '#/components/responses/NotFound'} /v1/credentials/{id}/rotate: post: tags: [Credentials] summary: Rotate credential bearer operationId: postV1CredentialsIdRotate description: >- Replaces the bearer, keeping signer and identity; advances the generation and expires the lease, removing current quotes (renew the lease, prepare new drafts). Works on expired, not revoked, credentials. Returns the new bearer once. security: [{session: []}] parameters: [{$ref: '#/components/parameters/Id'}] requestBody: required: true content: {application/json: {schema: {$ref: '#/components/schemas/CredentialRotationInput'}}} responses: '200': description: The new bearer. content: {application/json: {schema: {$ref: '#/components/schemas/CredentialRotated'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/AccessRequired'} '404': {$ref: '#/components/responses/NotFound'} '413': {$ref: '#/components/responses/PayloadTooLarge'} /v1/orders/history: get: tags: [Events and recovery] summary: Page orders history operationId: getV1OrdersHistory description: >- Newest first by creation; a `read` credential sees its identity's orders. Rows show current state ([history](/streaming#history)). security: [{session: []}, {makerCredential: []}] parameters: [{$ref: '#/components/parameters/HistoryAfter'}, {$ref: '#/components/parameters/Limit'}] responses: '200': description: A page of orders. content: {application/json: {schema: {$ref: '#/components/schemas/OrderHistoryPage'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} /v1/takes/history: get: tags: [Events and recovery] summary: Page complete takes operationId: getTakeHistory description: >- The taker's takes, newest first, each with all its fills; pages never split a take. Rows show current state ([history](/streaming#history)). security: [{session: []}] parameters: - {$ref: '#/components/parameters/HistoryAfter'} - name: limit in: query schema: {type: integer, minimum: 1, maximum: 100, default: 100} responses: '200': description: Complete takes. content: {application/json: {schema: {$ref: '#/components/schemas/TakeHistoryPage'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} /v1/fills/history: get: tags: [Events and recovery] summary: Page fills history operationId: getV1FillsHistory description: >- Newest first by creation; a `read` credential sees its identity's maker fills. Rows show current state ([history](/streaming#history)). security: [{session: []}, {makerCredential: []}] parameters: [{$ref: '#/components/parameters/HistoryAfter'}, {$ref: '#/components/parameters/Limit'}] responses: '200': description: A page of fills. content: {application/json: {schema: {$ref: '#/components/schemas/FillHistoryPage'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} /v1/withdrawals/history: get: tags: [Events and recovery] summary: Page withdrawals history operationId: getV1WithdrawalsHistory description: Newest first by creation. Rows show current state ([history](/streaming#history)). security: [{session: []}] parameters: [{$ref: '#/components/parameters/HistoryAfter'}, {$ref: '#/components/parameters/Limit'}] responses: '200': description: A page of withdrawals. content: {application/json: {schema: {$ref: '#/components/schemas/WithdrawalHistoryPage'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} /v1/explorer/transfers: get: tags: [Events and recovery] summary: Page public transfer receipts operationId: getExplorerTransfers description: >- One receipt per take or persisted route with a proven execution and none in flight, with all its proven executions: pages never split one. Its endpoints and amounts are the taker's source and final destination; a route stopped before its final delivery stays `partial`. Newest first by creation: a later settlement never moves a receipt. security: [{}, {session: []}] parameters: - name: scope in: query description: '`mine`: receipts with an execution where you are maker or taker.' schema: {type: string, enum: [all, mine], default: all} - {$ref: '#/components/parameters/HistoryAfter'} - {$ref: '#/components/parameters/Limit'} responses: '200': description: A page of transfer receipts. content: {application/json: {schema: {$ref: '#/components/schemas/ExplorerTransferPage'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '429': {$ref: '#/components/responses/RateLimited'} '500': {$ref: '#/components/responses/Internal'} /v1/explorer/transfers/pending: get: tags: [Events and recovery] summary: List live transfer receipts operationId: getExplorerPendingTransfers description: Groups signed pending executions by persisted route or take before limiting, with the route's executions already proven; a route between its legs stays listed. Once none is in flight, a receipt with a proven execution appears in explorer history instead. security: [{}, {session: []}] parameters: - {name: scope, in: query, schema: {type: string, enum: [all, mine], default: all}, description: '`mine`: receipts with an execution where you are maker or taker.'} - {$ref: '#/components/parameters/Limit'} responses: '200': description: Pending transfer receipts, newest first. content: application/json: schema: type: object required: [data] properties: data: {type: array, items: {$ref: '#/components/schemas/ExplorerTransfer'}, maxItems: 500} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '429': {$ref: '#/components/responses/RateLimited'} '500': {$ref: '#/components/responses/Internal'} /v1/explorer/transfers/{id}: get: tags: [Events and recovery] summary: Read a public transfer receipt operationId: getExplorerTransfer description: Public route details and constituent execution IDs for their signed trade proofs. A receipt's ID is its first take's; a continuation's take ID is `NOT_FOUND`. parameters: - {name: id, in: path, required: true, schema: {$ref: '#/components/schemas/Uuid'}} responses: '200': description: A transfer with a signed pending execution or a proven settlement. content: {application/json: {schema: {$ref: '#/components/schemas/ExplorerTransfer'}}} '400': {description: '`VALIDATION_ERROR`: `id` is not a UUID.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '404': {$ref: '#/components/responses/NotFound'} '429': {$ref: '#/components/responses/RateLimited'} '500': {$ref: '#/components/responses/Internal'} /v1/trades/history: get: tags: [Events and recovery] summary: Page trade history operationId: getV1TradesHistory description: >- Settled trades with a public proof, newest first by settlement. `a` and `b` together filter a pair, either direction. `scope=mine` needs a session. security: [{}, {session: []}] parameters: - name: scope in: query description: '`mine`: trades where you are maker or taker.' schema: {type: string, enum: [all, mine], default: all} - {$ref: '#/components/parameters/HistoryAfter'} - {$ref: '#/components/parameters/Limit'} - {name: a, in: query, schema: {$ref: '#/components/schemas/VenueId'}} - {name: b, in: query, schema: {$ref: '#/components/schemas/VenueId'}} responses: '200': description: A page of trades. content: {application/json: {schema: {$ref: '#/components/schemas/TradeHistoryPage'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '422': {$ref: '#/components/responses/VenueDisabled'} /v1/trades/pending: get: tags: [Events and recovery] summary: List pending trades operationId: getV1TradesPending description: >- Signed trades not yet final, newest first: they leave the list once settled, refunded, expired or lost. Unsigned preparations are not listed. `scope=mine` needs a session. security: [{}, {session: []}] parameters: - name: scope in: query description: '`mine`: trades where you are maker or taker.' schema: {type: string, enum: [all, mine], default: all} - {$ref: '#/components/parameters/Limit'} responses: '200': description: The pending trades. content: {application/json: {schema: {$ref: '#/components/schemas/PendingTradeList'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} /v1/events: get: tags: [Events and recovery] summary: Replay public events operationId: getV1Events description: >- Events in commit order ([HTTP replay](/streaming#http-replay)); continue from `next_cursor` until `has_more` is false, even after an empty page. parameters: [{$ref: '#/components/parameters/ReplayAfter'}, {$ref: '#/components/parameters/Limit'}] responses: '200': description: A page of events. content: {application/json: {schema: {$ref: '#/components/schemas/EventPage'}}} '400': {$ref: '#/components/responses/ValidationError'} '410': {$ref: '#/components/responses/ResyncRequired'} /v1/snapshot: get: tags: [Events and recovery] summary: Read public snapshot operationId: getV1Snapshot description: >- Public books and a committed cursor to replay strictly after. responses: '200': description: The snapshot. content: {application/json: {schema: {$ref: '#/components/schemas/Snapshot'}}} '503': {$ref: '#/components/responses/SnapshotTooLarge'} /v1/me/events: get: tags: [Events and recovery] summary: Replay private and public events operationId: getV1MeEvents description: >- Public plus your private events; a credential gets only its identity's orders, maker fills and lease. Credential scope: `read`. security: [{session: []}, {makerCredential: []}] parameters: [{$ref: '#/components/parameters/ReplayAfter'}, {$ref: '#/components/parameters/Limit'}] responses: '200': description: A page of events. content: {application/json: {schema: {$ref: '#/components/schemas/EventPage'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} '410': {$ref: '#/components/responses/ResyncRequired'} /v1/me/snapshot: get: tags: [Events and recovery] summary: Read private and public snapshot operationId: getV1MeSnapshot description: >- Your nonterminal orders and fills and unrevoked quote identities, with a replay cursor; `books` stays empty. Credential scope: `read`. security: [{session: []}, {makerCredential: []}] responses: '200': description: The snapshot. content: {application/json: {schema: {$ref: '#/components/schemas/PrivateSnapshot'}}} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} '503': {$ref: '#/components/responses/SnapshotTooLarge'} /v1/stream: get: tags: [Events and recovery] summary: WebSocket event replay operationId: getV1Stream description: >- Live events: the first text frame is a `StreamSubscription`, never `token` in the URL; frames are `EventPage`s of up to 100 events, or a `StreamControl` before closure ([WebSocket](/streaming#websocket)). Private streams need a session or `read` credential, rechecked about every 500 ms. responses: '101': description: Upgraded to WebSocket. '400': description: Not a WebSocket upgrade request. content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}} '429': {description: '`RATE_LIMITED`: connection limit reached.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} x-websocket: clientMessage: {$ref: '#/components/schemas/StreamSubscription'} serverMessage: {oneOf: [{$ref: '#/components/schemas/EventPage'}, {$ref: '#/components/schemas/StreamControl'}]} /v1/admin/access-codes: get: tags: [Admin] summary: Page access codes operationId: getAdminAccessCodes description: Newest first, paged like history. Admins only. x-excluded: true security: [{session: []}] parameters: [{$ref: '#/components/parameters/HistoryAfter'}, {$ref: '#/components/parameters/Limit'}] responses: '200': description: A page of codes. content: {application/json: {schema: {$ref: '#/components/schemas/AccessCodePage'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} post: tags: [Admin] summary: Create an access code operationId: postAdminAccessCodes description: Admins only. x-excluded: true security: [{session: []}] requestBody: required: true content: {application/json: {schema: {$ref: '#/components/schemas/AccessCodeInput'}}} responses: '201': description: The code, returned once. content: {application/json: {schema: {$ref: '#/components/schemas/AccessCodeCreated'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} '413': {$ref: '#/components/responses/PayloadTooLarge'} /v1/admin/access-codes/{id}: delete: tags: [Admin] summary: Revoke an access code operationId: deleteAdminAccessCodesId description: >- Stops further uses; admitted users stay admitted. Repeats change nothing. Admins only. x-excluded: true security: [{session: []}] parameters: [{$ref: '#/components/parameters/Id'}] responses: '204': description: Revoked. '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} '404': {$ref: '#/components/responses/NotFound'} /v1/admin/users: get: tags: [Admin] summary: Page users operationId: getAdminUsers description: Newest first, paged like history, with access and usage. Admins only. x-excluded: true security: [{session: []}] parameters: - {$ref: '#/components/parameters/HistoryAfter'} - {$ref: '#/components/parameters/Limit'} - name: access_code_id in: query description: Only users admitted through this access code. schema: {type: string, format: uuid} responses: '200': description: A page of users. content: {application/json: {schema: {$ref: '#/components/schemas/AdminUserPage'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} /v1/admin/users/{address}/access: put: tags: [Admin] summary: Admit or suspend a user operationId: putAdminUsersAddressAccess description: >- Admits a signed-in user, lifting any suspension, or suspends them, cancelling their quotes at once (readmission revives none). Suspended users keep sessions and can read, withdraw and close, but get `ACCESS_REQUIRED` on new commitments. Admins cannot be suspended (`VALIDATION_ERROR`). Admins only. x-excluded: true security: [{session: []}] parameters: [{name: address, in: path, required: true, schema: {$ref: '#/components/schemas/Address'}}] requestBody: required: true content: application/json: schema: type: object required: [access] properties: {access: {type: string, enum: [admitted, suspended]}} additionalProperties: false responses: '200': description: The user. content: {application/json: {schema: {$ref: '#/components/schemas/AdminUser'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} '404': {$ref: '#/components/responses/NotFound'} '413': {$ref: '#/components/responses/PayloadTooLarge'} /v1/admin/users/{address}/venue-payments/clear: post: tags: [Admin] summary: Clear failed venue payments operationId: postAdminUsersAddressVenuePaymentsClear description: >- Stops counting the user's failed payments from a venue (Lighter, Aster) made before now; two within a day suspend paying from a venue. Admins only. x-excluded: true security: [{session: []}] parameters: [{name: address, in: path, required: true, schema: {$ref: '#/components/schemas/Address'}}] responses: '204': {description: Cleared.} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} '404': {$ref: '#/components/responses/NotFound'} /v1/admin/makers: get: operationId: getAdminMakers tags: [Admin] summary: List makers and protocol-wide maker totals description: >- Admins only. Newest first, paged with `after`, with bot counts and allocated capital; `summary` covers every unarchived maker, whatever the page. security: [{session: []}] responses: '200': description: A page of makers and totals. content: {application/json: {schema: {$ref: '#/components/schemas/AdminMakers'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} '503': {$ref: '#/components/responses/SnapshotTooLarge'} parameters: - {name: after, in: query, schema: {type: string}} - {name: limit, in: query, schema: {type: integer, minimum: 1, maximum: 500}} - {name: include_archived, in: query, schema: {type: boolean}} x-excluded: true post: operationId: addAdminMaker tags: [Admin] summary: Register a maker by master wallet security: [{session: []}] responses: '201': description: The maker. content: {application/json: {schema: {$ref: '#/components/schemas/AdminMaker'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} '409': {$ref: '#/components/responses/StateConflict'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '503': {$ref: '#/components/responses/SnapshotTooLarge'} requestBody: required: true content: application/json: schema: type: object required: [master_address, name] properties: master_address: {type: string} name: {type: string, minLength: 1, maxLength: 80} x-excluded: true /v1/admin/makers/{address}: get: operationId: getAdminMaker tags: [Admin] summary: Read one maker and its automated identities security: [{session: []}] responses: '200': description: The maker. content: {application/json: {schema: {$ref: '#/components/schemas/AdminMaker'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} '404': {$ref: '#/components/responses/NotFound'} '503': {$ref: '#/components/responses/SnapshotTooLarge'} parameters: [{name: address, in: path, required: true, schema: {type: string}}] x-excluded: true delete: operationId: removeAdminMaker tags: [Admin] summary: Archive a maker and withdraw automated quoting description: Admins only. Also withdraws venue approval; repeats return the maker. security: [{session: []}] responses: '200': description: The maker. content: {application/json: {schema: {$ref: '#/components/schemas/AdminMaker'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} '404': {$ref: '#/components/responses/NotFound'} '503': {$ref: '#/components/responses/SnapshotTooLarge'} parameters: [{name: address, in: path, required: true, schema: {type: string}}] x-excluded: true /v1/admin/makers/{address}/name: put: operationId: renameAdminMaker tags: [Admin] summary: Name a maker security: [{session: []}] responses: '200': description: The maker. content: {application/json: {schema: {$ref: '#/components/schemas/AdminMaker'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} '404': {$ref: '#/components/responses/NotFound'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '503': {$ref: '#/components/responses/SnapshotTooLarge'} parameters: [{name: address, in: path, required: true, schema: {type: string}}] requestBody: required: true content: application/json: schema: {type: object, required: [name], properties: {name: {type: string, minLength: 1, maxLength: 80}}} x-excluded: true /v1/admin/makers/{address}/approval: put: operationId: approveAdminMaker tags: [Admin] summary: Grant or revoke maker approval for Lighter and Aster security: [{session: []}] responses: '200': description: The maker. content: {application/json: {schema: {$ref: '#/components/schemas/AdminMaker'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} '404': {$ref: '#/components/responses/NotFound'} '409': {$ref: '#/components/responses/StateConflict'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '503': {$ref: '#/components/responses/SnapshotTooLarge'} parameters: [{name: address, in: path, required: true, schema: {type: string}}] requestBody: required: true content: application/json: {schema: {type: object, required: [approved], properties: {approved: {type: boolean}}}} x-excluded: true /v1/admin/makers/{address}/quoting: put: operationId: setAdminMakerQuoting tags: [Admin] summary: Disable or resume automated quoting description: >- Admins only. Either value expires bot leases and cancels current quotes; `true` also unarchives the maker. Bots disabled one by one stay disabled. security: [{session: []}] responses: '200': description: The maker. content: {application/json: {schema: {$ref: '#/components/schemas/AdminMaker'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} '404': {$ref: '#/components/responses/NotFound'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '503': {$ref: '#/components/responses/SnapshotTooLarge'} parameters: [{name: address, in: path, required: true, schema: {type: string}}] requestBody: required: true content: application/json: {schema: {type: object, required: [enabled], properties: {enabled: {type: boolean}}}} x-excluded: true /v1/admin/makers/{address}/bots/{id}/quoting: put: operationId: setAdminBotQuoting tags: [Admin] summary: Disable or resume one bot security: [{session: []}] responses: '200': description: The maker. content: {application/json: {schema: {$ref: '#/components/schemas/AdminMaker'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} '404': {$ref: '#/components/responses/NotFound'} '409': {$ref: '#/components/responses/StateConflict'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '503': {$ref: '#/components/responses/SnapshotTooLarge'} parameters: - {name: address, in: path, required: true, schema: {type: string}} - {name: id, in: path, required: true, schema: {type: string, format: uuid}} requestBody: required: true content: application/json: {schema: {type: object, required: [enabled], properties: {enabled: {type: boolean}}}} x-excluded: true /v1/admin/metrics: get: operationId: adminProtocolMetrics tags: [Admin] summary: Read protocol liquidity, balances and 24-hour volume description: >- Admins only. USD values normalize stablecoins at face value, not market prices. Connected subtotal excludes unknown, stale and reconciling accounts; `totals.balance_complete` and each venue's `balances` counts mark partial totals. Route cells share inventory and are not additive. Unique liquidity is a conservative feasible allocation, at least as deep as each individual route; discrete minimum fills may leave inventory unused. security: [{session: []}] responses: '200': description: Protocol snapshot content: {application/json: {schema: {$ref: '#/components/schemas/AdminProtocolMetrics'}}} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {description: '`FORBIDDEN`: admins only.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} '503': {description: '`SNAPSHOT_TOO_LARGE`: more than 1000 quoted orders.', content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}} x-excluded: true /v1/admin/relayer: get: tags: [Admin] summary: Relayer costs and current gas operationId: getAdminRelayer x-excluded: true security: [{session: []}] description: >- Admins only. Gas is exact finalized receipt gasUsed × effectiveGasPrice. USD is a historical Chainlink subtotal; unpriced transactions never count as zero. Average transaction USD divides only priced transactions. Current balances and autonomy do not change with the period. `average_day_usd` spreads spend over the whole window, empty days included. parameters: - name: period in: query schema: {type: string, enum: [24h, 7d, 30d, all], default: 30d} description: >- Rolling window ending now; ignored with `from` and `to`. `all` starts at the oldest retained relay. - {name: chain_id, in: query, schema: {type: integer, minimum: 0}, description: One configured blockchain.} - name: from in: query schema: {type: string, format: date-time} description: Inclusive window start; give with `to`. - name: to in: query schema: {type: string, format: date-time} description: Exclusive window end, at most now; give with `from`. responses: '200': description: Relayer costs. content: {application/json: {schema: {$ref: '#/components/schemas/AdminRelayerSnapshot'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} /v1/admin/relayer/transactions: get: tags: [Admin] summary: Page relayer transactions operationId: getAdminRelayerTransactions x-excluded: true security: [{session: []}] description: >- Admins only. Every relay signed in the window, newest first, with its status and duration; gas and USD as in `GET /v1/admin/relayer`. parameters: - name: period in: query schema: {type: string, enum: [24h, 7d, 30d, all], default: 30d} description: >- Rolling window ending now; ignored with `from` and `to`. `all` starts at the oldest retained relay. - {name: chain_id, in: query, schema: {type: integer, minimum: 0}, description: One configured blockchain.} - name: from in: query schema: {type: string, format: date-time} description: Inclusive window start; give with `to`. When paging, reuse `from` of `GET /v1/admin/relayer`. - name: to in: query schema: {type: string, format: date-time} description: >- Exclusive window end, at most now; give with `from`. When paging, reuse `to` of `GET /v1/admin/relayer`. - {$ref: '#/components/parameters/HistoryAfter'} - {$ref: '#/components/parameters/Limit'} responses: '200': description: A page of relays. content: {application/json: {schema: {$ref: '#/components/schemas/AdminRelayerTransactionPage'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} /v1/admin/fees: get: tags: [Admin] summary: Read taker fees operationId: getAdminFees x-excluded: true security: [{session: []}] description: >- Admins only. Each pair's taker fee, each escrow's fee recipient, and the fees of fills settled in the last 30 days per venue. responses: '200': description: The fees. content: {application/json: {schema: {$ref: '#/components/schemas/AdminFees'}}} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} put: tags: [Admin] summary: Set pairs' taker fees operationId: setAdminFees x-excluded: true security: [{session: []}] description: >- Admins only. The fees of takes accepted from now on, all or none. A fee above 0 needs the escrow collecting it, the payment's or, paid from Lighter or Aster, the delivery's, to name a fee recipient, else `STATE_CONFLICT`. requestBody: required: true content: application/json: schema: type: object required: [pairs] properties: pairs: type: array minItems: 1 maxItems: 64 items: type: object required: [from, to, bps] properties: from: {$ref: '#/components/schemas/VenueId'} to: {$ref: '#/components/schemas/VenueId'} bps: {$ref: '#/components/schemas/FeeBps'} additionalProperties: false additionalProperties: false responses: '200': description: The fees. content: {application/json: {schema: {$ref: '#/components/schemas/AdminFees'}}} '400': {$ref: '#/components/responses/ValidationError'} '401': {$ref: '#/components/responses/Unauthenticated'} '403': {$ref: '#/components/responses/Forbidden'} '409': {$ref: '#/components/responses/StateConflict'} '502': {$ref: '#/components/responses/VenueUnavailable'} components: securitySchemes: session: type: http scheme: bearer description: >- From `POST /v1/auth/verify`; seven days by default, revocable. Required for financial operations. 60 requests/s, burst 120, shared by the user's sessions. makerCredential: type: http scheme: bearer description: >- `mk_` bearer, returned once at creation or rotation, limited to its quote identity and each route's stated scope; new quote commitments also need the owner's access, delivery reports do not. Never moves capital. 60 requests/s, burst 120, per credential. partnerKey: type: apiKey in: header name: x-lamarge-partner-key description: >- A partner service's key, configured only as its SHA-256 in `PARTNER_KEYS`. 5 requests/s, burst 60, per partner. parameters: OrderId: {name: id, in: path, required: true, schema: {$ref: '#/components/schemas/Bytes32'}} PairA: name: a in: query required: true schema: {$ref: '#/components/schemas/VenueId'} PairB: name: b in: query required: true schema: {$ref: '#/components/schemas/VenueId'} Id: {name: id, in: path, required: true, schema: {$ref: '#/components/schemas/Uuid'}} HistoryAfter: name: after in: query schema: {type: string, maxLength: 512} description: '`next_cursor` from the same route and filters; omit for the newest page.' Limit: {name: limit, in: query, schema: {type: integer, minimum: 1, maximum: 500, default: 100}} ReplayAfter: name: after in: query schema: {$ref: '#/components/schemas/Cursor'} description: Replay strictly after this cursor; 0 when omitted. schemas: AdminFees: type: object required: [max_bps, pairs, escrows, collected_30d] properties: max_bps: {type: integer, const: 100} pairs: type: array description: Every pair of venues a take joins, a disabled venue's included as its fee applies once enabled. items: type: object required: [from, to, bps, enabled, updated_at, updated_by] properties: from: {$ref: '#/components/schemas/VenueId'} to: {$ref: '#/components/schemas/VenueId'} bps: {$ref: '#/components/schemas/FeeBps'} enabled: {type: boolean, description: Both venues are enabled.} updated_at: {type: [string, 'null'], format: date-time} updated_by: {oneOf: [{$ref: '#/components/schemas/Address'}, {type: 'null'}]} additionalProperties: false escrows: type: array items: type: object required: [venue, chain_id, escrow, fee_recipient, error] properties: venue: {$ref: '#/components/schemas/VenueId'} chain_id: {type: integer} escrow: {$ref: '#/components/schemas/Address'} fee_recipient: oneOf: [{$ref: '#/components/schemas/Address'}, {type: 'null'}] description: Null while governance has not set one, or the escrow predates fees. error: {type: [string, 'null'], description: Why the escrow could not be read.} additionalProperties: false collected_30d: type: array items: type: object required: [venue, amount] properties: venue: {$ref: '#/components/schemas/VenueId'} amount: {$ref: '#/components/schemas/Amount'} additionalProperties: false additionalProperties: false AdminRelayerTransactionPage: type: object required: [data, next_cursor, has_more] properties: data: {type: array, items: {$ref: '#/components/schemas/AdminRelayerTransaction'}} next_cursor: {type: [string, 'null']} has_more: {type: boolean} AdminRelayerTransaction: type: object description: A relay the operator signed, in any status. Gas fields are null until its receipt is collected. required: [id, chain_id, hash, operator, operation, status, error, created_at, mined_at, duration_seconds, block_number, native_symbol, native_decimals, gas_used, effective_gas_price, native_cost, usd_cost, price_error, feed, price_updated_at] properties: id: {type: string, format: uuid} chain_id: {type: integer, minimum: 0} hash: {type: [string, 'null']} operator: {type: [string, 'null']} operation: {type: string} status: type: string enum: [pending, replaced, mined, reverted, failed] description: >- `pending` sent and not final; `replaced` given up for another relay; `mined` and `reverted` final; `failed` never sent, or its nonce taken. error: {type: [string, 'null']} created_at: {type: string, format: date-time, description: When the operator signed it.} mined_at: {type: [string, 'null'], format: date-time} duration_seconds: type: [integer, 'null'] minimum: 0 description: >- From `created_at` to its block, else to its replacement, else to now while pending; null for a failed relay never replaced, or a final one before its receipt is collected. block_number: {type: [string, 'null']} native_symbol: {type: string} native_decimals: {type: integer, minimum: 0} gas_used: {type: [string, 'null'], pattern: ^\d+(\.\d+)?$, description: 'Gas units, exact decimal string.'} effective_gas_price: {type: [string, 'null'], pattern: ^\d+(\.\d+)?$, description: 'Wei, exact decimal string.'} native_cost: {type: [string, 'null'], pattern: ^\d+(\.\d+)?$, description: 'Wei, exact decimal string.'} usd_cost: {type: [string, 'null'], pattern: ^\d+(\.\d+)?$, description: 'Dollars, exact decimal string.'} price_error: {type: [string, 'null']} feed: {type: [string, 'null']} price_updated_at: {type: [string, 'null'], format: date-time} AdminRelayerSnapshot: type: object required: [as_of, from, to, period, chain_id, summary, chains, collection] properties: as_of: {type: string, format: date-time} from: {type: string, format: date-time} to: {type: string, format: date-time} period: {type: string, enum: [24h, 7d, 30d, all], default: 30d} chain_id: {type: [integer, 'null'], minimum: 0} summary: {$ref: '#/components/schemas/AdminRelayerTotals'} chains: {type: array, items: {$ref: '#/components/schemas/AdminRelayerChain'}} collection: type: object required: [missing_receipts, oldest_retained_at, oldest_collected_at, retained_history_only] properties: missing_receipts: {type: integer, minimum: 0} oldest_retained_at: {type: [string, 'null'], format: date-time} oldest_collected_at: {type: [string, 'null'], format: date-time} retained_history_only: {type: boolean, enum: [true]} AdminRelayerChain: type: object required: [chain_id, name, venue, escrow, native_symbol, native_decimals, operator, current_operator, balance, balance_usd, minimum, observed_at, ready, state, time_to_empty_seconds, feed, price_usd, price_updated_at, price_error, native_cost, totals] properties: chain_id: {type: integer, minimum: 0} name: {type: string} venue: {type: string} escrow: {type: string} native_symbol: {type: string} native_decimals: {type: integer, minimum: 0} operator: {type: string} current_operator: {type: boolean} balance: {type: [string, 'null'], pattern: ^\d+(\.\d+)?$, description: 'Wei, exact decimal string.'} balance_usd: {type: [string, 'null'], pattern: ^\d+(\.\d+)?$, description: 'Dollars, exact decimal string.'} minimum: {type: string, pattern: ^\d+(\.\d+)?$, description: 'Wei, exact decimal string.'} observed_at: {type: [string, 'null'], format: date-time} ready: {type: boolean} state: {type: string} time_to_empty_seconds: {type: [number, 'null']} feed: {type: [string, 'null']} price_usd: {type: [string, 'null'], pattern: ^\d+(\.\d+)?$, description: 'Dollars, exact decimal string.'} price_updated_at: {type: [string, 'null'], format: date-time} price_error: {type: [string, 'null']} native_cost: {type: string, pattern: ^\d+(\.\d+)?$, description: 'Wei, exact decimal string.'} totals: {$ref: '#/components/schemas/AdminRelayerTotals'} AdminRelayerTotals: type: object required: [usd_cost, tx_count, reverted_count, priced_count, unpriced_count, average_tx_usd, average_day_usd] properties: usd_cost: {type: [string, 'null'], pattern: ^\d+(\.\d+)?$, description: 'Dollars, exact decimal string.'} tx_count: {type: integer, minimum: 0} reverted_count: {type: integer, minimum: 0} priced_count: {type: integer, minimum: 0} unpriced_count: {type: integer, minimum: 0} average_tx_usd: {type: [string, 'null'], pattern: ^\d+(\.\d+)?$, description: 'Dollars, exact decimal string.'} average_day_usd: {type: [string, 'null'], pattern: ^\d+(\.\d+)?$, description: 'Dollars, exact decimal string.'} AdminProtocolMetrics: type: object required: [as_of, window_from, valuation, spread_target_percent, totals, venues, routes] properties: as_of: {type: string} window_from: {type: string} valuation: {type: string, enum: [stablecoin_face_value]} spread_target_percent: {type: string} totals: type: object required: [available_usd, connected_usd, volume_24h_usd, trades_24h, balance_complete] properties: available_usd: {type: string} connected_usd: {type: string} volume_24h_usd: {type: string} trades_24h: {type: integer} balance_complete: {type: boolean} additionalProperties: false venues: {type: array, items: {$ref: '#/components/schemas/AdminMetricVenue'}} routes: {type: array, items: {$ref: '#/components/schemas/AdminMetricRoute'}} additionalProperties: false AdminMetricRoute: type: object required: [from, to, state, available, available_usd, best_price, spread_percent, spread_state, quotes, causes] properties: from: {type: string} to: {type: string} state: {type: string, enum: [unsupported, disabled, blocked, empty, available]} available: {type: string} available_usd: {type: string} best_price: {type: [string, 'null']} spread_percent: {type: [string, 'null']} spread_state: {type: string, enum: [within_target, wide, crossed, unavailable]} quotes: {type: array, items: {$ref: '#/components/schemas/AdminMetricQuote'}} causes: {type: array, items: {$ref: '#/components/schemas/AdminMetricCause'}} additionalProperties: false AdminMetricQuote: type: object required: [order_id, maker_address, quote_index, supply, receive, available, quoted_at] properties: order_id: {type: string} maker_address: {type: string} quote_index: {type: integer} supply: {type: string} receive: {type: string} available: {type: string} quoted_at: {type: string} additionalProperties: false AdminMetricVenue: type: object required: [id, name, enabled, symbol, decimals, available, available_usd, connected_usd, volume_24h, volume_24h_usd, trades_24h, balances, causes] properties: id: {type: string} name: {type: string} enabled: {type: boolean} symbol: {type: string} decimals: {type: integer} available: {type: string} available_usd: {type: string} connected_usd: {type: string} volume_24h: {type: string} volume_24h_usd: {type: string} trades_24h: {type: integer} balances: {$ref: '#/components/schemas/AdminBalanceCoverage'} causes: {type: array, items: {$ref: '#/components/schemas/AdminMetricCause'}} additionalProperties: false AdminBalanceCoverage: type: object required: [fresh, stale, unknown, reconciling, oldest_observed_at] properties: fresh: {type: integer} stale: {type: integer} unknown: {type: integer} reconciling: {type: integer} oldest_observed_at: {type: [string, 'null']} additionalProperties: false AdminMetricCause: type: object required: [code, venue, chain_id, affected_accounts, message, target, blocking] properties: code: {type: string} venue: {type: string} chain_id: {type: [integer, 'null']} affected_accounts: {type: integer} message: {type: string} target: {type: string, enum: [relayer, makers, liquidity]} blocking: {type: boolean} additionalProperties: false AdminMakers: type: object required: [as_of, data, next_cursor, has_more, summary] properties: as_of: {type: string, format: date-time} data: {type: array, items: {$ref: '#/components/schemas/AdminMakerListItem'}} next_cursor: {type: [string, 'null']} has_more: {type: boolean} summary: type: object required: [makers, bots, connected_bots, quoting_bots, capital] properties: makers: {type: integer, minimum: 0} bots: {type: integer, minimum: 0} connected_bots: {type: integer, minimum: 0} quoting_bots: {type: integer, minimum: 0} capital: {type: array, items: {$ref: '#/components/schemas/AdminMakerCapital'}} AdminMakerListItem: type: object required: [master_address, name, created_at, archived_at, quoting_disabled_at, bots, connected_bots, capital] properties: master_address: {type: string} name: {type: string} created_at: {type: string, format: date-time} archived_at: {type: [string, 'null'], format: date-time} quoting_disabled_at: {type: [string, 'null'], format: date-time} bots: {type: integer, minimum: 0} connected_bots: {type: integer, minimum: 0} capital: {type: array, items: {$ref: '#/components/schemas/AdminMakerAllocation'}} AdminMakerAllocation: type: object required: [venue, symbol, decimals, allocated] properties: venue: {type: string} symbol: {type: string} decimals: {type: integer, minimum: 0} allocated: {type: string, pattern: ^\d+$} AdminMaker: type: object required: [master_address, name, created_at, archived_at, quoting_disabled_at, maker_approved_at, last_sign_in_at, pending_deliveries, bots, session_bot, capital, quotes, quotes_truncated, deliveries_24h, results] properties: results: description: >- The maker's results as its Account shows them (`GET /v1/me/stats` `maker`); null before its first sign-in. oneOf: [{$ref: '#/components/schemas/MakerResults'}, {type: 'null'}] master_address: {type: string} name: {type: string} created_at: {type: string, format: date-time} archived_at: {type: [string, 'null'], format: date-time} quoting_disabled_at: {type: [string, 'null'], format: date-time} maker_approved_at: {type: [string, 'null'], format: date-time} last_sign_in_at: {type: [string, 'null'], format: date-time} pending_deliveries: {type: integer, minimum: 0} bots: {type: array, items: {$ref: '#/components/schemas/AdminMakerBot'}} session_bot: {oneOf: [{$ref: '#/components/schemas/AdminMakerSessionBot'}, {type: 'null'}]} capital: {type: array, items: {$ref: '#/components/schemas/AdminMakerCapital'}} quotes: {type: array, items: {$ref: '#/components/schemas/AdminMakerQuote'}} quotes_truncated: {type: boolean} deliveries_24h: type: object required: [due, verified, reported_late, missing, window_start, window_end] properties: due: {type: integer, minimum: 0} verified: {type: integer, minimum: 0} reported_late: {type: integer, minimum: 0} missing: {type: integer, minimum: 0} window_start: {type: string, format: date-time} window_end: {type: string, format: date-time} AdminMakerQuote: type: object required: [order_id, identity_id, from, to, supply, receive, available, quoted_at, unavailable_reason, quote_index] properties: order_id: {type: string} identity_id: {type: string, format: uuid} from: {type: string} to: {type: string} supply: {type: string} receive: {type: string} available: {type: string} quoted_at: {type: string, format: date-time} unavailable_reason: {type: [string, 'null']} quote_index: {type: integer, minimum: 0} AdminMakerCapital: type: object required: [venue, symbol, decimals, allocated, reserved, available] properties: venue: {type: string} symbol: {type: string} decimals: {type: integer, minimum: 0} allocated: {type: string, pattern: ^\d+$} reserved: {type: string, pattern: ^\d+$} available: {type: string, pattern: ^\d+$} AdminMakerSessionBot: type: object description: >- A bot on the maker's master session, listed once it renewed the lease: connected within two minutes of its last renewal, as the book counts it for a Lighter or Aster pool. required: [id, connected, quoting, quoting_disabled_at, last_lease_received_at, last_quote_at, connected_since, offline_since, uptime_24h_seconds, disconnections_24h, periods_24h] additionalProperties: false properties: id: {type: string, format: uuid} connected: {type: boolean} quoting: {type: boolean} quoting_disabled_at: {type: [string, 'null'], format: date-time} last_lease_received_at: {type: string, format: date-time} last_quote_at: {type: [string, 'null'], format: date-time} connected_since: {type: [string, 'null'], format: date-time} offline_since: {type: [string, 'null'], format: date-time} uptime_24h_seconds: {type: integer, minimum: 0} disconnections_24h: {type: integer, minimum: 0} periods_24h: type: array items: type: object required: [from, to] properties: from: {type: string, format: date-time} to: {type: string, format: date-time} AdminMakerBot: type: object required: [id, name, signer, connected, quoting, quoting_disabled_at, revoked_at, credential_expires_at, lease_expires_at, last_lease_received_at, last_quote_at, api_rtt_ms, api_rtt_sampled_at, api_rtt_stale, connected_since, offline_since, uptime_24h_seconds, disconnections_24h, periods_24h] properties: id: {type: string, format: uuid} name: {type: string} signer: {type: string} connected: {type: boolean} quoting: {type: boolean} quoting_disabled_at: {type: [string, 'null'], format: date-time} revoked_at: {type: [string, 'null'], format: date-time} credential_expires_at: {type: string, format: date-time} lease_expires_at: {type: string, format: date-time} last_lease_received_at: {type: [string, 'null'], format: date-time} last_quote_at: {type: [string, 'null'], format: date-time} api_rtt_ms: {type: [number, 'null']} api_rtt_sampled_at: {type: [string, 'null'], format: date-time} api_rtt_stale: {type: boolean} connected_since: type: [string, 'null'] format: date-time description: Start of the current connected period, while connected. offline_since: type: [string, 'null'] format: date-time description: End of the last connected period, while offline. uptime_24h_seconds: {type: integer, minimum: 0} disconnections_24h: {type: integer, minimum: 0, description: Connected periods that ended in the last 24 hours.} periods_24h: type: array description: >- Connected periods over the last 24 hours, clipped to the window, oldest first. A period runs while the bot renews its lease, until its lease or credential ends, it is revoked or its quoting changed. items: type: object required: [from, to] properties: from: {type: string, format: date-time} to: {type: string, format: date-time} additionalProperties: false VenueId: type: string description: A venue id from `GET /v1/venues`. Destination: type: string enum: [venue, wallet] description: >- Where a take delivers on `to`: `venue`, into the taker's account linked there; `wallet`, by plain transfer to `recipient`'s address on `to`'s escrow chain, in that chain's wallet token (`chain.wallet` in `GET /v1/venues`; on Polygon native USDC converted from pUSD), to any address a [wallet delivery](/how-it-works#wallet-delivery) accepts. TokenAmount: type: object required: [token, amount] properties: token: {$ref: '#/components/schemas/Address'} amount: {$ref: '#/components/schemas/Amount'} additionalProperties: false WalletReceipt: type: object description: What a wallet delivery's recipient received, as the escrow's `WalletPaid` recorded it. required: [token, amount, sender] properties: token: {$ref: '#/components/schemas/Address'} amount: $ref: '#/components/schemas/Amount' description: >- This fill's share, in `token` base units: the fills one transaction pays to one recipient share one transfer, split in proportion to `amount_out`, the fill with the highest id taking the rounding. sender: $ref: '#/components/schemas/Address' description: The escrow, or on Polygon the pinned converter, as `WalletPaid` names it. additionalProperties: false FeeBps: type: integer minimum: 0 maximum: 100 description: Basis points; the escrow refuses more than 100. Amount: type: string pattern: ^[0-9]{1,78}$ description: >- Decimal base units of the venue's token (`decimals` in `GET /v1/venues`), below 2^256: with 6 decimals, `"1000000"` is 1 token. Address: type: string pattern: ^0x[0-9a-fA-F]{40}$ description: Any case accepted; responses are lowercase except inside typed data and signed messages. Bytes32: {type: string, pattern: '^0x[0-9a-fA-F]{64}$'} Signature: type: string pattern: ^0x[0-9a-fA-F]{130}$ description: A 65-byte signature `r ‖ s ‖ v`, `v` 0, 1, 27 or 28, `s` low (EIP-2). TakeAttestation: type: object description: >- Present when LaMarge attests the request: its attester's EIP-712 signature of `TakeAttestation(address signer,bytes32 digest,TakeTerms terms)` under the domain `{name: "LaMarge attestation", version: "2"}`, `digest` the hash the wallet signs (the typed data's EIP-712 hash, or the owner message's `personal_sign` hash); for a wallet delivery, `WalletTakeAttestation(address signer,bytes32 digest,WalletTakeTerms terms)` in the same domain. Check it with `verifyAttestation` from `@lamarge/sdk/attestation` ([taker quickstart](/taker-quickstart)). required: [signature, terms] properties: signature: {$ref: '#/components/schemas/Signature'} terms: oneOf: [{$ref: '#/components/schemas/TakeTerms'}, {$ref: '#/components/schemas/WalletTakeTerms'}] additionalProperties: false TakeTerms: type: object description: >- `TakeTerms(bytes32 take,string from,string to,address recipient,address token,uint256 amountOut,uint64 payBy)`: what the take delivers, as LaMarge committed it. required: [take, from, to, recipient, token, amountOut, payBy] properties: take: allOf: [{$ref: '#/components/schemas/Bytes32'}] description: The take id's 16 bytes then 16 zero bytes. from: {$ref: '#/components/schemas/VenueId'} to: {$ref: '#/components/schemas/VenueId'} recipient: allOf: [{$ref: '#/components/schemas/Address'}] description: The account linked on `to` the take delivers to. token: allOf: [{$ref: '#/components/schemas/Address'}] description: The token `to` delivers. amountOut: allOf: [{$ref: '#/components/schemas/Amount'}] description: What the take delivers in all, in the token's base units. payBy: {type: integer, description: 'Unix seconds: the payment is signed before then, or not at all.'} additionalProperties: false WalletTakeTerms: type: object description: >- `WalletTakeTerms(bytes32 take,string from,string to,address recipient,address token,uint256 amountOut,uint64 payBy,string destination)`: a wallet delivery's terms, as LaMarge committed them. required: [take, from, to, recipient, token, amountOut, payBy, destination] properties: take: allOf: [{$ref: '#/components/schemas/Bytes32'}] description: The take id's 16 bytes then 16 zero bytes. from: {$ref: '#/components/schemas/VenueId'} to: {$ref: '#/components/schemas/VenueId'} recipient: allOf: [{$ref: '#/components/schemas/Address'}] description: The address the take transfers to. token: allOf: [{$ref: '#/components/schemas/Address'}] description: The wallet token of `to`'s chain. amountOut: allOf: [{$ref: '#/components/schemas/Amount'}] description: The least the recipient receives in all, `minimum_received`, in the token's base units. payBy: {type: integer, description: 'Unix seconds: the payment is signed before then, or not at all.'} destination: {type: string, enum: [wallet]} additionalProperties: false SetupAttestation: type: object description: >- LaMarge's word that it asks `signer` to approve its Aster agent or register its Lighter key: its attester's EIP-712 signature of `SetupAttestation(address signer,bytes32 digest)` under the domain `{name: "LaMarge attestation", version: "2"}`, `digest` the hash the wallet signs. Verified with `verifyAttestation` from `@lamarge/sdk/attestation`. required: [signature] properties: signature: {$ref: '#/components/schemas/Signature'} additionalProperties: false QuoteSignature: type: string pattern: '^0x([0-9a-fA-F]{2})*$' maxLength: 32770 description: An EOA signature. Trade proofs of older fills may carry an opaque ERC-1271 signature (up to 16384 bytes) from a quote delegate. Timestamp: type: string format: date-time description: RFC 3339 UTC (`Z` or `+00:00`), fractional seconds optional. Error: type: object required: [error] properties: error: type: object required: [code, message, request_id, retryable] properties: code: type: string description: Stable; see [errors](/api-reference/overview#errors). message: type: string description: Human-readable; do not parse. reason: type: string description: >- Stable sub-case of `code`, where the route lists its values. venue: $ref: '#/components/schemas/VenueId' description: '`SETUP_REQUIRED`: the venue whose account needs setup.' step: type: string enum: [permit, agent, api_key] description: '`SETUP_REQUIRED`: the step to do, by [setup](/api-reference/account/setup).' request_id: {$ref: '#/components/schemas/Uuid'} retryable: type: boolean description: >- True for 425, 429, 503 and 502 except `VENUE_REJECTED`. Retry with the same client id, draft or signed operation; an uncertain withdrawal may have succeeded. Venue: type: object required: [id, name, enabled, settlement, chain, margin_move, release_minimum] properties: id: {$ref: '#/components/schemas/VenueId'} name: {type: string} enabled: type: boolean description: Enabled and configured in this deployment. settlement: type: [string, 'null'] enum: [escrow, venue, null] description: >- `escrow`: the maker's side of each fill locks in the escrow on `chain`. `venue` (Lighter, Aster): the maker delivers inside the venue ([active market making](/market-making#active-market-making)); `chain` only names signing terms. Null for a disabled venue. chain: oneOf: [{$ref: '#/components/schemas/EscrowChain'}, {type: 'null'}] description: Null for a disabled venue. margin_move: oneOf: [{$ref: '#/components/schemas/MarginMoveSpec'}, {type: 'null'}] description: Margin-transfer format; null when disabled or without margin transfers (Lighter, GMX). release_minimum: type: [string, 'null'] description: >- Smallest amount the venue credits (deposit contract, or Lighter's 1 USDC transfer); a smaller escrow release stays in escrow. Null when none. DirectRequest: type: object required: [client_operation_id, venue, kind, owner, recipient, token, amount, min_out] properties: move_id: $ref: '#/components/schemas/Uuid' description: "The move this GMX withdrawal belongs to ([moves](/how-it-works#moves-and-bridges)): a withdrawal to the payer's wallet from the move's GMX origin." client_operation_id: {type: string, minLength: 1, maxLength: 64} venue: {type: string, enum: [hyperliquid, polymarket, gmx]} kind: {type: string, enum: [deposit, withdrawal]} owner: {$ref: '#/components/schemas/Address'} recipient: {$ref: '#/components/schemas/Address'} token: {$ref: '#/components/schemas/Address'} amount: {$ref: '#/components/schemas/Amount'} min_out: $ref: '#/components/schemas/Amount' description: '`amount`; for native USDC, the least pUSD deposited.' additionalProperties: false DirectOperation: type: object required: [id, client_operation_id, venue, kind, chain_id, escrow, owner, recipient, token, amount, min_out, nonce, deadline, state, attempts, tx_hash, received] properties: move_id: {oneOf: [{$ref: '#/components/schemas/Uuid'}, {type: 'null'}]} id: {$ref: '#/components/schemas/Uuid'} client_operation_id: {type: string} venue: {type: string} kind: {type: string} chain_id: {type: integer} escrow: {$ref: '#/components/schemas/Address'} owner: {$ref: '#/components/schemas/Address'} recipient: {$ref: '#/components/schemas/Address'} token: {$ref: '#/components/schemas/Address'} amount: {$ref: '#/components/schemas/Amount'} min_out: {$ref: '#/components/schemas/Amount'} nonce: {$ref: '#/components/schemas/Amount'} deadline: {$ref: '#/components/schemas/Amount'} state: {type: string, enum: [prepared, pending, confirmed, failed, expired]} attempts: {type: array, items: {$ref: '#/components/schemas/Bytes32'}} tx_hash: {oneOf: [{$ref: '#/components/schemas/Bytes32'}, {type: 'null'}]} received: {oneOf: [{$ref: '#/components/schemas/Amount'}, {type: 'null'}]} MoveVenue: type: string enum: [hyperliquid, polymarket, gmx, aster, lighter, wallet] description: A venue account, or `wallet` with a chain and token. MoveEndpoint: type: object required: [venue] properties: venue: {$ref: '#/components/schemas/MoveVenue'} chain_id: type: [integer, 'null'] description: 'With `wallet`: 999 (USDC), 137 (pUSD or native USDC), 42161 (USDC) or 56 (USDT).' token: {oneOf: [{$ref: '#/components/schemas/Address'}, {type: 'null'}]} additionalProperties: false MoveRequest: type: object required: [client_move_id, from, to, amount_in, min_out, payer, recipient] properties: client_move_id: {$ref: '#/components/schemas/ClientId'} from: {$ref: '#/components/schemas/MoveEndpoint'} to: {$ref: '#/components/schemas/MoveEndpoint'} amount_in: $ref: '#/components/schemas/Amount' description: Everything the move takes from its origin, in the origin token's base units. min_out: $ref: '#/components/schemas/Amount' description: The least delivered over all parts, in the destination token's base units; each part's floor is its share at the same rate, rounded up. payer: $ref: '#/components/schemas/Address' description: 'The account linked on `from`; from a wallet, its owner: the master address or an account linked on any venue.' recipient: type: string description: 'An address; on `to: lighter`, the Lighter account index, which the client checks on Lighter.' max_fee_bps: {$ref: '#/components/schemas/FeeBps'} additionalProperties: false MoveQuote: type: object required: [lamarge, lamarge_unavailable, bridge, bridge_unavailable, unallocated, unallocated_reason] properties: lamarge: description: LaMarge's part, null when none. oneOf: - type: object required: [route, budget] properties: route: {$ref: '#/components/schemas/Route'} budget: $ref: '#/components/schemas/Amount' description: What the part takes from the origin, in the origin token (a Polygon native-USDC origin's conversion input). additionalProperties: false - {type: 'null'} lamarge_unavailable: type: [string, 'null'] enum: [no_route, no_liquidity, no_deposit, not_admitted, unhealthy, fee_consent, null] description: Why LaMarge takes no part. bridge: description: The external part for the rest, null when none; an estimate, quoted again before signing. oneOf: [{$ref: '#/components/schemas/BridgeQuote'}, {type: 'null'}] bridge_unavailable: type: [string, 'null'] enum: [insufficient_liquidity, below_minimum, unsupported, hyperliquid_mode, provider_unavailable, slippage, disabled, null] description: Why no bridge carries the rest; `slippage` when its guaranteed output is below the part's floor; `disabled` when the deployment has no bridge provider. unallocated: $ref: '#/components/schemas/Amount' description: What neither part carries, in the origin token. unallocated_reason: {type: [string, 'null']} additionalProperties: false BridgeQuote: type: object required: [provider, amount_in, amount_out, minimum_out, account_credit, wallet_surplus, eta_seconds] properties: provider: {type: string, enum: [relay]} amount_in: {$ref: '#/components/schemas/Amount'} amount_out: $ref: '#/components/schemas/Amount' description: Expected, in the destination token. minimum_out: $ref: '#/components/schemas/Amount' description: Guaranteed by the provider, in the destination token. account_credit: oneOf: [{$ref: '#/components/schemas/Amount'}, {type: 'null'}] description: The least a Polymarket, GMX or Aster account is credited; it is credited the whole output. Null otherwise. wallet_surplus: oneOf: [{$ref: '#/components/schemas/Amount'}, {type: 'null'}] description: What reaches the recipient's wallet beside a Polymarket, GMX or Aster account, expected; zero, the account taking the whole output. Null otherwise. eta_seconds: {type: integer} additionalProperties: false MovePart: type: object required: [id, final] properties: id: {$ref: '#/components/schemas/Uuid'} final: {type: boolean} additionalProperties: false Move: type: object required: [id, client_move_id, from, to, amount_in, min_out, payer, recipient, max_fee_bps, transfers, withdrawals, direct, bridges, closed_at, unallocated, unallocated_reason, state, created_at] properties: id: {$ref: '#/components/schemas/Uuid'} client_move_id: {type: string} from: {$ref: '#/components/schemas/MoveEndpoint'} to: {$ref: '#/components/schemas/MoveEndpoint'} amount_in: {$ref: '#/components/schemas/Amount'} min_out: {$ref: '#/components/schemas/Amount'} payer: {$ref: '#/components/schemas/Address'} recipient: {type: string} max_fee_bps: {oneOf: [{$ref: '#/components/schemas/FeeBps'}, {type: 'null'}]} transfers: type: array items: {$ref: '#/components/schemas/MovePart'} description: Root transfers; a route's continuation is its root's (`previous_transfer_id`). Final once cancelled or its take is final, and every continuation not cancelled has a final take. withdrawals: {type: array, items: {$ref: '#/components/schemas/MovePart'}} direct: {type: array, items: {$ref: '#/components/schemas/MovePart'}} bridges: {type: array, items: {$ref: '#/components/schemas/Bridge'}} closed_at: {type: [string, 'null'], format: date-time} unallocated: {oneOf: [{$ref: '#/components/schemas/Amount'}, {type: 'null'}]} unallocated_reason: {type: [string, 'null']} state: type: string enum: [open, settling, final] description: '`open` until closed; `settling` closed with a part still running; `final` closed with every part final, a bridge `stuck`, `failed` or `expired` included (a late deposit on a `failed` bridge can return the move to `settling`).' created_at: {type: string, format: date-time} additionalProperties: false BridgeRequest: type: object required: [client_bridge_id, amount_in] properties: client_bridge_id: {$ref: '#/components/schemas/ClientId'} amount_in: $ref: '#/components/schemas/Amount' description: In the origin token's base units. from_wallet: description: Bridge from the payer's wallet on the origin chain instead of the origin (after a withdrawal there). oneOf: - type: object required: [chain_id, token] properties: chain_id: {type: integer} token: {$ref: '#/components/schemas/Address'} additionalProperties: false - {type: 'null'} additionalProperties: false Bridge: type: object required: [id, move_id, client_bridge_id, provider, request_id, state, from, to, amount_in, min_out, payer, recipient, order, nonce, account_credit, amount_out, wallet_surplus, refund, origin_txs, destination_txs, refund_txs, withdrawal_id, error, expires_at, created_at, updated_at] properties: id: {$ref: '#/components/schemas/Uuid'} move_id: {$ref: '#/components/schemas/Uuid'} client_bridge_id: {type: string} provider: {type: string, enum: [relay]} request_id: $ref: '#/components/schemas/Bytes32' description: The provider's request ID, for its support. state: type: string enum: [prepared, submitting, pending, completed, refunded, stuck, failed, expired] description: >- `prepared`: quoted, nothing signed. `submitting`: signatures received or deposit prompt fenced. `pending`: the provider saw the deposit. `completed`, `refunded`: final. `stuck`: debited, the provider neither filled nor refunded on its own, or refunded without saying what or where; contact it with `request_id`; still followed, it can end `completed` or `refunded`. `failed`: nothing debited (mapping or send refused, send not recorded in time, every deposit reverted, or never sent); a wallet deposit that lands late moves it on (to `pending`, or straight to `completed`, `refunded` or `stuck`). `expired`: neither signed nor fenced by `expires_at`. from: {$ref: '#/components/schemas/MoveEndpoint'} to: {$ref: '#/components/schemas/MoveEndpoint'} amount_in: {$ref: '#/components/schemas/Amount'} min_out: {$ref: '#/components/schemas/Amount'} payer: {$ref: '#/components/schemas/Address'} recipient: {type: string} order: type: object required: [id, data, deadline] description: The provider's order; the client derives and checks every payload it signs from `data`. properties: id: {$ref: '#/components/schemas/Bytes32'} data: {type: object, additionalProperties: true, description: 'Relay''s `protocol.v2.orderData`, verbatim.'} deadline: {type: integer} additionalProperties: false nonce: type: [string, 'null'] description: A HyperCore origin's nonce, shared by the mapping and the send. source_dex: type: [string, 'null'] description: >- A HyperCore origin's dex, which its `SendAsset` leaves from: `""` (perps) for a standard account, `spot` for a unified one; fixed at creation by the account's mode. Null for other origins. account_credit: oneOf: [{$ref: '#/components/schemas/Amount'}, {type: 'null'}] description: The least a Polymarket, GMX or Aster account is credited; it is credited the whole output. Null otherwise. amount_out: oneOf: [{$ref: '#/components/schemas/Amount'}, {type: 'null'}] description: Delivered, once completed, in the destination token. wallet_surplus: oneOf: [{$ref: '#/components/schemas/Amount'}, {type: 'null'}] description: What reached the recipient's wallet beside a Polymarket, GMX or Aster account, once completed; zero, the account taking the whole output. Null otherwise. refund: description: What the provider refunded, where, once refunded. oneOf: - type: object required: [chain_id, token, recipient, amount] properties: chain_id: {type: integer} token: {type: string} recipient: {type: string} amount: {$ref: '#/components/schemas/Amount'} additionalProperties: false - {type: 'null'} origin_txs: {type: array, items: {type: string}} destination_txs: {type: array, items: {type: string}} refund_txs: {type: array, items: {type: string}} withdrawal_id: {oneOf: [{$ref: '#/components/schemas/Uuid'}, {type: 'null'}]} error: {type: [string, 'null']} expires_at: {type: string, format: date-time} created_at: {type: string, format: date-time} updated_at: {type: string, format: date-time} additionalProperties: false EscrowChain: type: object required: [id, escrow, token, symbol, decimals, permit, wallet] properties: direct_deposit: type: boolean description: '`POST /v1/direct` deposits: true when this escrow accepts them; absent or false otherwise.' direct_withdrawal: type: boolean description: '`POST /v1/direct` withdrawals from the GMX Account to its owner''s wallet: true on GMX.' wallet_funding: description: '`funding: wallet` in the escrow token (Polygon: pUSD; native USDC through `conversion`), no source venue account needed; null or absent when unsupported.' oneOf: - {$ref: '#/components/schemas/WalletFundingCapability'} - {type: 'null'} wallet: description: >- What a wallet delivery pays on this chain (`destination` `wallet`): the escrow's token, or on Polygon native USDC converted from pUSD. Null where the escrow cannot deliver to a wallet, and on Lighter and Aster. oneOf: - type: object required: [token, symbol, decimals, minimum] properties: token: {$ref: '#/components/schemas/Address'} symbol: {type: string} decimals: {type: integer} minimum: $ref: '#/components/schemas/Amount' description: The least each part of a wallet take delivers, in this chain's token base units. additionalProperties: false - type: 'null' id: type: integer description: 999 HyperEVM, 137 Polygon; on Lighter or Aster its signing chain id, 304 for Lighter (`escrow` its zkLighter contract, `token` Ethereum's USDC), 56 for Aster (`escrow` its vault, `token` BSC's USDT). escrow: {$ref: '#/components/schemas/Address'} token: {$ref: '#/components/schemas/Address'} symbol: {type: string} decimals: {type: integer} permit: description: >- EIP-2612 domain name and version; the chain id and token complete it. Null on Lighter and Aster. oneOf: - type: object required: [name, version] properties: {name: {type: string}, version: {type: string}} - type: 'null' WithdrawalChains: type: object required: [venue, chains] properties: venue: {$ref: '#/components/schemas/VenueId'} chains: {type: array, items: {$ref: '#/components/schemas/WithdrawalChain'}} WithdrawalChain: type: object required: [chain_id, name, withdrawable, fee] properties: chain_id: {type: integer} name: type: string description: The withdrawal's `destination Chain`. withdrawable: $ref: '#/components/schemas/Amount' description: What may leave the account to this chain now, its fee included, from its margin and Spot wallet together; LaMarge moves the Spot part to the margin before the withdrawal. fee: $ref: '#/components/schemas/Amount' description: Aster's fee to this chain, taken out of the signed amount. MarginMoveSpec: type: object required: [primary_type, types, domain, fixed, amount, destinations] properties: primary_type: type: string description: '`primaryType` of a `margin_move` item.' types: {$ref: '#/components/schemas/Eip712Types'} domain: {$ref: '#/components/schemas/Eip712Domain'} fixed: type: object additionalProperties: true description: >- Fields every transfer signs with these values; addresses compare case-insensitively. Fields that vary: amount, nonce or salt and time; Hyperliquid `sourceDex`; Polymarket `account` (your signer) and `to` (`venue_wallet`, signer or deposit address per destination); Aster `destination` (your signer), `destination Chain` (a chain's `name` from `GET /v1/withdrawals/chains`) and `fee`. amount: type: string enum: [base_units, decimal] description: 'Signed amount format: integer base units, or decimal tokens such as `"5.25"`.' destinations: type: array items: {type: string, enum: [wallet, signer, escrow]} description: '`to` values `POST /v1/withdrawals/prepare` accepts on this venue.' Book: type: object required: [from, to, max_fill, taker_fee_bps, levels] properties: from: {$ref: '#/components/schemas/VenueId'} to: {$ref: '#/components/schemas/VenueId'} max_fill: $ref: '#/components/schemas/Amount' description: Most one fill takes from one level, in `to` base units. taker_fee_bps: $ref: '#/components/schemas/FeeBps' description: >- The pair's taker fee now, for a take consenting to it with `max_fee_bps`. Levels show the makers' prices without it. levels: {type: array, items: {$ref: '#/components/schemas/Level'}} Route: type: object required: [from, to, amount_in, amount_out, capped, legs, destination, minimum_received] properties: funding: {$ref: '#/components/schemas/Funding'} destination: {$ref: '#/components/schemas/Destination'} minimum_received: oneOf: [{$ref: '#/components/schemas/TokenAmount'}, {type: 'null'}] description: >- For a wallet destination, the least its recipient receives of the wallet token for `amount_out`; null for a venue. from: {$ref: '#/components/schemas/VenueId'} to: {$ref: '#/components/schemas/VenueId'} amount_in: $ref: '#/components/schemas/Amount' description: What the first take pays, in `from` base units. capped: type: boolean description: >- True when the route spends less than the request beyond rounding: what it leaves buys a base unit of output or more per part. amount_out: $ref: '#/components/schemas/Amount' description: What the last take delivers, in `to` base units. legs: type: array minItems: 1 maxItems: 2 description: >- The takes in order. Of two, the first delivers on the intermediate venue, from where the second pays; its `amount_in` is less than the first's `amount_out` by the Lighter account's transfer fee and rounding. items: type: object required: [from, to, amount_in, amount_out, parts, taker_fee, taker_fee_bps] properties: from: {$ref: '#/components/schemas/VenueId'} to: {$ref: '#/components/schemas/VenueId'} amount_in: {$ref: '#/components/schemas/Amount'} amount_out: {$ref: '#/components/schemas/Amount'} parts: {type: integer, minimum: 1, maximum: 8, description: Price levels the take goes through.} taker_fee: $ref: '#/components/schemas/Amount' description: >- The take's fee at `taker_fee_bps`, included in its amounts: in `from` base units, or in `to` base units when it pays from Lighter or Aster. taker_fee_bps: $ref: '#/components/schemas/FeeBps' description: The pair's fee now, which the take's `max_fee_bps` must accept; 0 without the request's `max_fee_bps`. additionalProperties: false additionalProperties: false Level: type: object description: >- One quote of an order: the taker pays `receive` on `from` per `supply` on `to`. required: [order_id, quote_index, supply, receive, available, min_fill, expires_at, quoted_at, sequence, valid_until] properties: order_id: {$ref: '#/components/schemas/Bytes32'} quote_index: type: integer minimum: 0 description: The quote's position in the order's signed set. supply: $ref: '#/components/schemas/Amount' description: Price denominator and this quote's budget in the sequence, in `to` base units. receive: $ref: '#/components/schemas/Amount' description: Price numerator, in `from` base units. available: $ref: '#/components/schemas/Amount' description: >- Least of: unlocked funds less reserved fills, their delivery fees, the next fill's fee and the owner's withdrawals on their way; `quote_size` less this sequence's fills; `supply` less this quote's fills (abandoned maker legs excluded). An order's levels in a book share the first two, best price first. min_fill: $ref: '#/components/schemas/Amount' description: >- Executable minimum, `to` base units: the signed minimum, raised so the payment meets the `from` venue's `release_minimum`. The `to` venue's minimum applies to a take's total. expires_at: $ref: '#/components/schemas/Timestamp' description: Signed on-chain settlement deadline, after `valid_until`. quoted_at: {$ref: '#/components/schemas/Timestamp'} sequence: {type: integer, minimum: 1} valid_until: $ref: '#/components/schemas/Timestamp' description: Last admission time. SignedAgreement: type: object required: [signer, typed_data, signature, digest] properties: signer: {$ref: '#/components/schemas/Address'} typed_data: {$ref: '#/components/schemas/TypedData'} signature: {$ref: '#/components/schemas/QuoteSignature'} digest: {$ref: '#/components/schemas/Bytes32'} TradeProof: type: object required: [version, id, from, to, amount_in, amount_out, swap_id, order_id, sequence, quote_index, maker_owner, payer, maker_recipient, taker_recipient, settled_at, maker, maker_authorization, delivery, taker, payment, transactions, destination, received] properties: funding: {$ref: '#/components/schemas/Funding'} destination: {$ref: '#/components/schemas/Destination'} received: oneOf: [{$ref: '#/components/schemas/WalletReceipt'}, {type: 'null'}] description: A wallet delivery's receipt; null for a venue delivery. version: type: integer enum: [1, 2] description: '2 for a trade with a taker fee, which `taker_fee` and `taker_fee_venue` give.' id: {type: string, format: uuid} from: {$ref: '#/components/schemas/VenueId'} to: {$ref: '#/components/schemas/VenueId'} amount_in: {$ref: '#/components/schemas/Amount'} amount_out: {$ref: '#/components/schemas/Amount'} taker_fee: $ref: '#/components/schemas/Amount' description: >- Version 2: the fee the `swap_id` carries ([fees](/how-it-works#fees)). taker_fee_venue: $ref: '#/components/schemas/VenueId' description: 'Version 2: the venue whose token `taker_fee` is in.' swap_id: {$ref: '#/components/schemas/Bytes32'} order_id: {$ref: '#/components/schemas/Bytes32'} sequence: {type: integer} quote_index: type: integer minimum: 0 description: The priced quote's position in the maker's signed set. maker_owner: {$ref: '#/components/schemas/Address'} payer: {$ref: '#/components/schemas/Address'} maker_recipient: {$ref: '#/components/schemas/Address'} taker_recipient: {$ref: '#/components/schemas/Address'} settled_at: {$ref: '#/components/schemas/Timestamp'} maker: {$ref: '#/components/schemas/SignedAgreement'} maker_authorization: oneOf: [{$ref: '#/components/schemas/SignedAgreement'}, {type: 'null'}] description: >- The owner's `FundOffer`; null for in-venue inventory, whose maker authority LaMarge attests. delivery: description: The delivery of a fill to Lighter or Aster; null otherwise. oneOf: - type: object required: [venue, tx_hash, account, executed_at] properties: venue: {$ref: '#/components/schemas/VenueId'} tx_hash: {type: string, description: 'The Lighter transaction hash, or the Aster `transferId`.'} account: {type: [string, 'null'], description: "The taker's account on the venue: a Lighter index in decimal, an Aster address."} executed_at: {type: [string, 'null'], format: date-time} additionalProperties: false - type: 'null' taker: description: >- The payer's `PayTake`; this trade's payment is its `LockPayment` with this `swap_id`. Null for a take paid from Lighter or Aster (see `payment`). oneOf: [{$ref: '#/components/schemas/SignedAgreement'}, {type: 'null'}] payment: description: The taker's executed transfer, for a take paid from Lighter or Aster; null otherwise. oneOf: - type: object required: [venue, tx_hash, executed_at, tx_info] properties: venue: {$ref: '#/components/schemas/VenueId'} tx_hash: {type: string, description: 'Lighter''s transaction hash, without `0x`, or Aster''s `transferId`.'} executed_at: {oneOf: [{$ref: '#/components/schemas/Timestamp'}, {type: 'null'}]} tx_info: type: object additionalProperties: true description: >- The transfer as sent: Lighter's transaction, or on Aster `{msg, signature}`, the request the payer's wallet signed as `Message{msg}` at chain 1666. additionalProperties: false - {type: 'null'} transactions: {type: array, items: {$ref: '#/components/schemas/Transaction'}} Volume: type: object required: [a, b, volume_24h, trades_24h] properties: a: {$ref: '#/components/schemas/VenueId'} b: {$ref: '#/components/schemas/VenueId'} volume_24h: $ref: '#/components/schemas/Amount' description: In `b` base units. trades_24h: {type: integer} Health: type: object required: [status, ready, server_time, pending_transactions, journal_unpublished, journal_oldest_unpublished_seconds, chains] properties: status: {type: string, enum: [ok, degraded]} ready: {type: boolean} server_time: {$ref: '#/components/schemas/Timestamp'} pending_transactions: type: integer minimum: 0 description: Relay transactions pending on all chains. journal_unpublished: type: integer minimum: 0 description: Events committed but not yet given a cursor. journal_oldest_unpublished_seconds: {type: [number, 'null']} chains: {type: array, items: {$ref: '#/components/schemas/ChainHealth'}} Challenge: type: object required: [message, nonce, expires_at] properties: message: type: string description: >- Sign with `personal_sign` exactly as given. nonce: {type: string} expires_at: {$ref: '#/components/schemas/Timestamp'} typed_data: allOf: [{$ref: '#/components/schemas/TypedData'}] description: >- Not returned: Aster's agent approval is the `agent` setup step's `to_sign`. Session: type: object required: [token, expires_at, session_id] properties: token: type: string pattern: ^[0-9a-f]{64}$ expires_at: {$ref: '#/components/schemas/Timestamp'} session_id: {$ref: '#/components/schemas/Uuid'} LinkedAccount: type: object required: [venue, address, venue_wallet, linked_at, setup] properties: setup: {$ref: '#/components/schemas/SetupSteps'} venue: {$ref: '#/components/schemas/VenueId'} address: $ref: '#/components/schemas/Address' description: Owner of the venue account; signs its transfers. venue_wallet: type: [string, 'null'] description: >- Polymarket: the signer's Deposit Wallet or Safe. Lighter: the account index, null until the address's first deposit. Null elsewhere. linked_at: {$ref: '#/components/schemas/Timestamp'} SetupSteps: type: array description: >- The account's setup steps as recorded, without reading the venue ([setup steps](/quickstart#setup-steps)): an escrow venue's `permit`, Aster's `agent`, and Lighter's `api_key` when paying from Lighter is on. A use answers `SETUP_REQUIRED` while a step it needs is not `done`; a payment reads the permit and Lighter's key when it uses them. An Aster account without its agent is not read. items: {$ref: '#/components/schemas/SetupStatus'} SetupStatus: type: object required: [step, status, reason, expires_at, needed_for] properties: step: {type: string, enum: [permit, agent, api_key]} status: type: string enum: [done, pending, required] description: '`pending`: submitted, not yet shown by the venue (ten minutes at most).' reason: type: [string, 'null'] description: >- Why a step done before is required again: the venue refused it, it expired, the linked address or LaMarge's escrow, agent or key changed; or why Lighter's key cannot be done yet: the account has no deposit. expires_at: oneOf: [{$ref: '#/components/schemas/Timestamp'}, {type: 'null'}] description: When the step lapses (Aster's agent approval, 365 days). needed_for: type: array items: {type: string, enum: [make, pay, receive]} SetupStep: allOf: - {$ref: '#/components/schemas/SetupStatus'} - type: object required: [to_sign, hash] properties: to_sign: description: >- The request to sign, returned by preparing a required step: `permit` (EIP-712 `typed_data`), `aster_approval` (EIP-712 `typed_data`, valid 60 seconds) or `lighter_api_key` (`message`, signed with `personal_sign`). Submit it with its `ref`. oneOf: - type: 'null' - type: object required: [kind, signer, ref] properties: kind: {type: string, enum: [permit, aster_approval, lighter_api_key]} signer: {$ref: '#/components/schemas/Address'} ref: {type: string} typed_data: {$ref: '#/components/schemas/TypedData'} message: {type: string} expires_at: {$ref: '#/components/schemas/Timestamp'} attestation: $ref: '#/components/schemas/SetupAttestation' description: '`aster_approval` and `lighter_api_key` carry one when LaMarge attests them: the agent and the key are LaMarge''s.' additionalProperties: false hash: type: [string, 'null'] description: The permit's relay transaction, while one is known. VenueSetup: type: object required: [venue, address, ready, steps] properties: venue: {$ref: '#/components/schemas/VenueId'} address: {$ref: '#/components/schemas/Address'} ready: {type: boolean, description: Every step is done.} steps: {type: array, items: {$ref: '#/components/schemas/SetupStep'}} additionalProperties: false Me: type: object required: [master_address, created_at, accounts, quote_identity_id, access, admin] properties: master_address: {$ref: '#/components/schemas/Address'} created_at: {$ref: '#/components/schemas/Timestamp'} accounts: {type: array, items: {$ref: '#/components/schemas/LinkedAccount'}} quote_identity_id: {$ref: '#/components/schemas/Uuid'} access: {$ref: '#/components/schemas/AccessState'} admin: {type: boolean} AccessState: type: string enum: [granted, required, suspended] description: >- Whether the user may make new commitments: `required` in invite mode until a code is redeemed or an admin admits the user; admins always `granted`. AccessCodeInput: type: object required: [label] properties: label: type: string minLength: 1 maxLength: 80 description: Who the code is for; trimmed. max_uses: {type: integer, minimum: 1, maximum: 1000, default: 1} expires_at: oneOf: [{$ref: '#/components/schemas/UnixTime'}, {type: 'null'}] description: Strictly in the future; null or omitted for no expiry. additionalProperties: false AccessCode: type: object required: [id, label, max_uses, uses, expires_at, created_at, created_by, revoked_at, revoked_by] properties: id: {$ref: '#/components/schemas/Uuid'} label: {type: string} max_uses: {type: integer} uses: {type: integer} expires_at: {oneOf: [{$ref: '#/components/schemas/Timestamp'}, {type: 'null'}]} created_at: {$ref: '#/components/schemas/Timestamp'} created_by: {$ref: '#/components/schemas/Address'} revoked_at: {oneOf: [{$ref: '#/components/schemas/Timestamp'}, {type: 'null'}]} revoked_by: {oneOf: [{$ref: '#/components/schemas/Address'}, {type: 'null'}]} AccessCodeCreated: allOf: - {$ref: '#/components/schemas/AccessCode'} - type: object required: [code] properties: code: type: string pattern: ^[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}$ description: Returned once. AccessCodePage: type: object required: [data, next_cursor, has_more] properties: data: {type: array, items: {$ref: '#/components/schemas/AccessCode'}, maxItems: 500} next_cursor: {oneOf: [{type: string, maxLength: 512}, {type: 'null'}]} has_more: {type: boolean} PartnerName: type: string pattern: '^[a-z0-9-]{1,32}$' description: A partner service, as `PARTNER_KEYS` names it. PartnerAdmission: type: object required: [address, admitted_at, admitted_by, admitted_by_partner] properties: address: {$ref: '#/components/schemas/Address'} admitted_at: {$ref: '#/components/schemas/Timestamp'} admitted_by: oneOf: [{$ref: '#/components/schemas/Address'}, {type: 'null'}] description: The admin who admitted the address without a code. admitted_by_partner: oneOf: [{$ref: '#/components/schemas/PartnerName'}, {type: 'null'}] description: The partner service, this one or another, that admitted the address. AdminUser: type: object required: [master_address, created_at, admin, access, admitted_at, admitted_by, admitted_by_partner, access_code, suspended_at, maker_approved_at, last_sign_in_at, transfers, assets] properties: master_address: {$ref: '#/components/schemas/Address'} created_at: {$ref: '#/components/schemas/Timestamp'} admin: {type: boolean} access: $ref: '#/components/schemas/AccessState' description: Access under the deployment's current mode. admitted_at: {oneOf: [{$ref: '#/components/schemas/Timestamp'}, {type: 'null'}]} admitted_by: oneOf: [{$ref: '#/components/schemas/Address'}, {type: 'null'}] description: The admin who admitted the user without a code. admitted_by_partner: oneOf: [{$ref: '#/components/schemas/PartnerName'}, {type: 'null'}] description: The partner service that admitted the user. access_code: oneOf: - type: object required: [id, label] properties: {id: {$ref: '#/components/schemas/Uuid'}, label: {type: string}} - {type: 'null'} description: The code the user redeemed. suspended_at: {oneOf: [{$ref: '#/components/schemas/Timestamp'}, {type: 'null'}]} maker_approved_at: oneOf: [{$ref: '#/components/schemas/Timestamp'}, {type: 'null'}] description: When an admin approved the user as a Lighter and Aster maker; null if not. last_sign_in_at: {oneOf: [{$ref: '#/components/schemas/Timestamp'}, {type: 'null'}]} transfers: type: integer description: Transfer intents created. assets: type: array description: All-time settled fills as taker or maker, per venue, by output venue. items: type: object required: [venue, symbol, decimals, volume, trades] properties: venue: {$ref: '#/components/schemas/VenueId'} symbol: {type: string} decimals: {type: integer} volume: {$ref: '#/components/schemas/Amount'} trades: {type: integer} AdminUserPage: type: object required: [data, next_cursor, has_more] properties: data: {type: array, items: {$ref: '#/components/schemas/AdminUser'}, maxItems: 500} next_cursor: {oneOf: [{type: string, maxLength: 512}, {type: 'null'}]} has_more: {type: boolean} Balance: type: object required: [venue, address, venue_wallet, equity, withdrawable, withdrawable_estimated, mode, has_account, wallet, xyz, chain_balance, escrow_balance, deposit_balance, deposit_address, read_at, error, chain_read_at, chain_error, withdrawal_fee, portfolio, setup, holdings] properties: setup: {$ref: '#/components/schemas/SetupSteps'} holdings: {$ref: '#/components/schemas/Holdings'} portfolio: {$ref: '#/components/schemas/PortfolioObservation'} venue: {$ref: '#/components/schemas/VenueId'} address: {$ref: '#/components/schemas/Address'} venue_wallet: type: [string, 'null'] description: Null on venues without one. equity: type: [string, 'null'] description: Null before the first read. withdrawable: type: [string, 'null'] description: >- What can leave the venue margin, less transfers relayed since `read_at` and, at Lighter and Aster, payments and deliveries made since then. withdrawal_fee: type: [string, 'null'] description: Estimated venue withdrawal fee; 0 when none, null when unavailable. Rechecked at preparation. withdrawal_reserve: type: [string, 'null'] description: >- Source-token balance kept back for withdrawal gas, in base units, not part of the signed amount: on Hyperliquid twice the current 200,000-gas bridge estimate in USDC, rounded up, unless HyperCore HYPE covers it; 0 elsewhere. Sends do not use it. Null: unknown, no Hyperliquid withdrawal. withdrawable_estimated: type: boolean description: >- True when `withdrawable` is only an upper bound from the venue's public data; false while `read_at` is null ([venues](/how-it-works#venues-and-balances)). mode: type: [string, 'null'] description: 'Account mode on venues with several ([venues](/how-it-works#venues-and-balances)).' has_account: type: boolean description: False while the venue knows no account for the address; true while `read_at` is null. wallet: type: [string, 'null'] description: >- Venue token outside the margin, where the venue has one ([venues](/how-it-works#venues-and-balances)). xyz: description: >- A standard Hyperliquid account's trade.xyz balance (HIP-3 dex `xyz`), apart from `equity` and `withdrawable`; `withdrawable` less transfers from there relayed since `read_at`; in the holdings' `total`, not their `available`. Null elsewhere and on a unified account, whose one balance includes it. oneOf: - type: object required: [equity, withdrawable, read_at] properties: equity: {type: string, pattern: '^-?[0-9]+$', description: 'Base units; negative when losses exceed the deposits there.'} withdrawable: {$ref: '#/components/schemas/Amount'} read_at: type: [string, 'null'] format: date-time description: trade.xyz's own last read, null (with zero amounts) until the first; a failed one keeps the previous values. A payment from there needs it within two minutes. additionalProperties: false - {type: 'null'} chain_balance: type: [string, 'null'] description: >- Token balance of the linked address on the escrow chain, less what a payment locked since `chain_read_at` took beyond `escrow_balance`. escrow_balance: type: [string, 'null'] description: >- The available balance (`order_id` zero), which takes pay from first, less payments locked since `chain_read_at`. Read with `chain_balance`. deposit_balance: type: [string, 'null'] description: >- Waiting at `deposit_address` to be swept into the available balance ([balances](/how-it-works#balances)). Read with `chain_balance`. deposit_address: oneOf: [{$ref: '#/components/schemas/Address'}, {type: 'null'}] description: Tokens sent here become the linked address's available balance; null on Lighter and Aster. read_at: type: [string, 'null'] format: date-time description: Last successful venue read. error: type: [string, 'null'] description: Why the last venue read failed; null on success. chain_read_at: {oneOf: [{$ref: '#/components/schemas/Timestamp'}, {type: 'null'}]} chain_error: {oneOf: [{type: string}, {type: 'null'}]} HeldIn: type: string enum: [escrow, venue] description: >- Where `held` is: `escrow`, unlocked in the escrow; `venue`, a Lighter or Aster pool's share of its account's balance, part of that venue's `equity`. Holdings: type: object description: >- The account's funds on the venue, in its wallets and in the escrow, from the same snapshot as `portfolio`, each counted once, in the venue token's base units. required: [available, locked, committed, total, orders, pool, trades] properties: available: type: string pattern: ^\d+$ description: >- Movable or committable now: the venue's withdrawable margin less what a pool still owes and, on Hyperliquid, `withdrawal_reserve`; plus the wallets and the escrow's available balance; less `committed`. locked: type: string pattern: ^-?\d+$ description: >- `total` − `available`: escrow orders, fills in progress, `committed`, deposits awaiting the sweep, what a pool owes and the margin positions use. committed: $ref: '#/components/schemas/Amount' description: >- What the account's takes not paid yet will spend of its escrow chain's wallet and available balance: held for them, in `locked`, counted once in `total`; 0 on Lighter and Aster, which pay one take at a time. orders: $ref: '#/components/schemas/Amount' description: >- Unlocked escrow of the account's orders this deployment operates, Lighter and Aster pools excluded. pool: $ref: '#/components/schemas/Amount' description: >- A Lighter or Aster pool's inventory: part of `equity`, never added to it. trades: $ref: '#/components/schemas/Amount' description: Legs of the account's fills locked in escrow, as maker or taker. total: type: string pattern: ^-?\d+$ description: >- Everything the account holds on that venue's side, each amount once ([balances](/how-it-works#balances)), an unread value counting as zero; signed, as `equity` can be negative. Stats: type: object required: [assets, trades_30d, maker] properties: maker: {$ref: '#/components/schemas/MakerResults'} assets: type: array items: {$ref: '#/components/schemas/StatsAsset'} description: One per venue (escrow chains, then Lighter and Aster), by output venue. trades_30d: {type: integer, minimum: 0} TypedData: type: object description: EIP-712 typed data for `eth_signTypedData_v4`. Keep each integer as prepared, JSON number or decimal string. required: [types, primaryType, domain, message] properties: types: {$ref: '#/components/schemas/Eip712Types'} primaryType: {type: string} domain: {$ref: '#/components/schemas/Eip712Domain'} message: {type: object, additionalProperties: true} OpTypedData: type: object description: >- A Polymarket Perps operation (`primaryType` `Op`, a domain without `verifyingContract`): `message.data` is `keccak256` of the MessagePack of `[op.type, [op.args.account, op.args.token, op.args.amount, op.args.to]]`, those exact strings. Sign `domain`, `types`, `primaryType` and `message` only. required: [types, primaryType, domain, message, op] properties: types: {$ref: '#/components/schemas/Eip712Types'} primaryType: {type: string, enum: [Op]} domain: type: object required: [name, version, chainId] properties: name: {type: string} version: {type: string} chainId: {type: integer} additionalProperties: false message: type: object required: [data, salt, ts] properties: data: {type: string, pattern: '^0x[0-9a-f]{64}$'} salt: {type: integer} ts: {type: integer, description: Milliseconds.} op: type: object required: [type, args] properties: type: {type: string, enum: [internalTransfer]} args: type: object required: [account, token, amount, to] properties: account: {type: string, description: Checksummed.} token: {type: string, description: Checksummed.} amount: {type: string, description: Decimal pUSD.} to: {type: string, description: Checksummed.} Eip712Types: type: object additionalProperties: type: array items: {type: object, required: [name, type], properties: {name: {type: string}, type: {type: string}}} Eip712Domain: type: object required: [name, chainId, verifyingContract] properties: name: {type: string} version: {type: string} chainId: {type: integer} verifyingContract: {$ref: '#/components/schemas/Address'} EscrowOrder: type: object description: An order of a linked address in an escrow, with its unlocked funds. required: [venue, order_id, owner, available, operator, managed, in_balances, closing] properties: venue: {$ref: '#/components/schemas/VenueId'} order_id: $ref: '#/components/schemas/Bytes32' description: Zero is the owner's available balance; other ids are funded orders. owner: {$ref: '#/components/schemas/Address'} available: $ref: '#/components/schemas/Amount' description: Unlocked; what a close releases. operator: $ref: '#/components/schemas/Address' description: Operator named at funding. managed: type: boolean description: Funded with this deployment's operator; `POST /v1/closes` can close it. in_balances: type: boolean description: Your own order operated by this deployment, already in `/v1/balances` `holdings.orders`. Order zero is `escrow_balance` there; other orders add to it. closing: type: boolean description: A withdrawal is pending. ToSign: type: object description: One item to sign with `eth_signTypedData_v4`. required: [kind, signer, typed_data] properties: kind: type: string enum: [margin_move, fund, quote_set, close_orders, pay_take, escrow_withdrawal, refund_payment] description: >- Signer: the quote signer for `quote_set`, the master for `close_orders`, else the linked owner. signer: {$ref: '#/components/schemas/Address'} fill_id: type: string format: uuid description: 'The take id for `pay_take`; the fill id for `refund_payment`.' typed_data: {$ref: '#/components/schemas/TypedData'} attestation: $ref: '#/components/schemas/TakeAttestation' description: A take's `pay_take` carries one when LaMarge attests it. LighterTransferItem: type: object description: >- A take paid from Lighter: sign Lighter's owner message for the transfer `typed_data` names with `personal_sign`, not EIP-712. required: [kind, signer, typed_data, fill_id] properties: kind: {type: string, enum: [lighter_transfer]} signer: $ref: '#/components/schemas/Address' description: The taker's linked Lighter address, which signs `L1Sig`. fill_id: {type: string, format: uuid, description: The take id.} typed_data: {$ref: '#/components/schemas/LighterTransferTerms'} attestation: $ref: '#/components/schemas/TakeAttestation' description: Its `digest` is the hash of the owner message the terms write. LighterTransferTerms: type: object description: >- The internal transfer LaMarge sends from your Lighter account once every maker accepted, signed by its key at `api_key_index` and `nonce`: USDC (asset 3) between collateral routes (0), on chain 304 ([paying from Lighter](/how-it-works#paying-from-lighter)). required: [api_key_index, from_account_index, to_account_index, amount, usdc_fee, memo, nonce] properties: api_key_index: type: integer enum: [254, 253] description: The index of LaMarge's key on your account, 254 in production and 253 in development. from_account_index: {type: integer, description: The taker's linked Lighter account.} to_account_index: {type: integer, description: The maker's linked Lighter account.} amount: {$ref: '#/components/schemas/Amount'} usdc_fee: $ref: '#/components/schemas/Amount' description: What Lighter charges the taker's account on top. memo: type: string pattern: '^[0-9a-f]{64}$' description: The fill id's 16 bytes then 16 zero bytes, as 64 hexadecimal characters. nonce: {type: integer, description: The nonce of LaMarge's key the transfer uses.} additionalProperties: false AsterTransferItem: type: object description: >- A take paid from Aster: the transfer request itself, which your wallet signs with `eth_signTypedData_v4` at chain 1666 ([paying from Aster](/how-it-works#paying-from-aster)). Nothing else can be sent with it. required: [kind, signer, typed_data, fill_id] properties: kind: {type: string, enum: [aster_transfer]} signer: $ref: '#/components/schemas/Address' description: The taker's linked Aster address. fill_id: {type: string, format: uuid, description: The take id.} typed_data: allOf: [{$ref: '#/components/schemas/TypedData'}] description: >- `Message{msg}`, `AsterSignTransaction` domain, chain 1666, where `msg` is `asset=USDT&amount=…&toAddress=…&clientTranId=…&nonce=…&user=…`: `amount_in` with six decimals at most, rounded up, to the maker's linked Aster address, the take id in 32 hexadecimal characters, a microsecond nonce 55 seconds ahead (a grouped route's first take prepared without `reissue`: 20 seconds after `commit_by`), from your address, addresses checksummed. attestation: {$ref: '#/components/schemas/TakeAttestation'} AsterEnvelope: type: object required: [signer, nonce, signature] description: >- Aster only, required until the withdrawal is recorded (exact retries need none): the account's own signature over this withdrawal request, relayed as is within 50 seconds of `nonce`. properties: signer: $ref: '#/components/schemas/Address' description: The account itself. nonce: type: string pattern: ^\d{16}$ description: The current time in microseconds. signature: $ref: '#/components/schemas/Signature' description: >- The account's EIP-712 signature of `Message{msg}`, `AsterSignTransaction` domain, chain 56, where `msg` is `chainId=56&asset=USDT&amount=…&fee=…&receiver=…&userNonce=…&userSignature=…&signatureChainId=56&nonce=…&user=…&signer=…`: the withdrawal's `amount`, `fee`, destination and `nonce`, its signature lowercase with v 27 or 28, then this nonce and the account twice, addresses checksummed. additionalProperties: false Signatures: type: object required: [signatures] properties: signatures: type: array items: type: object required: [kind, signature] properties: kind: {type: string} fill_id: type: string format: uuid description: Take items only. signature: {$ref: '#/components/schemas/QuoteSignature'} envelope: $ref: '#/components/schemas/AsterEnvelope' description: An Aster `margin_move` only. additionalProperties: false description: >- One per requested (`kind`, `fill_id`), no extras or duplicates; a close uses its first `close_orders` item. additionalProperties: false FundingSource: type: string enum: [wallet, venue] description: >- Where the deposit, the added capital the available balance does not cover, comes from ([maker capital](/how-it-works#maker-capital)). `wallet`: the linked address on the escrow chain; `VALIDATION_ERROR` if it holds less than the deposit. `venue`: one `margin_move` of the whole deposit to the linked address, `VALIDATION_ERROR` on GMX; the funding goes once that address holds the deposit, and fails if it does not within 10 minutes of the move. MakerInput: type: object required: [client_request_id, amount, funding_source] properties: client_request_id: {$ref: '#/components/schemas/ClientId'} quote_identity_id: $ref: '#/components/schemas/Uuid' description: Default the browser identity; an API identity needs an active credential. amount: $ref: '#/components/schemas/Amount' description: Capital to add. A pool's first funding is at least 5 tokens. funding_source: {$ref: '#/components/schemas/FundingSource'} additionalProperties: false MakerPreparation: type: object required: [id, client_request_id, state, venue, order, to_sign, sequence, expires_at, expected_revision, intent, funding] properties: id: {$ref: '#/components/schemas/Uuid'} client_request_id: {$ref: '#/components/schemas/ClientId'} state: {type: string, enum: [preparing, accepted, complete, cancelled, failed]} venue: {$ref: '#/components/schemas/VenueId'} order: {$ref: '#/components/schemas/Order'} to_sign: {type: array, items: {$ref: '#/components/schemas/ToSign'}} sequence: {oneOf: [{type: integer, minimum: 1, maximum: 9007199254740991}, {type: 'null'}]} expires_at: {$ref: '#/components/schemas/Timestamp', description: 'One hour after preparation, ten minutes with a `margin_move`; then cancelled if unsigned.'} expected_revision: {$ref: '#/components/schemas/Cursor'} intent: type: object required: [amount, quote_identity_id, funding_source] properties: amount: {$ref: '#/components/schemas/Amount'} quote_identity_id: {$ref: '#/components/schemas/Uuid'} funding_source: {$ref: '#/components/schemas/FundingSource'} funding: type: object required: [existing_available, wallet_amount, venue_amount, idle_amount] properties: existing_available: {$ref: '#/components/schemas/Amount'} wallet_amount: {$ref: '#/components/schemas/Amount'} venue_amount: {$ref: '#/components/schemas/Amount'} idle_amount: {$ref: '#/components/schemas/Amount'} Order: type: object required: [id, preparation_id, capital_pool, held, held_in, venue, owner_address, state, error, amount, delivery_fee, quotable, filled, last_sequence, quote_set, margin_move, transactions, created_at, updated_at, client_order_id, quote_identity_id, quote_signer, revision, available_to_quote, received_by_venue] properties: preparation_id: {oneOf: [{$ref: '#/components/schemas/Uuid'}, {type: 'null'}]} capital_pool: {type: boolean, description: "Current pool of its quote identity, venue and owner."} held_in: {$ref: '#/components/schemas/HeldIn'} id: $ref: '#/components/schemas/Bytes32' description: The escrow's `offerId`. venue: $ref: '#/components/schemas/VenueId' description: Supply venue. owner_address: $ref: '#/components/schemas/Address' description: The escrow offer's owner, the maker's linked address on `venue`. state: {$ref: '#/components/schemas/OrderState'} error: type: [string, 'null'] description: Why the order, its funding or its last close failed. amount: $ref: '#/components/schemas/Amount' description: >- Funded amount; on Lighter or Aster, the maker's cap that deliveries consume. held: $ref: '#/components/schemas/Amount' description: >- What the order holds, where `held_in` says: unlocked escrow; for a Lighter or Aster pool, its account's transferable balance at the last read less deliveries since, within the cap left. delivery_fee: $ref: '#/components/schemas/Amount' description: >- Inside a venue, the last-read per-delivery fee, held back per reserved fill and for the next; `0` for an escrow order. revision: {$ref: '#/components/schemas/Cursor'} available_to_quote: $ref: '#/components/schemas/Amount' description: "`held` less unlocked admitted fills, their delivery fees and the next fill's, and your withdrawals on their way; ignores quotes. Shared across receiving venues." received_by_venue: type: array description: Settled fills' payments per paying venue, in its base units. items: type: object required: [venue, amount] properties: venue: {$ref: '#/components/schemas/VenueId'} amount: {$ref: '#/components/schemas/Amount'} quotable: $ref: '#/components/schemas/Amount' description: >- `quote_size` left in the current sequence, capped by `available_to_quote`. Check `quote_set.active` too. filled: $ref: '#/components/schemas/Amount' description: Taken by settled fills, in `venue` base units. last_sequence: type: integer description: Highest stored quote sequence; 0 without one. quote_set: oneOf: [{$ref: '#/components/schemas/QuoteSet'}, {type: 'null'}] description: >- Null without a current quote set; `active` covers its validity, the lease and the identity. margin_move: {oneOf: [{$ref: '#/components/schemas/MarginMove'}, {type: 'null'}]} transactions: type: array description: 'Relayed transactions, oldest first: `fund`, `close`.' items: {$ref: '#/components/schemas/Transaction'} created_at: {$ref: '#/components/schemas/Timestamp'} updated_at: {$ref: '#/components/schemas/Timestamp'} client_order_id: $ref: '#/components/schemas/ClientId' description: '`client_request_id` of the creating preparation.' quote_identity_id: {$ref: '#/components/schemas/Uuid'} quote_signer: {$ref: '#/components/schemas/Address'} QuoteSet: type: object required: [sequence, expires_at, quotes, signature, created_at, valid_until, quote_size, identity_generation, active] properties: sequence: {type: integer} expires_at: {$ref: '#/components/schemas/Timestamp'} quotes: type: array items: allOf: - {$ref: '#/components/schemas/Quote'} - type: object required: [available, offered] properties: available: $ref: '#/components/schemas/Amount' description: What this quote alone can still fill. offered: $ref: '#/components/schemas/Amount' description: >- What its book level shows once the order's better levels draw on shared funds; zero when hidden. signature: {$ref: '#/components/schemas/QuoteSignature'} created_at: {$ref: '#/components/schemas/Timestamp'} valid_until: {$ref: '#/components/schemas/Timestamp'} quote_size: $ref: '#/components/schemas/Amount' description: Admission budget of this sequence; not signed on chain. identity_generation: {$ref: '#/components/schemas/Cursor'} active: {type: boolean} Quote: type: object description: As signed; price is `receive` on `venue` per `supply` of the order's venue. required: [venue, chain_id, token, recipient, supply, receive, min_fill] properties: venue: {$ref: '#/components/schemas/VenueId'} chain_id: {type: integer} token: {$ref: '#/components/schemas/Address'} recipient: {$ref: '#/components/schemas/Address'} supply: {$ref: '#/components/schemas/Amount'} receive: {$ref: '#/components/schemas/Amount'} min_fill: {$ref: '#/components/schemas/Amount'} MarginMove: type: object description: Move out of the venue margin, relayed as a withdrawal. required: [venue, amount, venue_ref, state, error, at] properties: venue: {$ref: '#/components/schemas/VenueId'} amount: {$ref: '#/components/schemas/Amount'} venue_ref: type: [string, 'null'] description: The venue's transfer reference, if any. state: {$ref: '#/components/schemas/WithdrawalState'} error: {type: [string, 'null']} at: {$ref: '#/components/schemas/Timestamp'} Transaction: type: object required: [kind, chain_id, hash, status, error, at] properties: kind: type: string enum: [fund, close, payment, deliver, maker_claim, refund_payment, maker_lock, taker_claim, refund_maker] description: '`maker_lock`, `taker_claim` and `refund_maker`: fills settled before deliveries.' chain_id: {type: integer} hash: type: [string, 'null'] description: Null if never broadcast. status: type: string enum: [pending, replaced, mined, reverted, failed] description: >- `pending`: no finalized receipt; `replaced`: its nonce taken by a replacement, still watched; `reverted`: reverted on chain; `failed`: never broadcast (failed gas estimation included) or its nonce went to another transaction. error: oneOf: - type: string description: Sanitized relay status; do not parse. - {type: 'null'} at: {$ref: '#/components/schemas/Timestamp'} Funding: type: string enum: [venue, wallet] default: venue description: '`venue`: the linked account on `from`, withdrawing a shortfall from its margin. `wallet`: only the payer''s wallet and available balance, in the escrow token; the master needs no account on `from`. Fixed for retries.' WalletConversionInput: type: object required: [amount_in, min_out] description: 'Polygon wallet funding: `amount_in` native USDC converted into at least `min_out` pUSD, the transfer''s `amount_in`. A replacement transfer names the conversion''s `id`.' properties: amount_in: {$ref: '#/components/schemas/Amount'} min_out: {$ref: '#/components/schemas/Amount'} id: {$ref: '#/components/schemas/Uuid'} additionalProperties: false WalletConversion: type: object required: [amount_in, min_out] properties: amount_in: {$ref: '#/components/schemas/Amount'} min_out: {$ref: '#/components/schemas/Amount'} id: {$ref: '#/components/schemas/Uuid'} chain_id: {type: integer} escrow: {$ref: '#/components/schemas/Address'} payer: {$ref: '#/components/schemas/Address'} converter: {$ref: '#/components/schemas/Address'} token: {$ref: '#/components/schemas/Address'} nonce: {$ref: '#/components/schemas/Amount'} deadline: {$ref: '#/components/schemas/Amount'} prepared_block: {type: integer} state: {type: string, enum: [prepared, pending, ready, expired]} attempts: {type: array, items: {type: string}} tx_hash: {type: [string, 'null']} received: {type: [string, 'null']} block_number: {type: [integer, 'null']} WalletConversionCapability: type: object required: [token, symbol, decimals, converter, min_out_bps, minimum] properties: token: {$ref: '#/components/schemas/Address'} symbol: {type: string} decimals: {type: integer} converter: {$ref: '#/components/schemas/Address'} min_out_bps: {type: integer} minimum: {$ref: '#/components/schemas/Amount'} WalletFundingCapability: type: object required: [token, symbol, decimals] properties: conversion: {$ref: '#/components/schemas/WalletConversionCapability'} token: {$ref: '#/components/schemas/Address'} symbol: {type: string} decimals: {type: integer} additionalProperties: false WalletPermission: type: object required: [address, authorized, pending, hash, permit] properties: address: {$ref: '#/components/schemas/Address'} authorized: {type: boolean} pending: {type: boolean} hash: {type: [string, 'null']} permit: oneOf: - type: object required: [id, to_sign] properties: id: {$ref: '#/components/schemas/Uuid'} to_sign: type: object required: [kind, signer, typed_data] properties: kind: {type: string, enum: [permit]} signer: {$ref: '#/components/schemas/Address'} typed_data: {$ref: '#/components/schemas/TypedData'} - {type: 'null'} WalletFunding: type: object required: [venue, chain_id, escrow, token, symbol, decimals, address, wallet, available, committed_wallet, committed_available, spendable_wallet, spendable_available, block, observed_at, payment_setup] properties: conversion: type: object required: [token, balance, allowance] properties: token: {$ref: '#/components/schemas/Address'} balance: {$ref: '#/components/schemas/Amount'} allowance: {$ref: '#/components/schemas/Amount'} venue: {$ref: '#/components/schemas/VenueId'} chain_id: {type: integer} escrow: {$ref: '#/components/schemas/Address'} token: {$ref: '#/components/schemas/Address'} symbol: {type: string} decimals: {type: integer} address: {$ref: '#/components/schemas/Address'} wallet: {$ref: '#/components/schemas/Amount'} available: {$ref: '#/components/schemas/Amount'} committed_wallet: {$ref: '#/components/schemas/Amount'} committed_available: {$ref: '#/components/schemas/Amount'} spendable_wallet: {$ref: '#/components/schemas/Amount'} spendable_available: {$ref: '#/components/schemas/Amount'} block: {type: integer} observed_at: {$ref: '#/components/schemas/Timestamp'} payment_setup: {$ref: '#/components/schemas/WalletPermission'} TransferInput: type: object required: [client_transfer_id, from, to, amount_in, min_out, payer, recipient] properties: move_id: $ref: '#/components/schemas/Uuid' description: "The move this transfer belongs to ([moves](/how-it-works#moves-and-bridges)): the root of a route only, from the move's origin and payer, ending at its destination." conversion: {$ref: '#/components/schemas/WalletConversionInput'} funding: {$ref: '#/components/schemas/Funding'} client_transfer_id: {$ref: '#/components/schemas/ClientId'} from: {$ref: '#/components/schemas/VenueId'} to: {$ref: '#/components/schemas/VenueId'} amount_in: {$ref: '#/components/schemas/Amount'} min_out: {$ref: '#/components/schemas/Amount'} max_parts: {type: integer, minimum: 1, maximum: 8, default: 8} payer: $ref: '#/components/schemas/Address' description: The linked account on `from`; with wallet funding, the master or the linked source address. recipient: $ref: '#/components/schemas/Address' description: The linked account on `to`; with `destination` `wallet`, any address a [wallet delivery](/how-it-works#wallet-delivery) accepts. destination: $ref: '#/components/schemas/Destination' description: Default `venue`. `wallet` only on an escrow venue, never with `then`. then: $ref: '#/components/schemas/TransferThen' description: >- A route through `to`: where it ends. Its second transfer, from `to`, names this one in `previous_transfer_id`. previous_transfer_id: $ref: '#/components/schemas/Uuid' description: >- The transfer with `then` this one continues, from its `to` and `recipient` to its `then`, once no part of its take can deliver more: at most its `continuable`. It replaces an earlier continuation that neither took nor sent a withdrawal still in flight. max_fee_bps: $ref: '#/components/schemas/FeeBps' description: >- The highest taker fee its take accepts: a pair whose fee is higher is `VALIDATION_ERROR` with reason `fee_above_max`. Without it, its take pays no fee. Its take must send the same; a route's second take accepts `then.max_fee_bps`. from_dex: type: string enum: [xyz] description: >- From Hyperliquid, a standard account: its withdrawal leaves its trade.xyz balance instead of its perps. Never with `previous_transfer_id`, which pays what was delivered. additionalProperties: false TransferThen: type: object required: [to, recipient, amount_in, min_out] properties: to: {$ref: '#/components/schemas/VenueId'} recipient: $ref: '#/components/schemas/Address' description: The linked account on `to`; with `destination` `wallet`, any address a [wallet delivery](/how-it-works#wallet-delivery) accepts. destination: $ref: '#/components/schemas/Destination' description: Default `venue`; `wallet` only on an escrow venue. amount_in: $ref: '#/components/schemas/Amount' description: What the second transfer was to pay, in the intermediate venue's base units. min_out: $ref: '#/components/schemas/Amount' description: >- Least the route accepts on `to` for that `amount_in`. A continuation paying another amount sends its own `min_out`: the SDK scales this one to that amount, rounded down; a raw API caller sets it. A grouped route's preparation scales it to the second take's payment. max_fee_bps: $ref: '#/components/schemas/FeeBps' description: >- The highest taker fee the second take accepts, a route signed at once's included. A continuation sends its own. Without it, that take pays no fee. chain_id: {type: integer, readOnly: true, description: '`to`''s chain id, in an intent.'} additionalProperties: false TakeHistoryPage: type: object required: [data, next_cursor, has_more] properties: data: type: array maxItems: 100 items: type: object required: [id, fills] properties: id: {$ref: '#/components/schemas/Uuid'} fills: {type: array, items: {$ref: '#/components/schemas/Fill'}} next_cursor: {type: [string, 'null'], maxLength: 512} has_more: {type: boolean} PortfolioObservation: type: object description: >- Change counter: keep the prior observation while `revision` moves across portfolio reads or `pending` is true. required: [revision, changed_at, pending] properties: revision: {type: string, description: '`:`.'} changed_at: {oneOf: [{$ref: '#/components/schemas/Timestamp'}, {type: 'null'}]} pending: {type: boolean} additionalProperties: false TransferIntent: type: object required: [id, client_transfer_id, client_take_id, from, to, amount_in, min_out, max_parts, payer, recipient, from_chain_id, to_chain_id, withdrawal_preparation, withdrawal, take_id, take_final, previous_transfer_id, continuable, cancelled_at, created_at, funding_plan, funding_plan_error, grouped, destination] properties: move_id: {oneOf: [{$ref: '#/components/schemas/Uuid'}, {type: 'null'}]} conversion: {$ref: '#/components/schemas/WalletConversion'} funding: {$ref: '#/components/schemas/Funding'} destination: {$ref: '#/components/schemas/Destination'} id: {$ref: '#/components/schemas/Uuid'} client_transfer_id: {$ref: '#/components/schemas/ClientId'} client_take_id: $ref: '#/components/schemas/ClientId' description: '`transfer:`, for the take.' from: {$ref: '#/components/schemas/VenueId'} to: {$ref: '#/components/schemas/VenueId'} amount_in: {$ref: '#/components/schemas/Amount'} min_out: {$ref: '#/components/schemas/Amount'} max_parts: {type: integer, minimum: 1, maximum: 8} max_fee_bps: $ref: '#/components/schemas/FeeBps' description: As sent; absent when the transfer consented to no fee. from_dex: type: string enum: [xyz] description: As sent; absent when the withdrawal leaves the perps. payer: {$ref: '#/components/schemas/Address'} recipient: {$ref: '#/components/schemas/Address'} from_chain_id: {type: integer} to_chain_id: {type: integer} withdrawal_preparation: oneOf: - type: object required: [amount, typed_data, created_at] properties: amount: {$ref: '#/components/schemas/Amount'} typed_data: {$ref: '#/components/schemas/TypedData'} created_at: {$ref: '#/components/schemas/Timestamp'} additionalProperties: false - {type: 'null'} withdrawal: {oneOf: [{$ref: '#/components/schemas/Withdrawal'}, {type: 'null'}]} funding_plan: oneOf: [{$ref: '#/components/schemas/FundingPlan'}, {type: 'null'}] description: >- Returned on creation and with `funding_plan=true` while the transfer has no take and is not cancelled: before a withdrawal, or once a relayed withdrawal's funds at the wallet plus the available balance cover `amount_in`. Null otherwise, when paying from Lighter or Aster, or when it cannot be computed. funding_plan_error: oneOf: - type: object required: [code, message, status] properties: code: {type: string, description: 'The [error](/api-reference/overview#errors) code.'} message: {type: string, description: 'Human-readable, such as the balance missing; do not parse.'} reason: {type: string, description: 'Stable sub-case of `code`, as the refusal would carry it.'} venue: {$ref: '#/components/schemas/VenueId'} step: {type: string, enum: [permit, agent, api_key]} status: {type: integer, description: 'The HTTP status the refusal would have.'} retry_after: type: integer minimum: 1 description: Seconds after which the plan may be computed, as `Retry-After` would say. additionalProperties: false - {type: 'null'} description: >- Why `funding_plan` could not be computed when it was asked for, as the refusal would carry it: such as `VALIDATION_ERROR` for a withdrawable balance short of the amount, `VENUE_UNAVAILABLE` while a chain does not answer, or `STATE_CONFLICT` with `retry_after` while an earlier withdrawal of the account is being sent. Null otherwise. take_id: {oneOf: [{$ref: '#/components/schemas/Uuid'}, {type: 'null'}]} take_final: type: [boolean, 'null'] description: True once all its take's fills are final; null without a take. then: {$ref: '#/components/schemas/TransferThen'} previous_transfer_id: oneOf: [{$ref: '#/components/schemas/Uuid'}, {type: 'null'}] description: The transfer this one continues. continuable: oneOf: [{$ref: '#/components/schemas/Amount'}, {type: 'null'}] description: >- With `then`, once no part of its take can deliver more and unless cancelled: what a continuation may still pay, in `to` base units: what the take delivered, less what continuations may pay or paid (fees included) and the next payment's fee, in whole millionths. Null otherwise, or while Lighter's fee is unknown. cancelled_at: {oneOf: [{$ref: '#/components/schemas/Timestamp'}, {type: 'null'}]} created_at: {$ref: '#/components/schemas/Timestamp'} grouped: oneOf: [{$ref: '#/components/schemas/GroupedRoute'}, {type: 'null'}] description: The grouped route this transfer belongs to, as its first or second. additionalProperties: false GroupedRoute: type: object description: >- A route signed at once ([grouped routes](/how-it-works#grouped-routes)). `prepared`: its takes hold no maker inventory; commit before `commit_by`. `committed`: the operator reserves both inventories just before the first payment, then runs the route. `aborted`: never committed, its second take released. `closed`: committed, and nothing of it can move any more; what is left continues from `continuable`. required: [state, second_transfer_id, first_take_id, second_take_id, commit_by] properties: state: {type: string, enum: [prepared, committed, aborted, closed]} second_transfer_id: {$ref: '#/components/schemas/Uuid'} first_take_id: {$ref: '#/components/schemas/Uuid'} second_take_id: {oneOf: [{$ref: '#/components/schemas/Uuid'}, {type: 'null'}]} commit_by: $ref: '#/components/schemas/Timestamp' description: Every signature must be committed before it. additionalProperties: false GroupedPreparation: type: object required: [route, first, second] properties: route: {$ref: '#/components/schemas/GroupedRoute'} first: $ref: '#/components/schemas/TakePreparation' description: The first take and its request; with `aster_reissue`, issued again and signed last. second: $ref: '#/components/schemas/TakePreparation' description: The second take and its `pay_take`. additionalProperties: false TransferPage: type: object required: [data, next_cursor, has_more] properties: data: {type: array, items: {$ref: '#/components/schemas/TransferIntent'}, maxItems: 500} next_cursor: {type: [string, 'null']} has_more: {type: boolean} additionalProperties: false TakeInput: type: object required: [client_take_id, from, to, amount_in, min_out] properties: payer: $ref: '#/components/schemas/Address' description: 'Wallet funding only: the master by default, or the address linked on `from`.' funding: {$ref: '#/components/schemas/Funding'} from: $ref: '#/components/schemas/VenueId' description: The venue the taker pays on. to: $ref: '#/components/schemas/VenueId' description: The venue the taker receives on. amount_in: $ref: '#/components/schemas/Amount' description: Most the taker pays, in `from` base units. min_out: $ref: '#/components/schemas/Amount' description: >- Least to reserve, in `to` base units, else `SLIPPAGE`; fills settle independently, so less may arrive. transfer_intent_id: $ref: '#/components/schemas/Uuid' description: >- Take for this transfer: same terms and `client_take_id`, not cancelled, and any submitted withdrawal `relayed`; a prepared, unsubmitted one is signed at once with the take. client_take_id: {$ref: '#/components/schemas/ClientId'} max_parts: type: integer minimum: 1 maximum: 8 default: 8 description: Most maker fills; part of the request's identity for retries. max_fee_bps: $ref: '#/components/schemas/FeeBps' description: >- The highest taker fee accepted, as the book's `taker_fee_bps`: a higher one is `VALIDATION_ERROR` with reason `fee_above_max`, before anything is reserved. Without it the take pays no fee. Part of the request's identity for retries. destination: $ref: '#/components/schemas/Destination' description: >- Default `venue`. `wallet` only on an escrow venue whose `chain.wallet` is set; it needs no account on `to`. Part of the request's identity for retries. recipient: $ref: '#/components/schemas/Address' description: >- With `destination` `wallet`, and only then: the address it transfers to, among those a [wallet delivery](/how-it-works#wallet-delivery) accepts. Part of the request's identity for retries. additionalProperties: false Fill: type: object description: One order's share of a take, as its taker or maker sees it. required: [id, take_id, role, order_id, sequence, quote_index, swap_id, hashlock, secret, from_venue, to_venue, amount_out, amount_in, taker_fee, taker_fee_bps, taker_fee_venue, maker_out, maker_in, payer, maker_owner, maker_recipient, taker_recipient, payment_leg, maker_leg, payment_destination, maker_destination, state, reason, pay_by, t1, t2, deliver_by, report_by, delivery_to, delivery_hash, delivery_fee, payment_verified_at, maker_accept_by, maker_accepted_at, created_at, updated_at, settled_at, transactions, destination, received] properties: funding: {$ref: '#/components/schemas/Funding'} id: {type: string, format: uuid} take_id: {type: string, format: uuid} role: {$ref: '#/components/schemas/FillRole'} order_id: {$ref: '#/components/schemas/Bytes32'} sequence: type: integer description: Quote sequence it was accepted under. quote_index: type: integer minimum: 0 description: Its quote's index in that set. swap_id: $ref: '#/components/schemas/Bytes32' description: Names the payment and its delivery. hashlock: $ref: '#/components/schemas/Bytes32' description: sha256 of the secret that releases the payment to the maker. secret: type: [string, 'null'] pattern: ^0x[0-9a-f]{64}$ description: >- The maker's once the fill is delivered (`maker_leg` `CLAIMED`): with it, anyone can claim the payment into `maker_recipient` before `t2`, without LaMarge. Null for the taker. from_venue: {$ref: '#/components/schemas/VenueId'} to_venue: {$ref: '#/components/schemas/VenueId'} amount_out: $ref: '#/components/schemas/Amount' description: What the taker receives on `to_venue`. amount_in: $ref: '#/components/schemas/Amount' description: >- What the taker pays on `from_venue`: `ceil(maker_out × receive / supply)`, plus `taker_fee` when it is in `from_venue`'s token. taker_fee: $ref: '#/components/schemas/Amount' description: >- The taker fee, fixed at acceptance, in `taker_fee_venue` base units, carried by `swap_id` ([fees](/how-it-works#fees)); `0` without a fee. taker_fee_bps: {$ref: '#/components/schemas/FeeBps'} taker_fee_venue: oneOf: [{$ref: '#/components/schemas/VenueId'}, {type: 'null'}] description: '`from_venue`, or `to_venue` when the taker pays from Lighter or Aster; null without fee.' maker_out: $ref: '#/components/schemas/Amount' description: What leaves the maker's order, in `to_venue` base units, against its funds and quotes. maker_in: $ref: '#/components/schemas/Amount' description: What the maker receives of the payment, in `from_venue` base units. payer: $ref: '#/components/schemas/Address' description: The taker's linked address on `from_venue`. maker_owner: $ref: '#/components/schemas/Address' description: The order's owner on `to_venue`. maker_recipient: $ref: '#/components/schemas/Address' description: The quote's payment recipient. taker_recipient: $ref: '#/components/schemas/Address' description: The address receiving on `to_venue`, its linked account or, for a wallet delivery, the address named. destination: {$ref: '#/components/schemas/Destination'} received: oneOf: [{$ref: '#/components/schemas/WalletReceipt'}, {type: 'null'}] description: A wallet delivery's receipt; null before it, and for a venue delivery. payment_leg: {$ref: '#/components/schemas/PaymentLeg'} payment_destination: type: [string, 'null'] enum: [venue, escrow, null] description: 'Where the maker''s claimed payment was released; null until observed.' maker_destination: type: [string, 'null'] enum: [venue, escrow, wallet, null] description: 'Where the taker''s claimed output was released (`wallet`: transferred to `taker_recipient`); null until observed.' signed_at: type: [string, 'null'] format: date-time description: When the taker's signatures were accepted; null before. payment_locked_at: type: [string, 'null'] format: date-time description: Block time of the finalized payment lock; null before it is observed, and for a payment from Lighter or Aster. maker_claimed_at: type: [string, 'null'] format: date-time description: >- Block time of the finalized claim releasing the taker's output; on Lighter or Aster, the accepted delivery's execution time. Null until observed or without historical timing. maker_leg: {$ref: '#/components/schemas/MakerLeg'} state: {$ref: '#/components/schemas/FillState'} reason: type: [string, 'null'] description: Why the fill expired or stopped. pay_by: $ref: '#/components/schemas/Timestamp' description: Payment must lock by then. t1: $ref: '#/components/schemas/Timestamp' description: >- On an escrow venue, the delivery's deadline: LaMarge's delivery names it and the escrow refuses it after; still undelivered then, the payment returns at once. Before deliveries, the maker lock's refund time. t2: $ref: '#/components/schemas/Timestamp' description: Payment refund time. deliver_by: type: [string, 'null'] format: date-time description: >- Delivery on Lighter or Aster (`to_venue` settled `venue`): when the maker's transfer must execute. Paid and unreported ten minutes later, the maker leg is `ABANDONED` ([timeline](/market-making#active-market-making)). Null on an escrow venue. report_by: type: [string, 'null'] format: date-time description: >- Delivery on Lighter or Aster: deadline to report a transfer executed by `deliver_by` (`t2` less ten minutes), unless a refund is authorized first. Null on an escrow venue. delivery_to: type: [string, 'null'] description: >- The taker's account on `to_venue`, where the transfer goes: a Lighter account index in decimal, an Aster address; null on an escrow venue. delivery_hash: type: [string, 'null'] description: The venue transaction accepted as delivery; it claims the maker leg. delivery_fee: $ref: '#/components/schemas/Amount' description: >- Venue fee charged to the maker's account on top of the delivery, in `to_venue` base units: as read at reservation, then the delivery's actual fee. `0` on an escrow venue. maker_accept_by: type: [string, 'null'] format: date-time description: Deadline of the maker's acceptance, at most 15 seconds after signing; null when none is asked. maker_accepted_at: type: [string, 'null'] format: date-time description: When the maker accepted the fill. payment_verified_at: type: [string, 'null'] format: date-time description: >- When the server verified the locked payment; an in-venue maker transfers only once it is set. created_at: {$ref: '#/components/schemas/Timestamp'} updated_at: {$ref: '#/components/schemas/Timestamp'} settled_at: {type: [string, 'null'], format: date-time} transactions: type: array description: Relayed transactions; each fill lists its take's `payment`. items: {$ref: '#/components/schemas/Transaction'} Withdrawal: type: object required: [id, venue, kind, amount, destination, from_dex, state, venue_ref, error, created_at, relayed_at] properties: move_id: {oneOf: [{$ref: '#/components/schemas/Uuid'}, {type: 'null'}]} id: {type: string, format: uuid} venue: {$ref: '#/components/schemas/VenueId'} from_dex: type: [string, 'null'] enum: [xyz, null] description: '`xyz` when it left a standard Hyperliquid account''s trade.xyz balance; null otherwise.' kind: type: string enum: [withdrawal, send] description: '`send`: to another account on the same venue (`to: account`).' amount: $ref: '#/components/schemas/Amount' description: On an Aster withdrawal, the venue fee included. destination: $ref: '#/components/schemas/Address' description: 'A send: its recipient. A withdrawal: on Polymarket the linked wallet, signer or deposit address; elsewhere the linked address.' state: {$ref: '#/components/schemas/WithdrawalState'} venue_ref: type: [string, 'null'] description: Polymarket's withdrawal or transfer id, or Aster's withdrawal or transfer id, once relayed; null on Hyperliquid. error: {type: [string, 'null']} created_at: {$ref: '#/components/schemas/Timestamp'} relayed_at: {oneOf: [{$ref: '#/components/schemas/Timestamp'}, {type: 'null'}]} Uuid: {type: string, format: uuid} Cursor: type: string pattern: ^[0-9]+$ description: Non-negative 64-bit integer as a decimal string; keep it lossless. ClientId: type: string minLength: 1 maxLength: 64 pattern: ^[A-Za-z0-9_.:-]+$ description: >- Persist before the first attempt. Unique per user and resource type; reuse with other parameters returns 409 `STATE_CONFLICT`. UnixTime: type: integer minimum: 0 description: Unix seconds. OrderState: {type: string, enum: [preparing, moving, funding, live, closing, closed, failed]} FillState: type: string enum: [PREPARED, RESERVED, PAID, PAYING, LOCKED, CLAIMING, SETTLED, EXPIRED, REFUNDING, REFUNDED, MAKER_LOSS, TAKER_LOSS] description: >- `PREPARED`: no maker inventory is claimed. `RESERVED`: execution was admitted and inventory is held for payment. `PAID`: the payment is locked, or executed on Lighter or Aster, and the delivery pending. `CLAIMING`: delivered, the payment still locked. `REFUNDING`: the delivery abandoned, the payment still locked. `PAYING` and `LOCKED`: fills settled with maker locks, before deliveries. PaymentLeg: type: string enum: [NONE, LOCKED, CLAIMED, REFUNDED] description: The taker's lock on the `from_venue` chain; paid from Lighter or Aster, `CLAIMED` once the transfer executed. MakerLeg: type: string enum: [NONE, LOCKED, CLAIMED, REFUNDED, ABANDONED] description: >- The delivery on `to_venue`, from the order's escrow offer or, on Lighter or Aster, by the maker's transfer: `CLAIMED` once delivered, `ABANDONED` once it can no longer be. `LOCKED` and `REFUNDED`: maker locks, before deliveries. WithdrawalState: type: string enum: [queued, submitting, unknown, relayed, refused] description: >- `relayed`: acknowledged by the venue; arrival unconfirmed. `refused`: rejected by the venue, or `queued` and unstarted after two minutes (Aster: 50 s after the nonce of its envelope, or of a send's request; a take signed at once's withdrawal: `pay_by` less 30 s, or once the take expired). A Polymarket withdrawal or Hyperliquid transfer the venue did not answer stays `queued`, sent again unchanged, and ends `relayed` or `unknown`. `submitting` becomes `unknown` after a minute. `unknown`: maybe submitted; never resend. An `unknown` Polymarket withdrawal (not a send) resolves from its exchange: `relayed` once executed, `refused` an hour after signing if not. ChainHealth: type: object required: [venue, chain_id, ready, observations_ready, integrity_checked_at, integrity_completed_at, integrity_error, integrity_mismatch, oldest_pending_seconds, pending_transactions, block, finalized_block, checked_at, finalized_at, error, operator_gas] properties: venue: {$ref: '#/components/schemas/VenueId'} chain_id: {type: integer} ready: type: boolean description: '`observations_ready`, no integrity mismatch, under 32 pending transactions, none pending over 60 s.' observations_ready: type: boolean description: >- No watcher error; watched block is the finalized head, read within the idle page interval plus 30 s, or within 30 s once pages have failed for 30 s; head within the chain's finality age when read; operator gas at least the chain minimum. oldest_pending_seconds: type: [integer, 'null'] description: Oldest pending relay transaction's age; null without one. pending_transactions: {type: integer, minimum: 0} integrity_checked_at: {oneOf: [{$ref: '#/components/schemas/Timestamp'}, {type: 'null'}]} integrity_completed_at: {oneOf: [{$ref: '#/components/schemas/Timestamp'}, {type: 'null'}]} integrity_error: {type: [string, 'null']} integrity_mismatch: type: boolean description: A latched discrepancy; blocks admission until supervised verification. block: {oneOf: [{$ref: '#/components/schemas/Cursor'}, {type: 'null'}]} finalized_block: {oneOf: [{$ref: '#/components/schemas/Cursor'}, {type: 'null'}]} checked_at: {oneOf: [{$ref: '#/components/schemas/Timestamp'}, {type: 'null'}]} finalized_at: {oneOf: [{$ref: '#/components/schemas/Timestamp'}, {type: 'null'}]} error: {oneOf: [{type: string}, {type: 'null'}]} operator_gas: {oneOf: [{$ref: '#/components/schemas/Amount'}, {type: 'null'}]} Info: type: object required: [api_version, server_time, operator, limits, settlement, chains, access] properties: api_version: {type: string, const: v1} server_time: {$ref: '#/components/schemas/Timestamp'} operator: {$ref: '#/components/schemas/Address'} limits: {$ref: '#/components/schemas/Limits'} settlement: {$ref: '#/components/schemas/SettlementTiming'} chains: {type: array, items: {$ref: '#/components/schemas/DeploymentChain'}} access: type: object required: [mode, captcha_site_key] properties: mode: type: string enum: [open, invite] description: '`invite`: new commitments need access granted (see `AccessState`).' captcha_site_key: type: [string, 'null'] description: Captcha site key of the access page; null without captcha. Limits: type: object required: [requests_per_second, request_burst, body_bytes, lease_seconds_min, lease_seconds_max, quote_validity_seconds_max, take_parts_max, pay_window_seconds, route_pay_window_seconds, max_unpaid_takes, fill_max] properties: requests_per_second: {type: integer, description: 'Per user''s sessions or per credential, on authenticated routes.'} request_burst: {type: integer} body_bytes: {type: integer} lease_seconds_min: {type: integer} lease_seconds_max: {type: integer} quote_validity_seconds_max: {type: integer} take_parts_max: {type: integer} pay_window_seconds: {type: integer} route_pay_window_seconds: {type: integer, description: "A grouped route's second take, and a take signed at once with its withdrawal."} max_unpaid_takes: {type: integer, description: 'Takes one taker may hold awaiting payment at once.'} fill_max: $ref: '#/components/schemas/Amount' description: Most one fill takes from one level, in millionths of a token (books' `max_fill`, in base units). SettlementTiming: type: object required: [maker_timeout_seconds, taker_timeout_seconds, delivery] properties: maker_timeout_seconds: {type: integer, minimum: 1} taker_timeout_seconds: {type: integer, minimum: 1} delivery: description: >- Deliveries on Lighter and Aster; null when neither is enabled. Fills carry their `deliver_by` and `report_by`. oneOf: - type: 'null' - type: object required: [window_seconds, abandon_after_seconds, report_margin_seconds, min_status] properties: window_seconds: type: integer minimum: 1 description: '`deliver_by` is `pay_by` plus this.' abandon_after_seconds: type: integer minimum: 1 description: After `deliver_by`, when an unreported paid fill's maker leg turns `ABANDONED`. report_margin_seconds: type: integer minimum: 1 description: '`report_by` is `t2` less this.' min_status: type: [integer, 'null'] enum: [2, 3, null] description: Lighter status a delivery needs; null without Lighter. DeploymentChain: type: object required: [venue, chain_id, token, symbol, decimals, escrow, deployment_block] properties: venue: {$ref: '#/components/schemas/VenueId'} chain_id: {type: integer} token: {$ref: '#/components/schemas/Address'} symbol: {type: string} decimals: {type: integer, minimum: 0} escrow: {$ref: '#/components/schemas/Address'} deployment_block: {$ref: '#/components/schemas/Cursor'} Usd: type: string pattern: '^-?[0-9]+(\.[0-9]{1,8})?$' description: US dollars, signed, at most eight decimals. Bps: type: string pattern: '^-?[0-9]+(\.[0-9]{1,2})?$' description: Basis points, signed, at most two decimals. MakerResults: type: object description: >- What the user's orders received less what they delivered ([maker results](/how-it-works#maker-results)); a fill taken under a set not compiled from recorded lines values each token at 1 USD. required: [fills, marked_fills, volume_usd, pnl_usd, pnl_bps, pairs, daily] properties: fills: {type: integer, minimum: 0} marked_fills: {type: integer, minimum: 0, description: Fills valued at the maker's marks.} volume_usd: {$ref: '#/components/schemas/Usd', description: 'Delivered, every token at 1 USD.'} pnl_usd: {$ref: '#/components/schemas/Usd'} pnl_bps: oneOf: [{$ref: '#/components/schemas/Bps'}, {type: 'null'}] description: '`pnl_usd` over the delivered value, valued as the fills; null without a delivery.' pairs: type: array description: By paying venue, then delivering venue. items: type: object required: [from, to, fills, delivered, pnl_usd, pnl_bps] properties: from: {$ref: '#/components/schemas/VenueId'} to: {$ref: '#/components/schemas/VenueId'} fills: {type: integer, minimum: 0} delivered: {$ref: '#/components/schemas/Amount', description: In `to`'s token.} pnl_usd: {$ref: '#/components/schemas/Usd'} pnl_bps: {oneOf: [{$ref: '#/components/schemas/Bps'}, {type: 'null'}]} additionalProperties: false daily: type: array description: By UTC day a fill was taken, days without one left out. items: type: object required: [day, fills, pnl_usd, cumulative_usd] properties: day: {type: string, format: date} fills: {type: integer, minimum: 1} pnl_usd: {$ref: '#/components/schemas/Usd'} cumulative_usd: {$ref: '#/components/schemas/Usd', description: Since the first fill.} additionalProperties: false additionalProperties: false StatsAsset: type: object required: [venue, chain_id, token, symbol, decimals, volume_30d, taker_volume_30d, maker_volume_30d, trades_30d] properties: venue: {$ref: '#/components/schemas/VenueId'} chain_id: type: [integer, 'null'] description: Escrow chain; null on Lighter and Aster. token: oneOf: [{$ref: '#/components/schemas/Address'}, {type: 'null'}] description: Escrow token; null on Lighter and Aster. symbol: {type: string} decimals: {type: integer, minimum: 0} volume_30d: {$ref: '#/components/schemas/Amount'} taker_volume_30d: {$ref: '#/components/schemas/Amount'} maker_volume_30d: {$ref: '#/components/schemas/Amount'} trades_30d: {type: integer, minimum: 0} ChainObservation: type: object required: [block, finalized_block, checked_at, finalized_at, current] properties: block: {$ref: '#/components/schemas/Cursor'} finalized_block: {oneOf: [{$ref: '#/components/schemas/Cursor'}, {type: 'null'}]} checked_at: {$ref: '#/components/schemas/Timestamp'} finalized_at: {oneOf: [{$ref: '#/components/schemas/Timestamp'}, {type: 'null'}]} current: type: [boolean, 'null'] description: >- As `ChainHealth.observations_ready` without the gas check; null without a finalized head. ExposureAsset: type: object required: [venue, chain_id, token, symbol, decimals, chain_observation, maker_escrow, maker_pool_inventory, maker_reserved, maker_delivered_unpaid, maker_payment_locked, taker_payment_locked] properties: venue: {$ref: '#/components/schemas/VenueId'} chain_id: type: [integer, 'null'] description: Escrow chain; null on Lighter and Aster. token: oneOf: [{$ref: '#/components/schemas/Address'}, {type: 'null'}] description: Escrow token; null on Lighter and Aster. symbol: {type: string} decimals: {type: integer, minimum: 0} chain_observation: {oneOf: [{$ref: '#/components/schemas/ChainObservation'}, {type: 'null'}]} maker_escrow: $ref: '#/components/schemas/Amount' description: Orders' unlocked escrow, Lighter and Aster pools excluded. maker_pool_inventory: $ref: '#/components/schemas/Amount' description: >- Lighter or Aster pool: the account's transferable balance at the last read less deliveries since, within the cap left. Part of the venue account's equity, never added to it. maker_reserved: $ref: '#/components/schemas/Amount' description: >- Output of the maker's reserved or paid fills not yet delivered; can exceed observed inventory. maker_delivered_unpaid: $ref: '#/components/schemas/Amount' description: Output delivered to the taker with the payment still locked. maker_payment_locked: {$ref: '#/components/schemas/Amount'} taker_payment_locked: {$ref: '#/components/schemas/Amount'} Exposure: type: object required: [assets, server_time] properties: assets: {type: array, items: {$ref: '#/components/schemas/ExposureAsset'}} server_time: {$ref: '#/components/schemas/Timestamp'} Price: type: string pattern: '^[01](\.[0-9]{1,8})?$' description: USDC per unit of the venue's token, from 0.90 to 1.10, at most eight decimals. QuoteLine: type: object required: [venue, buy, sell, stock] properties: venue: {$ref: '#/components/schemas/VenueId'} buy: oneOf: [{$ref: '#/components/schemas/Price'}, {type: 'null'}] description: What the maker pays to receive one unit on `venue`; null receives nothing there. sell: oneOf: [{$ref: '#/components/schemas/Price'}, {type: 'null'}] description: What the maker asks to deliver one unit on `venue`, at least `buy`; null delivers nothing there. stock: $ref: '#/components/schemas/Amount' description: What the identity's pool on `venue` offers to deliver; `0` without a sell price. min_fill: oneOf: [{$ref: '#/components/schemas/Amount'}, {type: 'null'}] description: The smallest fill of the pool's quotes, at least 1 token, at most `stock` and `fill_max`; null or omitted is 1 token. additionalProperties: false QuoteLines: type: object required: [quote_identity_id, revision, lines] properties: quote_identity_id: {$ref: '#/components/schemas/Uuid'} revision: $ref: '#/components/schemas/Cursor' description: Advances at each publication. lines: {type: array, items: {$ref: '#/components/schemas/QuoteLine'}} QuoteLinesInput: type: object required: [expected_revision, valid_until, lines] properties: quote_identity_id: $ref: '#/components/schemas/Uuid' description: The identity; the browser identity by default, a credential's own with a credential. expected_revision: $ref: '#/components/schemas/Cursor' description: The lines' `revision`; `STATE_CONFLICT` if it changed by preparation or publication. valid_until: $ref: '#/components/schemas/UnixTime' description: Last admission time, within the next 300 s; `253402214400` (never) for the browser identity. lines: type: array items: {$ref: '#/components/schemas/QuoteLine'} description: Every line of the identity, one per venue; a venue left out is removed. additionalProperties: false QuoteLineDraft: type: object required: [order_id, venue, draft_id, sequence, valid_until, expires_at, quote_size, quotes, to_sign] properties: order_id: {$ref: '#/components/schemas/Bytes32'} venue: {$ref: '#/components/schemas/VenueId'} draft_id: {$ref: '#/components/schemas/Uuid'} sequence: {type: integer, minimum: 1, maximum: 9007199254740991} valid_until: {$ref: '#/components/schemas/UnixTime'} expires_at: {$ref: '#/components/schemas/UnixTime'} quote_size: $ref: '#/components/schemas/Amount' description: The line's stock; not signed on chain. quotes: {type: array, items: {$ref: '#/components/schemas/Quote'}, minItems: 1} to_sign: {type: array, items: {$ref: '#/components/schemas/ToSign'}, minItems: 1, maxItems: 1} QuoteLinesPreparation: type: object required: [id, quote_identity_id, expected_revision, valid_until, lines, drafts, cancels] properties: id: {$ref: '#/components/schemas/Uuid'} quote_identity_id: {$ref: '#/components/schemas/Uuid'} expected_revision: {$ref: '#/components/schemas/Cursor'} valid_until: {$ref: '#/components/schemas/UnixTime'} lines: {type: array, items: {$ref: '#/components/schemas/QuoteLine'}, description: 'The lines, normalized and sorted by venue id.'} drafts: {type: array, items: {$ref: '#/components/schemas/QuoteLineDraft'}} cancels: {type: array, items: {$ref: '#/components/schemas/Bytes32'}, description: The pools whose quotes publication pulls.} QuoteLinesPublication: type: object required: [preparation_id, signatures] properties: preparation_id: {$ref: '#/components/schemas/Uuid'} signatures: type: array description: One per draft. items: type: object required: [draft_id, signature] properties: draft_id: {$ref: '#/components/schemas/Uuid'} signature: {$ref: '#/components/schemas/QuoteSignature'} additionalProperties: false additionalProperties: false Markets: type: object required: [as_of, venues] properties: as_of: {$ref: '#/components/schemas/Timestamp'} venues: type: array items: type: object required: [venue, symbol, decimals, best_buy, best_sell, liquidity, volume_24h] properties: venue: {$ref: '#/components/schemas/VenueId'} symbol: {type: string} decimals: {type: integer} best_buy: {oneOf: [{$ref: '#/components/schemas/Price'}, {type: 'null'}]} best_sell: {oneOf: [{$ref: '#/components/schemas/Price'}, {type: 'null'}]} liquidity: $ref: '#/components/schemas/Amount' description: What the books show of the orders supplying the venue, each order once, those quoted without lines included. volume_24h: $ref: '#/components/schemas/Amount' description: Settled public trades delivered on the venue in the last 24 hours. QuoteCancellation: type: object required: [order_id, cancel_epoch] properties: order_id: {$ref: '#/components/schemas/Bytes32'} cancel_epoch: {$ref: '#/components/schemas/Cursor'} FundingPlan: type: object description: Expected wallet requests from current balances and allowances; recheck each preparation before signing. required: [observed_at, venue, owner, amount, deposit, withdrawal_amount, withdrawal_to, payment_setup, signed_at_once, requests] properties: observed_at: {$ref: '#/components/schemas/Timestamp'} venue: {$ref: '#/components/schemas/VenueId'} owner: {$ref: '#/components/schemas/Address'} amount: {$ref: '#/components/schemas/Amount'} deposit: {$ref: '#/components/schemas/Amount'} withdrawal_amount: {$ref: '#/components/schemas/Amount'} withdrawal_to: type: [string, 'null'] enum: [signer, escrow, null] description: Where the withdrawal goes; `escrow` only for a withdrawal prepared to the payer's deposit address before transfer withdrawals went to the signer. payment_setup: type: string enum: [done, pending, required] description: >- `required` lists a `permit` request first: prepare it with `POST /v1/accounts/{venue}/setup/permit`, sign and submit it; take once `done`. `pending`: submitted, not yet effective. signed_at_once: type: boolean description: >- True: the take is signed at once with the withdrawal; false: submit the withdrawal and take once its funds arrived ([paying from venue margin](/how-it-works#paying-from-venue-margin)). requests: type: array items: type: object required: [kind, signer, chain_id] properties: kind: type: string enum: [permit, margin_move, transfer_out, pay_take] description: >- `transfer_out`: GMX only, a transaction the signer sends itself, not a signature: `transferOut((token, withdrawal_amount, 0, 0x0, 0x, (0x0, 0, [], 0)))` on GMX's MultichainTransferRouter `0xC993eF170859DAE0241a3c12B8186e456Fa1c1B0`, Arbitrum USDC from its GMX Account to its own address, with no bridge fee; then read the plan again. signer: {$ref: '#/components/schemas/Address'} chain_id: {type: integer} additionalProperties: false additionalProperties: false Take: type: object required: [id, client_take_id, amount_in, amount_out, taker_fee, fills, minimum_received] properties: funding: {$ref: '#/components/schemas/Funding'} minimum_received: oneOf: [{$ref: '#/components/schemas/TokenAmount'}, {type: 'null'}] description: >- For a wallet delivery, the least its recipient receives in all, in the wallet token: on Polygon `ceil(amount_out × 9995 / 10000)`, elsewhere `amount_out`. Null for a venue delivery. id: $ref: '#/components/schemas/Uuid' description: First fill's id. client_take_id: {$ref: '#/components/schemas/ClientId'} amount_in: {$ref: '#/components/schemas/Amount'} amount_out: {$ref: '#/components/schemas/Amount'} taker_fee: $ref: '#/components/schemas/Amount' description: Its fills' `taker_fee`, in their `taker_fee_venue` base units. fills: {type: array, items: {$ref: '#/components/schemas/Fill'}, minItems: 1, maxItems: 8} TakePreparation: type: object required: [take, to_sign] properties: take: {$ref: '#/components/schemas/Take'} aster_reissue: type: boolean const: true description: >- Present while an `aster_transfer` request awaits signing: issue it again with [`aster-request`](/api-reference/takes/reissue-aster) right before the wallet signs it. to_sign: type: array description: Unsigned requests; empty once signatures are accepted. items: oneOf: - {$ref: '#/components/schemas/ToSign'} - {$ref: '#/components/schemas/LighterTransferItem'} - {$ref: '#/components/schemas/AsterTransferItem'} CredentialScope: {type: string, enum: [read, quote, cancel]} CredentialInput: type: object required: [name, quote_signer, scopes, expires_at] properties: name: {type: string, minLength: 1, maxLength: 80, description: Not blank.} quote_signer: $ref: '#/components/schemas/Address' description: Nonzero. scopes: {type: array, items: {$ref: '#/components/schemas/CredentialScope'}, minItems: 1, maxItems: 3} expires_at: $ref: '#/components/schemas/UnixTime' description: Within the next 90 days. additionalProperties: false CredentialCreated: type: object required: [id, name, quote_signer, scopes, expires_at, token] properties: id: {$ref: '#/components/schemas/Uuid'} name: {type: string} quote_signer: {$ref: '#/components/schemas/Address'} scopes: {type: array, items: {$ref: '#/components/schemas/CredentialScope'}} expires_at: {$ref: '#/components/schemas/Timestamp'} token: type: string pattern: ^mk_[0-9a-f]{64}$ description: Returned once. CredentialRotationInput: type: object required: [expires_at] properties: expires_at: $ref: '#/components/schemas/UnixTime' description: Within the next 90 days. additionalProperties: false CredentialRotated: type: object required: [id, token, expires_at] properties: id: {$ref: '#/components/schemas/Uuid'} token: {type: string, pattern: '^mk_[0-9a-f]{64}$'} expires_at: {$ref: '#/components/schemas/Timestamp'} LeaseInput: type: object required: - ttl_seconds properties: ttl_seconds: type: integer minimum: 5 maximum: 120 description: Ignored for a browser identity. api_rtt_ms: type: integer minimum: 0 maximum: 60000 description: Round-trip time of your latest successful request, in ms; send with `api_rtt_age_ms`. Ignored for a browser identity. api_rtt_age_ms: type: integer minimum: 0 maximum: 120000 description: How long before this renewal that request completed, in ms; send with `api_rtt_ms`. additionalProperties: false Lease: type: object required: [identity_id, generation, expires_at] properties: identity_id: {$ref: '#/components/schemas/Uuid'} generation: {$ref: '#/components/schemas/Cursor'} expires_at: {$ref: '#/components/schemas/Timestamp'} IdentityCancellation: type: object required: [identity_id, generation, orders] properties: identity_id: {$ref: '#/components/schemas/Uuid'} generation: {$ref: '#/components/schemas/Cursor'} orders: {type: integer, minimum: 0} BookInvalidation: type: object required: [] properties: {from: {$ref: '#/components/schemas/VenueId'}, to: {$ref: '#/components/schemas/VenueId'}} description: '`from` → `to` books changed, all when empty; reload, not a quantity delta.' OrderPreview: type: object required: [id, state, venue, held, held_in, sequence, cancel_epoch, client_order_id] properties: id: {$ref: '#/components/schemas/Bytes32'} state: {$ref: '#/components/schemas/OrderState'} venue: {$ref: '#/components/schemas/VenueId'} held: {$ref: '#/components/schemas/Amount'} held_in: {$ref: '#/components/schemas/HeldIn'} sequence: {oneOf: [{type: integer}, {type: 'null'}]} cancel_epoch: {$ref: '#/components/schemas/Cursor'} client_order_id: {$ref: '#/components/schemas/ClientId'} FillPreview: type: object required: [id, take_id, order_id, sequence, quote_index, state, payment_leg, maker_leg, payment_destination, maker_destination, amount_in, amount_out, taker_fee, taker_fee_bps, taker_fee_venue, maker_in, maker_out, from_venue, to_venue, pay_by, t1, t2, deliver_by, report_by, delivery_to, delivery_hash, delivery_fee, payment_verified_at, maker_accept_by, maker_accepted_at, reason, role, destination] properties: funding: {$ref: '#/components/schemas/Funding'} destination: {$ref: '#/components/schemas/Destination'} id: {$ref: '#/components/schemas/Uuid'} take_id: {$ref: '#/components/schemas/Uuid'} order_id: {$ref: '#/components/schemas/Bytes32'} sequence: {type: integer} quote_index: {type: integer, minimum: 0} state: {$ref: '#/components/schemas/FillState'} payment_leg: {$ref: '#/components/schemas/PaymentLeg'} maker_leg: {$ref: '#/components/schemas/MakerLeg'} payment_destination: {type: [string, 'null'], enum: [venue, escrow, null]} maker_destination: {type: [string, 'null'], enum: [venue, escrow, wallet, null]} amount_in: {$ref: '#/components/schemas/Amount'} amount_out: {$ref: '#/components/schemas/Amount'} taker_fee: {$ref: '#/components/schemas/Amount', description: 'The taker fee, in `taker_fee_venue` base units.'} taker_fee_bps: {$ref: '#/components/schemas/FeeBps'} taker_fee_venue: {oneOf: [{$ref: '#/components/schemas/VenueId'}, {type: 'null'}]} maker_in: {$ref: '#/components/schemas/Amount', description: 'What the maker receives of the payment.'} maker_out: {$ref: '#/components/schemas/Amount', description: "What leaves the maker's order."} from_venue: {$ref: '#/components/schemas/VenueId'} to_venue: {$ref: '#/components/schemas/VenueId'} pay_by: {$ref: '#/components/schemas/Timestamp'} t1: {$ref: '#/components/schemas/Timestamp'} t2: {$ref: '#/components/schemas/Timestamp'} deliver_by: {type: [string, 'null'], format: date-time} report_by: {type: [string, 'null'], format: date-time} delivery_to: {type: [string, 'null']} delivery_hash: {type: [string, 'null']} delivery_fee: {$ref: '#/components/schemas/Amount'} maker_accept_by: {type: [string, 'null'], format: date-time} maker_accepted_at: {type: [string, 'null'], format: date-time} payment_verified_at: {type: [string, 'null'], format: date-time} reason: {oneOf: [{type: string}, {type: 'null'}]} role: {$ref: '#/components/schemas/FillRole'} LeasePreview: type: object required: [id, generation, lease_expires_at, revoked_at, credential_expires_at, active] properties: id: {$ref: '#/components/schemas/Uuid'} generation: {$ref: '#/components/schemas/Cursor'} lease_expires_at: {$ref: '#/components/schemas/Timestamp'} revoked_at: {oneOf: [{$ref: '#/components/schemas/Timestamp'}, {type: 'null'}]} credential_expires_at: {oneOf: [{$ref: '#/components/schemas/Timestamp'}, {type: 'null'}]} active: {type: boolean} WithdrawalPreview: type: object required: [id, venue, state, amount, venue_ref] properties: id: {$ref: '#/components/schemas/Uuid'} venue: {$ref: '#/components/schemas/VenueId'} state: {$ref: '#/components/schemas/WithdrawalState'} amount: {$ref: '#/components/schemas/Amount'} venue_ref: {oneOf: [{type: string}, {type: 'null'}]} BalancePreview: type: object required: [venue, read_at, chain_read_at, venue_available, chain_available] properties: venue: {$ref: '#/components/schemas/VenueId'} read_at: {oneOf: [{$ref: '#/components/schemas/Timestamp'}, {type: 'null'}]} chain_read_at: {oneOf: [{$ref: '#/components/schemas/Timestamp'}, {type: 'null'}]} venue_available: {type: boolean} chain_available: {type: boolean} TradeEvent: type: object required: [id, from, to, amount_in, amount_out, settled_at] properties: id: {$ref: '#/components/schemas/Uuid'} from: {$ref: '#/components/schemas/VenueId'} to: {$ref: '#/components/schemas/VenueId'} amount_in: {$ref: '#/components/schemas/Amount'} amount_out: {$ref: '#/components/schemas/Amount'} settled_at: {$ref: '#/components/schemas/Timestamp'} BookInvalidationEvent: type: object required: [cursor, resource_id, revision, occurred_at, kind, data] properties: cursor: {$ref: '#/components/schemas/Cursor'} resource_id: {type: string} revision: {$ref: '#/components/schemas/Cursor'} occurred_at: {$ref: '#/components/schemas/Timestamp'} kind: {type: string, const: book.changed} data: {$ref: '#/components/schemas/BookInvalidation'} OrderPreviewEvent: type: object required: [cursor, resource_id, revision, occurred_at, kind, data] properties: cursor: {$ref: '#/components/schemas/Cursor'} resource_id: {type: string} revision: {$ref: '#/components/schemas/Cursor'} occurred_at: {$ref: '#/components/schemas/Timestamp'} kind: {type: string, const: order.changed} data: {$ref: '#/components/schemas/OrderPreview'} FillPreviewEvent: type: object required: [cursor, resource_id, revision, occurred_at, kind, data] properties: cursor: {$ref: '#/components/schemas/Cursor'} resource_id: {type: string} revision: {$ref: '#/components/schemas/Cursor'} occurred_at: {$ref: '#/components/schemas/Timestamp'} kind: {type: string, const: fill.changed} data: {$ref: '#/components/schemas/FillPreview'} LeasePreviewEvent: type: object required: [cursor, resource_id, revision, occurred_at, kind, data] properties: cursor: {$ref: '#/components/schemas/Cursor'} resource_id: {type: string} revision: {$ref: '#/components/schemas/Cursor'} occurred_at: {$ref: '#/components/schemas/Timestamp'} kind: {type: string, const: lease.changed} data: {$ref: '#/components/schemas/LeasePreview'} WithdrawalPreviewEvent: type: object required: [cursor, resource_id, revision, occurred_at, kind, data] properties: cursor: {$ref: '#/components/schemas/Cursor'} resource_id: {type: string} revision: {$ref: '#/components/schemas/Cursor'} occurred_at: {$ref: '#/components/schemas/Timestamp'} kind: {type: string, const: withdrawal.changed} data: {$ref: '#/components/schemas/WithdrawalPreview'} BalancePreviewEvent: type: object required: [cursor, resource_id, revision, occurred_at, kind, data] properties: cursor: {$ref: '#/components/schemas/Cursor'} resource_id: {type: string} revision: {$ref: '#/components/schemas/Cursor'} occurred_at: {$ref: '#/components/schemas/Timestamp'} kind: {type: string, const: balance.changed} data: {$ref: '#/components/schemas/BalancePreview'} TradeEventEvent: type: object required: [cursor, resource_id, revision, occurred_at, kind, data] properties: cursor: {$ref: '#/components/schemas/Cursor'} resource_id: {type: string} revision: {$ref: '#/components/schemas/Cursor'} occurred_at: {$ref: '#/components/schemas/Timestamp'} kind: {type: string, const: trade} data: {$ref: '#/components/schemas/TradeEvent'} Event: oneOf: - {$ref: '#/components/schemas/BookInvalidationEvent'} - {$ref: '#/components/schemas/OrderPreviewEvent'} - {$ref: '#/components/schemas/FillPreviewEvent'} - {$ref: '#/components/schemas/LeasePreviewEvent'} - {$ref: '#/components/schemas/WithdrawalPreviewEvent'} - {$ref: '#/components/schemas/BalancePreviewEvent'} - {$ref: '#/components/schemas/TradeEventEvent'} description: >- Committed cursor order. Payloads are previews at publication, not a transition log; events can repeat, so skip applied revisions ([event kinds](/streaming#event-kinds)). EventPage: type: object required: [events, next_cursor, has_more, oldest_cursor, server_time] properties: events: {type: array, items: {$ref: '#/components/schemas/Event'}, maxItems: 500} next_cursor: $ref: '#/components/schemas/Cursor' description: A journal position, not contiguous per subscriber. has_more: {type: boolean} oldest_cursor: {$ref: '#/components/schemas/Cursor'} server_time: {$ref: '#/components/schemas/Timestamp'} SnapshotBook: type: object required: [order_id, sequence, revision, to, quotes, available, valid_until, expires_at] properties: order_id: {$ref: '#/components/schemas/Bytes32'} sequence: {type: integer} revision: {$ref: '#/components/schemas/Cursor'} to: {$ref: '#/components/schemas/VenueId'} quotes: type: array description: >- Quotes with capacity, `available` capped at `fill_max`; a venue's levels, best price first, show at most what better ones leave of the order's `available`. items: allOf: - {$ref: '#/components/schemas/Quote'} - type: object required: [quote_index, available] properties: quote_index: {type: integer, minimum: 0, description: Position in the signed set.} available: {$ref: '#/components/schemas/Amount'} available: {$ref: '#/components/schemas/Amount'} valid_until: {$ref: '#/components/schemas/Timestamp'} expires_at: {$ref: '#/components/schemas/Timestamp'} SnapshotOrder: allOf: - {$ref: '#/components/schemas/OrderPreview'} - type: object required: [quote_identity_id, revision, amount] properties: quote_identity_id: {$ref: '#/components/schemas/Uuid'} revision: {$ref: '#/components/schemas/Cursor'} amount: {$ref: '#/components/schemas/Amount'} SnapshotFill: allOf: - {$ref: '#/components/schemas/FillPreview'} - {type: object, required: [revision], properties: {revision: {$ref: '#/components/schemas/Cursor'}}} SnapshotIdentity: type: object required: [id, generation, lease_expires_at, revoked_at, credential_expires_at, revision] properties: id: {$ref: '#/components/schemas/Uuid'} generation: {$ref: '#/components/schemas/Cursor'} lease_expires_at: {$ref: '#/components/schemas/Timestamp'} revoked_at: {oneOf: [{$ref: '#/components/schemas/Timestamp'}, {type: 'null'}]} credential_expires_at: {oneOf: [{$ref: '#/components/schemas/Timestamp'}, {type: 'null'}]} revision: {$ref: '#/components/schemas/Cursor'} Snapshot: type: object required: [cursor, books, server_time] properties: cursor: {$ref: '#/components/schemas/Cursor'} books: type: array items: {$ref: '#/components/schemas/SnapshotBook'} maxItems: 1000 description: Public books; empty in a private snapshot. server_time: {$ref: '#/components/schemas/Timestamp'} PrivateSnapshot: type: object required: [cursor, books, server_time, orders, fills, quote_identities] properties: cursor: {$ref: '#/components/schemas/Cursor'} books: {type: array, items: {$ref: '#/components/schemas/SnapshotBook'}, maxItems: 1000} server_time: {$ref: '#/components/schemas/Timestamp'} orders: {type: array, items: {$ref: '#/components/schemas/SnapshotOrder'}, maxItems: 1000} fills: {type: array, items: {$ref: '#/components/schemas/SnapshotFill'}, maxItems: 1000} quote_identities: {type: array, items: {$ref: '#/components/schemas/SnapshotIdentity'}, maxItems: 1000} StreamSubscription: type: object required: [after] properties: {after: {$ref: '#/components/schemas/Cursor'}, token: {oneOf: [{type: string}, {type: 'null'}]}} StreamControl: type: object required: [type, reason] properties: type: {type: string, enum: [resync_required, authentication_required, unavailable]} reason: {type: string} OrderHistoryRow: type: object required: [id, venue, state, amount, held, held_in, quotable, created_at, updated_at, client_order_id, quote_identity_id, quote_signer, revision, sequence] properties: id: {$ref: '#/components/schemas/Bytes32'} venue: {$ref: '#/components/schemas/VenueId'} state: {$ref: '#/components/schemas/OrderState'} amount: {$ref: '#/components/schemas/Amount'} held: {$ref: '#/components/schemas/Amount'} held_in: {$ref: '#/components/schemas/HeldIn'} quotable: {$ref: '#/components/schemas/Amount'} created_at: {$ref: '#/components/schemas/Timestamp'} updated_at: {$ref: '#/components/schemas/Timestamp'} client_order_id: {$ref: '#/components/schemas/ClientId'} quote_identity_id: {$ref: '#/components/schemas/Uuid'} quote_signer: {$ref: '#/components/schemas/Address'} revision: {$ref: '#/components/schemas/Cursor'} sequence: {oneOf: [{type: integer}, {type: 'null'}]} FillHistoryRow: type: object required: [id, take_id, role, order_id, sequence, from_venue, to_venue, amount_out, amount_in, taker_fee, taker_fee_bps, taker_fee_venue, maker_in, maker_out, payment_leg, maker_leg, state, pay_by, t1, t2, created_at, updated_at, settled_at, revision] properties: funding: {$ref: '#/components/schemas/Funding'} id: {type: string, format: uuid} take_id: {type: string, format: uuid} role: {$ref: '#/components/schemas/FillRole'} order_id: {$ref: '#/components/schemas/Bytes32'} sequence: {type: integer} from_venue: {$ref: '#/components/schemas/VenueId'} to_venue: {$ref: '#/components/schemas/VenueId'} amount_out: {$ref: '#/components/schemas/Amount'} amount_in: {$ref: '#/components/schemas/Amount'} taker_fee: {$ref: '#/components/schemas/Amount', description: 'The taker fee, in `taker_fee_venue` base units.'} taker_fee_bps: {$ref: '#/components/schemas/FeeBps'} taker_fee_venue: {oneOf: [{$ref: '#/components/schemas/VenueId'}, {type: 'null'}]} maker_in: {$ref: '#/components/schemas/Amount', description: 'What the maker receives of the payment.'} maker_out: {$ref: '#/components/schemas/Amount', description: "What leaves the maker's order."} payment_leg: {$ref: '#/components/schemas/PaymentLeg'} maker_leg: {$ref: '#/components/schemas/MakerLeg'} state: {$ref: '#/components/schemas/FillState'} pay_by: {$ref: '#/components/schemas/Timestamp'} t1: {$ref: '#/components/schemas/Timestamp'} t2: {$ref: '#/components/schemas/Timestamp'} created_at: {$ref: '#/components/schemas/Timestamp'} updated_at: {$ref: '#/components/schemas/Timestamp'} settled_at: {type: [string, 'null'], format: date-time} revision: {$ref: '#/components/schemas/Cursor'} WithdrawalHistoryRow: allOf: - {$ref: '#/components/schemas/Withdrawal'} - {type: object, required: [revision], properties: {revision: {$ref: '#/components/schemas/Cursor'}}} ExplorerExecution: type: object required: [id, from, to, amount_in, amount_out, maker_address, settled_at] properties: payment_fee: {oneOf: [{$ref: '#/components/schemas/Amount'}, {type: 'null'}], description: 'The venue fee the payment also spent from the paying account, in source base units.'} id: {$ref: '#/components/schemas/Uuid', description: 'Execution ID accepted by /v1/trades/{id}/proof.'} from: {$ref: '#/components/schemas/VenueId'} to: {$ref: '#/components/schemas/VenueId'} amount_in: {$ref: '#/components/schemas/Amount'} amount_out: {$ref: '#/components/schemas/Amount'} destination: {$ref: '#/components/schemas/Destination'} funding: {$ref: '#/components/schemas/Funding'} received: {oneOf: [{$ref: '#/components/schemas/WalletReceipt'}, {type: 'null'}]} maker_address: {$ref: '#/components/schemas/Address'} settled_at: {$ref: '#/components/schemas/Timestamp'} ExplorerTransfer: type: object required: [id, from, to, amount_in, amount_out, status, settled_at, taker_address, executions] properties: id: {$ref: '#/components/schemas/Uuid', description: 'The first take ID, stable across route continuations.'} from: {$ref: '#/components/schemas/VenueId'} to: {$ref: '#/components/schemas/VenueId', description: 'The final destination; until an execution is proven, the first take''s delivery venue.'} amount_in: {oneOf: [{$ref: '#/components/schemas/Amount'}, {type: 'null'}], description: 'Sum of proven and signed in-flight source payments, in source base units; null while none exists.'} amount_out: {oneOf: [{$ref: '#/components/schemas/Amount'}, {type: 'null'}], description: 'Sum of proven and signed in-flight deliveries to the final destination, in destination base units; null while none exists.'} destination: {$ref: '#/components/schemas/Destination'} funding: {$ref: '#/components/schemas/Funding', description: 'How the first take is paid: `venue` or `wallet` ([wallet funding](/how-it-works#wallet-funding)).'} received: {oneOf: [{$ref: '#/components/schemas/TokenAmount'}, {type: 'null'}], description: 'Sum of proven final wallet payouts; null if any final payout is not reported.'} created_at: {$ref: '#/components/schemas/Timestamp'} state: {oneOf: [{$ref: '#/components/schemas/FillState'}, {type: 'null'}], description: 'Latest signed active execution state; null for a route between its legs.'} status: {type: string, enum: [completed, partial, pending], description: '`pending` while a signed execution is in flight, or for two minutes after a route''s leg settles without a final delivery, unless the route was dismissed. Otherwise `completed` with a proven delivery to the final destination and no execution settled or lost without a public proof, else `partial`; expired and refunded executions do not count. Intermediate remainders are visible in the execution amounts.'} settled_at: {$ref: '#/components/schemas/Timestamp', description: 'Latest proven execution settlement, or creation time without one.'} taker_address: {oneOf: [{$ref: '#/components/schemas/Address'}, {type: 'null'}], description: 'The taker''s master address; null until an execution is proven.'} executions: {type: array, minItems: 0, items: {$ref: '#/components/schemas/ExplorerExecution'}} ExplorerTransferPage: type: object required: [data, next_cursor, has_more] properties: data: {type: array, items: {$ref: '#/components/schemas/ExplorerTransfer'}, maxItems: 500} next_cursor: {oneOf: [{type: string, maxLength: 512}, {type: 'null'}]} has_more: {type: boolean} TradeHistoryRow: type: object required: [id, from, to, amount_in, amount_out, taker_fee, taker_fee_bps, taker_fee_venue, maker_in, maker_out, settled_at, taker_address, destination, received] properties: destination: {$ref: '#/components/schemas/Destination'} received: oneOf: [{$ref: '#/components/schemas/WalletReceipt'}, {type: 'null'}] description: A wallet delivery's receipt; null for a venue delivery. id: {$ref: '#/components/schemas/Uuid'} from: {$ref: '#/components/schemas/VenueId'} to: {$ref: '#/components/schemas/VenueId'} amount_in: {$ref: '#/components/schemas/Amount'} amount_out: {$ref: '#/components/schemas/Amount'} taker_fee: {$ref: '#/components/schemas/Amount', description: 'The taker fee, in `taker_fee_venue` base units.'} taker_fee_bps: {$ref: '#/components/schemas/FeeBps'} taker_fee_venue: {oneOf: [{$ref: '#/components/schemas/VenueId'}, {type: 'null'}]} maker_in: {$ref: '#/components/schemas/Amount', description: 'What the maker receives of the payment.'} maker_out: {$ref: '#/components/schemas/Amount', description: "What leaves the maker's order."} settled_at: {$ref: '#/components/schemas/Timestamp'} taker_address: allOf: [{$ref: '#/components/schemas/Address'}] description: >- The taker's master address, not a linked venue address. OrderHistoryPage: type: object required: [data, next_cursor, has_more] properties: data: {type: array, items: {$ref: '#/components/schemas/OrderHistoryRow'}, maxItems: 500} next_cursor: {oneOf: [{type: string, maxLength: 512}, {type: 'null'}]} has_more: {type: boolean} FillHistoryPage: type: object required: [data, next_cursor, has_more] properties: data: {type: array, items: {$ref: '#/components/schemas/FillHistoryRow'}, maxItems: 500} next_cursor: {oneOf: [{type: string, maxLength: 512}, {type: 'null'}]} has_more: {type: boolean} WithdrawalHistoryPage: type: object required: [data, next_cursor, has_more] properties: data: {type: array, items: {$ref: '#/components/schemas/WithdrawalHistoryRow'}, maxItems: 500} next_cursor: {oneOf: [{type: string, maxLength: 512}, {type: 'null'}]} has_more: {type: boolean} TradeHistoryPage: type: object required: [data, next_cursor, has_more] properties: data: {type: array, items: {$ref: '#/components/schemas/TradeHistoryRow'}, maxItems: 500} next_cursor: {oneOf: [{type: string, maxLength: 512}, {type: 'null'}]} has_more: {type: boolean} PendingTrade: type: object required: [id, from, to, amount_in, amount_out, state, created_at, destination] properties: funding: {$ref: '#/components/schemas/Funding'} destination: {$ref: '#/components/schemas/Destination'} id: {$ref: '#/components/schemas/Uuid'} from: {$ref: '#/components/schemas/VenueId'} to: {$ref: '#/components/schemas/VenueId'} amount_in: {$ref: '#/components/schemas/Amount'} amount_out: {$ref: '#/components/schemas/Amount'} state: allOf: [{$ref: '#/components/schemas/FillState'}] description: 'One of `PREPARED`, `RESERVED`, `PAID`, `PAYING`, `LOCKED`, `CLAIMING`, `REFUNDING`.' created_at: {$ref: '#/components/schemas/Timestamp'} PendingTradeList: type: object required: [data] properties: data: {type: array, items: {$ref: '#/components/schemas/PendingTrade'}, maxItems: 500} FillRole: {type: string, enum: [taker, maker]} responses: ValidationError: description: '`VALIDATION_ERROR`: malformed or refused input; `message` names what was refused.' content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}} BadSignature: description: >- `VALIDATION_ERROR`, or `BAD_SIGNATURE`: malformed, by another address, or unknown, used or expired nonce. content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}} Unauthenticated: description: >- `UNAUTHENTICATED`: missing, invalid, expired or revoked bearer, or a credential on a session-only route. content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}} AccessRequired: description: '`ACCESS_REQUIRED`: access not granted, or suspended.' content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}} Forbidden: description: '`FORBIDDEN`: credential without the route''s scope, quote identity unavailable, or admin-only route.' content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}} QuoteForbidden: description: '`ACCESS_REQUIRED`, or `FORBIDDEN`: credential without the scope, or quote identity unavailable.' content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}} NotFound: description: '`NOT_FOUND`: unknown or foreign resource.' content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}} StateConflict: description: >- `STATE_CONFLICT`: the resource's state forbids this, or a client id reused with other terms. content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}} AccountInUse: description: >- `ACCOUNT_IN_USE`: another user's address, or an open or quoting order, a nonfinal fill or a queued, submitting or unknown withdrawal uses the account. content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}} ResyncRequired: description: '`RESYNC_REQUIRED`: cursor outside the retained journal; take a fresh snapshot.' content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}} PayloadTooLarge: description: '`PAYLOAD_TOO_LARGE`: body over 64 KiB.' content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}} VenueDisabled: description: '`VENUE_DISABLED`. An unknown venue is a `VALIDATION_ERROR`.' content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}} AccountNotLinked: description: >- `ACCOUNT_NOT_LINKED`: a needed venue account is unlinked or changed since preparation; `SETUP_REQUIRED` with `venue` and `step` when a setup step it needs is not done; `VENUE_DISABLED` if disabled. content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}} RateLimited: description: '`RATE_LIMITED`: retry the same request after `Retry-After` seconds.' content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}} headers: Retry-After: schema: {type: string, pattern: '^[0-9]+$'} description: Seconds. Internal: description: '`INTERNAL`: server fault; keep the request id.' content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}} VenueUnavailable: description: '`VENUE_UNAVAILABLE`: a venue or chain node did not answer; retry.' content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}} OperatorUnavailable: description: >- `OPERATOR_UNAVAILABLE`: chain observations, integrity, operator gas, relay queue or Hyperliquid account mode not ready for new commitments. content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}} SnapshotTooLarge: description: '`SNAPSHOT_TOO_LARGE`: over 1000 orders, fills, quote identities or book levels; never partial.' content: {application/json: {schema: {$ref: '#/components/schemas/Error'}}}