blueDEX.mk
developer docs · non-custodial swap meta-aggregator for autonomous agents
RESTMCPOpenAPIllms.txtBaseEthereumArbitrumOptimismSolana
No signup, no API key. blueDEX never holds your funds — we aggregate quotes across DEX venues, return the best route, and hand you an unsigned transaction you sign with your own key. Verify before signing (§3). Not available in sanctioned jurisdictions.

1 · Get a quote (no auth)

Amounts are integer base units (wei-style) as strings. mode:"all" returns every venue so you can see what we beat.

curl -s https://dex.mk/v1/quote \
  -H 'content-type: application/json' \
  -d '{
    "sell": { "chain": "base", "address": "0x4200000000000000000000000000000000000006", "symbol": "WETH" },
    "buy":  { "chain": "base", "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "symbol": "USDC" },
    "amount": "100000000000000000",
    "mode": "all"
  }'

2 · Build the transaction

Pass the winning source from the quote plus your taker address. You get back EVM to/data/value (or a Solana base64 tx) and a verification block.

curl -s https://dex.mk/v1/tx \
  -H 'content-type: application/json' \
  -d '{
    "source": "lifi",
    "request": {
      "sell": { "chain": "base", "address": "0x4200000000000000000000000000000000000006" },
      "buy":  { "chain": "base", "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913" },
      "amount": "100000000000000000",
      "taker": "0xYOUR_ADDRESS"
    }
  }'

3 · Verify before signing

No dependency needed: confirm verification.routerAllowlisted and cross-check tx.to + feeRecipient against /v1/meta. Or use the bluedex-sdk helper, which pins the router allowlist + treasury inside the package so a compromised blueDEX server cannot trick a verifying client. Sign only if ok is true.

import { verifyTx } from "bluedex-sdk";

const tx = await (await fetch("https://dex.mk/v1/tx", {
  method: "POST", headers: { "content-type": "application/json" },
  body: JSON.stringify({ source, request })
})).json();

const verdict = verifyTx(tx);
if (!verdict.ok) throw new Error(verdict.failures.join("; ")); // do NOT sign
// ...sign tx.to / tx.data / tx.value with your wallet

4 · MCP server (for LLM agents)

Point any MCP client at the endpoint below — Streamable HTTP, stateless, no key. Tools: get_swap_quote, build_swap_transaction, get_chart, get_meta, list_instant_assets, create_instant_shift, get_instant_status, sweep_dust, list_onramps, plan_route.

https://dex.mk/mcp

Claude Code / Claude Desktop:

claude mcp add --transport http blueDEX https://dex.mk/mcp

5 · Endpoints

methodpathwhat
POST/v1/quotebest route across venues (+ all venues)
POST/v1/txunsigned tx + verification block
GET/v1/chart?chain=&address=&tf=1hOHLCV candles
GET/v1/tokens?chain=basecurated token lists (any address routes)
GET/v1/metatreasury, router allowlist, fees — audit us
GET/v1/onrampsreputable low-KYC fiat on-ramps (human page: /fund)
POST/v1/routecheapest multi-hop route (DEX + bridge legs, all fees + custody shown)
POST/v1/sweepconsolidate dust balances into one token (tiny fee, one leg)
GET/v1/sweep/detect?wallet=&chain=auto-detect sweepable dust (best-effort)
GET/v1/instant/assetsinstant-lane assets — Tron/USDT-TRC20, BTC, …
GET/v1/instant/quote?from=&to=&amount=indicative instant rate + min/max
POST/v1/instant/createopen an instant shift (returns a deposit address)
GET/v1/instant/status/:idinstant shift status
POST/v1/attestsigned agent attestation
ALL/mcpMCP server (Streamable HTTP)
GET/openapi.jsonOpenAPI 3.1 spec
GET/llms.txtLLM-readable summary

6 · Sweep dust

Consolidate a pile of tiny leftover balances into one token (default USDC) in a single call. You pass the dust list — you already know your own balances — and get a plan of unsigned, gas-positive swaps. The whole tiny fee (0.1% of the total) rides one leg; below a small floor it's free. Non-custodial: approve each leg's approvalTarget and sign.

curl -s https://dex.mk/v1/sweep \
  -H 'content-type: application/json' \
  -d '{
    "wallet": "0xYOUR_ADDRESS",
    "chain": "base",
    "dust": [
      { "address": "0x4200000000000000000000000000000000000006", "amount": "5000000000000000" },
      { "address": "0x50c5725949a6f0c72e6c4a641f24049a917db0cb", "amount": "2000000000000000000" }
    ]
  }'

7 · Errors

Machine-actionable: { code, message, retryable }. Codes: GEO_BLOCKED · VENUE_PAUSED · NO_ROUTE · AMOUNT_TOO_SMALL · UPSTREAM_ERROR · RATE_LIMITED · PAYMENT_REQUIRED · INVALID_REQUEST · INCIDENT.

Earn by integrating. Reserved request fields, activating soon: ref (affiliate code — earn a fixed share of blueDEX's fee on referred volume, agents welcome) and partner {feeRecipient, feeBps} (bring-your-own-fee: monetize swaps, your fee goes straight to your address).