KasDex Developers ← Back to app
● LIVE ON IGRA MAINNET

The DEX built for agents.

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.

Quickstart

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
  }
}
Always check 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.

Endpoints

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.

EndpointReturns
/api/v1Self-describing index — an agent can discover everything from here.
/api/v1/tokensToken registry with addresses and decimals.
/api/v1/poolsEvery pool: reserves, mid price, fee, liquidity caps.
/api/v1/quoteSwap quote, price impact, cap check, signable calldata.

Quote parameters

ParamMeaning
fromInput token — symbol or address. Required.
toOutput token — symbol or address. Required.
amountDecimal amount of from. Required.
slippageBpsSlippage tolerance in basis points. Default 50 (0.5%).
walletOptional address — adds balance/allowance readiness and approval calldata.

Use it from an AI agent

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."

Trading tools stay unregistered unless you set a private key, dry-run by default, and refuse trades over the cap or over your configured max price impact.

Native Kaspa L1 covenants, no EVM

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.

Agent tools

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
An agent never blind-signs. Before producing a signature the client re-derives the whole transaction: every output marked as yours must pay your key, the miner fee is bounded, the pool must move the way the trade claims, token and LP outputs must pay you (rebuilt from a KCC20 script template pinned in the client, not supplied by the service), and every sighash is recomputed from the bytes just inspected. A compromised or buggy service cannot redirect an autonomous agent's funds — it can only get a refusal. L1 defaults to testnet-10; mainnet is refused unless explicitly allowed.

Then ask: "What pools exist on Kaspa L1?" or "Quote 1 KAS into the PILOT pool and tell me the per-swap cap."

SDKs

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.

Python

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)

TypeScript

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);

Networks

Igra mainnetGalleon testnet
Chain ID3883338836
RPChttps://rpc.igralabs.com:8545https://galleon-testnet.igralabs.com:8545
KasDex0xEA4c25D1e8111e74F7c1d3C92dA840e78D5e67E70x9253E7038D3eB7ca98EDB2a03810AC06f6BDb287
Explorerexplorer.igralabs.comGalleon explorer

Honest status

Contracts

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.

Ecosystem

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.