KasDex is an automated market maker on Kaspa's EVM Layer 2. This API is free, needs no key, and returns ready-to-sign calldata — so a bot can price and execute a trade without ever handing over a private key.
One request gets you a live quote. No signup, no token:
curl "https://kasdex.app/api/v1/quote?from=KAS&to=USDC&amount=1"
The response includes the output amount, price impact, the on-chain trade cap, and a
tx object you can sign and broadcast yourself:
{
"amountIn": "1",
"amountOut": "0.029946",
"minAmountOut": "0.029796",
"price": "0.029946",
"priceImpactBps": 369,
"limits": {
"maxAmountIn": "2.830027845655509461",
"withinCap": true
},
"tx": {
"to": "0xEA4c25D1e8111e74F7c1d3C92dA840e78D5e67E7",
"data": "0x1a019e37...",
"chainId": 38833
}
}
limits.withinCap. Every pool enforces a per-swap size
cap on-chain (currently 10% of the input reserve). A trade above it reverts and wastes
gas — the quote tells you the largest amount that will actually land.
Base URL https://kasdex.app/api/v1. All endpoints are GET, return
JSON, allow CORS from anywhere, and accept ?network=mainnet (default) or
?network=testnet.
| Endpoint | Returns |
|---|---|
/api/v1 | Self-describing index — an agent can discover everything from here. |
/api/v1/tokens | Token registry with addresses and decimals. |
/api/v1/pools | Every pool: reserves, mid price, fee, liquidity caps. |
/api/v1/quote | Swap quote, price impact, cap check, signable calldata. |
| Param | Meaning |
|---|---|
from | Input token — symbol or address. Required. |
to | Output token — symbol or address. Required. |
amount | Decimal amount of from. Required. |
slippageBps | Slippage tolerance in basis points. Default 50 (0.5%). |
wallet | Optional address — adds balance/allowance readiness and approval calldata. |
KasDex ships an MCP server, so Claude and other MCP clients can read markets and (opt-in) trade. Read-only tools need no key:
git clone https://github.com/kasdex-app/kasdex
cd kasdex/mcp-server && npm install && npm run build
claude mcp add kasdex -- node "$PWD/dist/index.js"
It exposes kasdex_list_tokens, kasdex_list_pools,
kasdex_get_quote, and kasdex_get_price.
An npx-installable package is coming shortly.
Then just ask: "What's the KAS price on KasDex?" or "Quote me 5 KAS to USDC and tell me the price impact."
Everything above is the Igra L2 (EVM). KasDex also runs on native Kaspa L1, where pools are covenants rather than contracts. Two properties there are enforced by consensus instead of promised by a team: token supply is fixed (there is no mint path — nobody can ever create more) and pool liquidity is time-locked on-chain from the moment of launch, against the creator too.
Keyless REST, same shape as the L2 API:
# testnet-10 (free coins) mainnet pilot (real KAS, capped)
https://kasdex.app/l1-api https://kasdex.app/l1m-api
GET /l1/pools every covenant pool
GET /l1/pool?pool=<id> one pool: reserves, fee, per-swap cap, lock
GET /l1/quote?direction=kasForTok&amount_in=<sompi>&pool=<id>
GET /l1/balance?address=kaspa:… KAS, token branches, LP shares
GET /l1/health node connectivity + scanner freshness
POST /l1/swap/build → unsigned tx + sighashes
POST /l1/swap/submit → {build_id, signatures}
POST /l1/launch/prepare|submit → launch a token with a seeded, locked pool
The build/submit split is the important part: the service never holds your key. It proposes a transaction, you verify and sign the sighashes yourself, and you submit. Signatures are Schnorr over the sighash — 32-byte secret, 64-byte signature.
The same MCP server exposes L1 once built — kasdex_l1_pools,
kasdex_l1_quote, kasdex_l1_balance, kasdex_l1_status, and
(opt-in) kasdex_l1_swap:
# read-only — no key needed
claude mcp add kasdex -- node "$PWD/dist/index.js"
# autonomous — the AGENT'S OWN wallet; KasDex custodies nothing
KASDEX_L1_PRIVATE_KEY=<32-byte hex> # enables kasdex_l1_swap
KASDEX_L1_MAX_KAS=25 # hard per-call spend ceiling
KASDEX_L1_ALLOW_MAINNET=true # otherwise mainnet calls are refused
Then ask: "What pools exist on Kaspa L1?" or "Quote 1 KAS into the PILOT pool and tell me the per-swap cap."
Thin clients over the same endpoints — source lives in
the repo under sdk/
while the published packages are on their way. The API above needs no SDK at all.
from kasdex import KasDex
dex = KasDex() # mainnet by default
q = dex.quote("KAS", "USDC", "10")
print(q.amount_out, q.price_impact_bps, q.limits.within_cap)
import { KasDex } from '@kasdex/sdk';
const dex = new KasDex();
const q = await dex.quote({ from: 'KAS', to: 'USDC', amount: '10' });
console.log(q.amountOut, q.priceImpactBps, q.limits.withinCap);
| Igra mainnet | Galleon testnet | |
|---|---|---|
| Chain ID | 38833 | 38836 |
| RPC | https://rpc.igralabs.com:8545 | https://galleon-testnet.igralabs.com:8545 |
| KasDex | 0xEA4c25D1e8111e74F7c1d3C92dA840e78D5e67E7 | 0x9253E7038D3eB7ca98EDB2a03810AC06f6BDb287 |
| Explorer | explorer.igralabs.com | Galleon explorer |
priceImpactBps before you trade.The AMM, registry, and vault contracts are open source under MIT at github.com/kasdex-app/kasdex, together with the test suite and threat model.
KasDex TVL is tracked on
DeFiLlama
via an open-source adapter — pool reserves are read directly from the AMM contract on-chain,
so the numbers are verifiable by anyone.
Chain slug: igra · Adapter:
PR #20325.