c00k Exchangec00kExchange
Checking…
Developers API

Every pool on Arc.One API call.

The same engine that runs this site, open to any wallet, bot or app: best-price quotes split across every indexed pool, and swaps handed back as calldata ready for your user to sign. Name your address as referrer and the router pays you 0.1% of every swap you send, in the same transaction.

0.5%platform fee, already in every quote
0.1%of every swap paid to your referrer address
0.4%to the treasury, which buys $c00k
600 / minrequests with a free key, 120 without

1 · Get a key

Free and instant. The key raises your rate limit, and the referrer you set here is used on every swap built with it.

2 · Endpoints

Base URL https://c00k.exchange/api/v1. Every request is a GET with query parameters, except creating a key. Amounts are either amount in whole tokens or amountIn in base units. Send your key as the x-api-key header.

GET/tokens?curated=1&q=usdc

Every token the index can route, with symbol, decimals and address. q filters by symbol or address.

curl "https://c00k.exchange/api/v1/tokens?curated=1&q=usdc"

GET/quote?tokenIn=&tokenOut=&amount=

The best split across every pool at the latest block. The answer has the fee already taken off the input, the route, the price impact and the block it was read at.

curl -H "x-api-key: YOUR_KEY" \
  "https://c00k.exchange/api/v1/quote?tokenIn=0x3600000000000000000000000000000000000000&tokenOut=0x30e61a775f6Ad3275Afb654dc55e9356b333446f&amount=25"

GET/swap?tokenIn=&tokenOut=&amount=&recipient=&slippageBps=&referrer=

A transaction ready to sign: to, data and value, simulated on Arc from the recipient before it is returned. referrer is optional when your key already has one.

const r = await fetch('https://c00k.exchange/api/v1/swap?' + new URLSearchParams({
  tokenIn: USDC, tokenOut: TOKEN, amount: '25',
  recipient: user, slippageBps: '50', referrer: YOUR_ADDRESS,
}), { headers: { 'x-api-key': KEY } }).then((r) => r.json())

// the user approves r.transaction.to for amountIn of tokenIn, then:
await wallet.sendTransaction(r.transaction)

GET/stats?referrer=0x...

What a referrer address has been paid: swaps and amounts per token, counted from the router's own Referral events.

curl "https://c00k.exchange/api/v1/stats?referrer=YOUR_ADDRESS"

POST/keys

Creates a key. Body: name, and optionally referrer.

curl -X POST https://c00k.exchange/api/v1/keys -H "content-type: application/json" \
  -d '{"name":"my-wallet","referrer":"0xYourAddress"}'
01How you get paidThe router contract itself pays the referrer named in the transaction: 0.1% of the input, in the input token, in the same transaction as the swap. There is nothing to claim and no invoice. A referrer that is the trader itself is paid nothing.
02What your users pay0.5% of the input, the same as on this site. It is already in every quote, so the amount out you show them is the amount they get.
03What nobody can changeFEE_BPS = 50 and REFERRER_BPS = 10 are constants in the router. The router has no owner, no pause and no upgrade.