Kash-Account (they refuse the header with 400 ACCOUNT_HEADER_NOT_ALLOWED). Trade routes act for one account and need the header (without it, 400 ACCOUNT_HEADER_REQUIRED).
The request and response shapes are the same as for any API key: see Markets and Trades.
List markets
Each market carries its
outcomes[] with each outcome’s probability (0 to 1), its category, subcategory and chain, and tradeable. Show only markets with tradeable: true as open for trading: a market past its freeze deadline keeps status: "ACTIVE".
Quote a price
amount is in atomic units: USDC with 6 decimals for a buy (10000000 is 10 USDC), outcome tokens with 18 decimals for a sell. The answer carries tokensOut, effectivePrice and impliedProbability.
Place a trade
The smallest trade is 1 USDC. A smaller one is accepted (202) and then rejected: you receive trade.rejected with the reason “Trade amount $0.50 is below the minimum of $1.00”.
amount is a decimal USDC string ("10" is 10 USDC, up to 6 decimals), unlike the atomic amounts elsewhere in the partner routes. The answer is 201 Created with the trade in pending. It then moves through validating and executing to completed, or ends failed or rejected.
What is different for a partner key:
- No spending caps. Partner accounts have no per-trade or daily limit, and no high-value confirmation step, so a partner trade never returns
202with a confirmation token. - The account must be
active. Aprovisioning,provisioning_failedorsuspendedaccount is refused with409 ACCOUNT_NOT_ACTIVE. - Country rules apply. The API checks the trade against the country you registered for the account. A refused trade ends
rejected, and you receivetrade.rejected. - Balance is checked on chain after the trade is accepted. A trade the account cannot fund ends
failedorrejected, with a lowercaseerrorCodesuch asinsufficient_balance. - Idempotency is per account. The same
Idempotency-Keyused for two different accounts is two independent requests.
With the SDK
With@kashdao/sdk 0.4.0, pass the user’s accountId as account on the trade; the SDK sends it as the Kash-Account header and adds an Idempotency-Key to every POST.
account is accepted by balance, trades, portfolio, redemptions and traces. Markets and quotes act for no account, so their methods do not take it, and there is no client-level default. The SDK drops a Kash-Account header passed in headers, so always use account.
Trade outcomes
Trade outcomes arrive as webhooks to the key that placed the trade:trade.completed, trade.failed and trade.rejected. Each carries tradeId, marketId, outcomeIndex, amount, side, status and your metadata. See Webhooks.
You can also read a trade with GET /v1/trades/{id}, list the account’s trades with GET /v1/trades, or follow one through the pipeline with GET /v1/traces/{correlationId}, each with the Kash-Account header.
Selling and redeeming
- Sell with
side: "sell"and the USDC amount, as for any key. A sell of an outcome the account does not hold fails witherrorCode: "no_position", and repeating that sell within the hour, before anything gives the account a position, can be refused at once with422 NO_POSITION. - Winnings from a resolved market are paid into the account automatically, and you receive
payout.completed. If automatic payouts are paused, claim withPOST /v1/redemptionsand theKash-Accountheader.
Next
Withdrawals
Send USDC back to the user’s registered destination.
Webhooks
Every event your endpoint receives.