TypeScript SDK — Clearing: Instant Orders
Get instant quotes and execute instant trades. All methods are on client.clearingInstant.
See the API specifications for full request/response schemas and the authentication guide for setup.
Methods
getInstantQuote
POST /v1/instant/quote · Authenticated
Requests a price quote for an instant trade. The request uses totalSpend to specify the trade size. For buy orders, totalSpend is the fiat amount you want to spend (e.g. USD). For sell orders, totalSpend is the CCY1 quantity you want to sell (e.g. BTC amount), not a dollar amount.
Code
Tip: Quotes are time-limited (
maxAgeMstells you how long). Execute promptly or request a fresh quote.quoteIdis a number (not bigint or string). Prices, quantities, and fees are decimal strings.
This is a POST mutation — never automatically retried.
executeInstantOrder
POST /v1/instant/execute · Authenticated
Executes an instant trade using a previously obtained quote. The request body is validated client-side. The SDK enforces:
symbol— required stringquantity— required stringprice— required stringfee— required stringside— required enum:"buy"or"sell"quoteId— required number
Code
Caveat: This is a POST mutation — never automatically retried. The
quoteIdmust reference a valid, unexpired quote fromgetInstantQuote. All string fields (quantity,price,fee) must match the quote response values exactly. ThequoteIdin the request is anumber.
Typical instant trade flow
- Request a quote with
getInstantQuoteusingtotalSpend - Display the quote to the user (price, quantity, fees)
- Execute with
executeInstantOrder, passing thequoteIdand the exactprice,quantity, andfeefrom the quote
Code
What's next
- Clearing Orders — standard OTC clearing order management
- Request Validation — how client-side validation works
- Data Types — decimal strings and bigint fields