Skip to main content
A partner is a company that offers Kash markets to its own users from its own app. You build the interface. Your server calls the REST API with one partner key, and creates a Kash account for each user who opts in. The API then trades for that account on your instruction, pays its winnings into it, and sends its withdrawals to the address you registered for the user. This section is written for the engineers who build that integration. In the examples the partner is a fictional sports app, Harbour Sports Picks.

Concepts

One key acts for every one of your users, the pattern of Stripe Connect’s Stripe-Account header. A key per user would put thousands of secrets on the same server without narrowing what a breach exposes. What bounds a leaked partner key is the rule that money leaves an account only to that user’s registered destination, together with the request rate limits, suspension of one account in one call, and the 24-hour hold on withdrawals after a destination change.

Who does what

Where the money is

  • An account’s USDC and positions are held on chain, in that account’s own Solana wallet. Your server never holds a key to it.
  • The API moves funds out of an account only to carry out the trades and withdrawals you request, and to charge a withdrawal’s network fee. A withdrawal always goes to the user’s registered destination: the request cannot name another address.
  • Partner accounts have no per-trade or daily spending caps, the same as a user of the Kash web app.
  • A user has no Kash login yet, so they reach their account only through your app. That is why an account must be empty before you can release it.

The flow

1

Get a test key

Ask ZeroID for a staging partner key, and send your webhook URL. See Keys.
2

Create an account

POST /v1/partner/accounts when a user opts in. You receive account.active with the account’s Solana depositAddress.
3

Fund it

Send USDC on Solana to the deposit address, then read GET /v1/balance. On staging, ZeroID funds test accounts with test USDC on request.
4

Trade

Read markets and quotes, then POST /v1/trades with the Kash-Account header. Outcomes arrive by webhook.
5

Withdraw

Quote, then POST /v1/partner/accounts/{accountId}/withdrawals. The USDC goes to the user’s registered destination.
6

Go live

Ask ZeroID to approve your organisation and send your IP allowlist and production webhook URL. ZeroID issues your live key; then switch your base URL. See the go-live checklist.

Base URLs

SDK

The TypeScript examples in this section use @kashdao/sdk version 0.4.0, the first version with the partner methods (kash.partnerAccounts, kash.balance and the account option for acting for one account) and the partner webhooks. Earlier versions have none of these. Every route also works over plain HTTP, as the curl examples show.
For a complete working example, the partner integration sample creates an account, checks its balance, places a trade, withdraws and receives verified webhooks, one script per step. The SDK picks the base URL from the key’s prefix.

Next

Quickstart

Create an account, fund it, trade and withdraw on staging.

Keys and approval

Test and live keys, approval and the IP allowlist.