This guide walks you end-to-end against the staging environment (Documentation Index
Fetch the complete documentation index at: https://docs.kash.bot/llms.txt
Use this file to discover all available pages before exploring further.
api-staging.kash.bot, Base Sepolia). Going live afterwards is the same flow against api.kash.bot.
1. Create a Kash account
If you don’t have one already, sign up at staging.kash.bot. The staging webapp is the human-facing front door; you’ll use it to create the account that owns your API keys.2. Generate an API key
In the webapp:- Go to Settings → API Keys.
- Click Create key.
- Give it a name (e.g.
local dev) and select the scopes you need:markets:read— read market detail & list (granted by default on every tier)markets:quote— fetch on-chain price quotesportfolio:read— read your own positionstrades:read— list and inspect your tradestrades:write— place trades and confirm high-value oneswebhooks:manage— list events, redeliver, rotate the webhook secret
- (Optional) Set an IP allowlist if you’ll always call from a known set of addresses.
- (Optional) Set a
webhook_urlif you want trade-lifecycle events POSTed to your endpoint.
kash_test_ prefix marks staging keys; production keys use kash_live_.
3. Make your first request
200 OK with a page of markets.
If you get 401 INSUFFICIENT_SCOPE, your key is missing markets:read. If you get 429, you’ve hit your tier’s rate limit — the response includes X-RateLimit-Reset and Retry-After.
4. Get a quote
amount here is in atomic USDC (10000000 = 10 USDC). The response carries the expected tokensOut, the post-trade pool state, and an effectivePrice convenience number.
5. Place your first trade
amount in the trade body is a decimal string of USDC ("10" = 10 USDC), distinct from the atomic-units amount used by the quote endpoint.
You’ll get back a 201 Created:
status field tracks the lifecycle: pending → validating → executing → completed (or failed/rejected).
6. Watch the trade complete
The simplest way is to poll:completed with a txHash and tokensOut populated.
The better way is to receive a webhook — see step 7.
7. Receive a webhook
If you set awebhook_url on the key in step 2, the trade.completed event was already POSTed to your endpoint. The body looks like:
8. (Optional) Use the SDK
The TypeScript SDK gives you typed everything — including a one-lineconstructEvent for webhook verification:
What next?
Authentication
Scopes, IP allowlists, and key rotation.
Webhooks
Set up a verified, retried webhook endpoint.
Idempotency
Safely retry trade creation without duplicates.