{"openapi":"3.1.0","servers":[{"url":"https://dex.mk","description":"blueDEX production (also reachable at agents.dex.mk)"}],"info":{"title":"blueDEX","version":"0.8.0","description":"Non-custodial swap meta-aggregator DIRECTED SOLELY AT AUTONOMOUS DIGITAL AGENTS (not offered to natural persons). No accounts, no API keys. Queries multiple independent DEX aggregators in parallel (LiFi + KyberSwap on EVM, Jupiter on Solana) and ranks by gas-aware net output; mode:'all' returns every competing quote. Returns unsigned transactions you sign locally. Verify before signing: check verification.routerAllowlisted and cross-check tx.to + feeRecipient against GET /v1/meta (no dependency), or use the bluedex-sdk npm package which pins the allowlist + treasury into the artifact. Errors are machine-actionable. Not available in sanctioned jurisdictions. MCP server at /mcp."},"paths":{"/v1/quote":{"post":{"operationId":"getSwapQuote","summary":"Best route across venues (mode:'all' returns every venue quote)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sell","buy","amount"],"properties":{"sell":{"type":"object","required":["chain","address"],"properties":{"chain":{"type":"string","enum":["base","ethereum","arbitrum","optimism","bsc","polygon","avalanche","solana"]},"address":{"type":"string","description":"ERC-20 address (EVM) or SPL mint (Solana); 'native' for the gas asset"},"symbol":{"type":"string"},"decimals":{"type":"integer"}}},"buy":{"type":"object","required":["chain","address"],"properties":{"chain":{"type":"string","enum":["base","ethereum","arbitrum","optimism","bsc","polygon","avalanche","solana"]},"address":{"type":"string","description":"ERC-20 address (EVM) or SPL mint (Solana); 'native' for the gas asset"},"symbol":{"type":"string"},"decimals":{"type":"integer"}}},"amount":{"type":"string","description":"Integer base units of the sell token"},"slippageBps":{"type":"number","default":50},"taker":{"type":"string"},"mode":{"type":"string","enum":["best","all"]},"ref":{"type":"string","description":"Reserved: affiliate code (accepted and echoed; accrual activates with the fee switch)"},"partner":{"type":"object","description":"Reserved: partner bring-your-own-fee — your fee, your address, forwarded to venue fee params (activates v0.6)","properties":{"feeRecipient":{"type":"string"},"feeBps":{"type":"number","maximum":100}}}}}}}},"responses":{"200":{"description":"Quote with best venue, optional all venues, and auditable feeRecipient"},"404":{"description":"No route","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["GEO_BLOCKED","VENUE_PAUSED","NO_ROUTE","AMOUNT_TOO_SMALL","UPSTREAM_ERROR","RATE_LIMITED","PAYMENT_REQUIRED","INVALID_REQUEST","INCIDENT"]},"message":{"type":"string"},"retryable":{"type":"boolean"}}}}}},"451":{"description":"Geo-blocked jurisdiction","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["GEO_BLOCKED","VENUE_PAUSED","NO_ROUTE","AMOUNT_TOO_SMALL","UPSTREAM_ERROR","RATE_LIMITED","PAYMENT_REQUIRED","INVALID_REQUEST","INCIDENT"]},"message":{"type":"string"},"retryable":{"type":"boolean"}}}}}}}}},"/v1/tx":{"post":{"operationId":"buildSwapTransaction","summary":"Unsigned transaction + verification block (verify before signing)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["source","request"],"properties":{"source":{"type":"string","description":"Venue id from the quote, e.g. 'lifi' or 'jupiter'"},"request":{"type":"object","required":["sell","buy","amount","taker"],"properties":{"sell":{"type":"object","required":["chain","address"],"properties":{"chain":{"type":"string","enum":["base","ethereum","arbitrum","optimism","bsc","polygon","avalanche","solana"]},"address":{"type":"string","description":"ERC-20 address (EVM) or SPL mint (Solana); 'native' for the gas asset"},"symbol":{"type":"string"},"decimals":{"type":"integer"}}},"buy":{"type":"object","required":["chain","address"],"properties":{"chain":{"type":"string","enum":["base","ethereum","arbitrum","optimism","bsc","polygon","avalanche","solana"]},"address":{"type":"string","description":"ERC-20 address (EVM) or SPL mint (Solana); 'native' for the gas asset"},"symbol":{"type":"string"},"decimals":{"type":"integer"}}},"amount":{"type":"string"},"slippageBps":{"type":"number"},"taker":{"type":"string","description":"Address that will sign and execute"}}}}}}}},"responses":{"200":{"description":"EVM to/data/value or Solana transactionBase64, plus verification: routerAllowlisted, decodedSummary, minBuyAmount, approvalTarget"}}}},"/v1/chart":{"get":{"operationId":"getChart","summary":"OHLCV candles for a token's top pool","parameters":[{"name":"chain","in":"query","required":true,"schema":{"type":"string","enum":["base","ethereum","arbitrum","optimism","bsc","polygon","avalanche","solana"]}},{"name":"address","in":"query","required":true,"schema":{"type":"string"}},{"name":"tf","in":"query","schema":{"type":"string","enum":["1m","5m","15m","1h","4h","1d"],"default":"1h"}}],"responses":{"200":{"description":"Candles + attribution"}}}},"/v1/tokens":{"get":{"operationId":"getTokens","summary":"Curated token lists per chain (on-chain verified). Defaults, not limits — any token address with venue liquidity routes.","parameters":[{"name":"chain","in":"query","schema":{"type":"string","enum":["base","ethereum","arbitrum","optimism","bsc","polygon","avalanche","solana"]}}],"responses":{"200":{"description":"Token lists"}}}},"/v1/attest":{"post":{"operationId":"attest","summary":"Signed agent attestation (REQUESTED). Sign the canonical 'blueDEX Agent Attestation v1' message (nonce + current ISO timestamp) with your wallet, then post it. blueDEX recovers the signer and logs it. EVM (personal_sign) supported; Solana coming.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["address","message","signature"],"properties":{"address":{"type":"string","description":"the signer address (0x…)"},"message":{"type":"string","description":"the exact canonical attestation string you signed"},"signature":{"type":"string","description":"personal_sign signature (0x r||s||v)"}}}}}},"responses":{"200":{"description":"{ ok, attestationId, address }"},"400":{"description":"invalid / expired / mismatched signature"}}}},"/v1/meta":{"get":{"operationId":"getMeta","summary":"Published treasury, router allowlist, fee schedule, paused venues — audit blueDEX with this","responses":{"200":{"description":"Transparency data"}}}},"/v1/onramps":{"get":{"operationId":"listOnramps","summary":"Directory of reputable independent fiat->crypto on-ramps (vouchers + non-custodial P2P, tiered-KYC brokers as fallback) for acquiring a first coin with minimal KYC, then bridging on blueDEX. Non-affiliated, non-custodial signpost — coins land in the user's own wallet. Human page at /fund.","responses":{"200":{"description":"On-ramp directory: tiered, with model/access/kyc/geo/fee per provider"}}}},"/v1/route":{"post":{"operationId":"planRoute","summary":"Cheapest MULTI-HOP route between any two assets — composes DEX swaps (non-custodial) + instant-lane bridges (custodial-at-venue) into one path, every fee + per-leg custody disclosed. e.g. USDT-TRC20 -> XAUt-ERC20 = a USDT bridge + a DEX swap. Execute legs in order: DEX via /v1/tx, bridge via /v1/instant/create.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["from","to","amount"],"properties":{"from":{"description":"instant id (e.g. 'usdt-tron') or a DEX token {chain,address}"},"to":{"description":"instant id or a DEX token {chain,address}"},"amount":{"type":"string","description":"integer base units of `from`"}}}}}},"responses":{"200":{"description":"Route: ordered legs (kind, venue, custody, amounts, fee), total output, custodial flag"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["GEO_BLOCKED","VENUE_PAUSED","NO_ROUTE","AMOUNT_TOO_SMALL","UPSTREAM_ERROR","RATE_LIMITED","PAYMENT_REQUIRED","INVALID_REQUEST","INCIDENT"]},"message":{"type":"string"},"retryable":{"type":"boolean"}}}}}},"404":{"description":"No composed path","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["GEO_BLOCKED","VENUE_PAUSED","NO_ROUTE","AMOUNT_TOO_SMALL","UPSTREAM_ERROR","RATE_LIMITED","PAYMENT_REQUIRED","INVALID_REQUEST","INCIDENT"]},"message":{"type":"string"},"retryable":{"type":"boolean"}}}}}}}}},"/v1/instant/assets":{"get":{"operationId":"listInstantAssets","summary":"Assets reachable via the INSTANT lane (no on-chain DEX) — Tron/USDT-TRC20, BTC, stablecoin corridors","responses":{"200":{"description":"Instant asset list (ids like 'usdt-tron')"}}}},"/v1/instant/quote":{"get":{"operationId":"getInstantQuote","summary":"Indicative rate + min/max for an instant pair (custodial at the venue during the swap)","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string"},"description":"instant asset id, e.g. 'usdc-base'"},{"name":"to","in":"query","required":true,"schema":{"type":"string"},"description":"instant asset id, e.g. 'usdt-tron'"},{"name":"amount","in":"query","schema":{"type":"string"},"description":"optional deposit amount (human units of from)"}],"responses":{"200":{"description":"rate, min, max, custodyNote"},"404":{"description":"No instant route","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["GEO_BLOCKED","VENUE_PAUSED","NO_ROUTE","AMOUNT_TOO_SMALL","UPSTREAM_ERROR","RATE_LIMITED","PAYMENT_REQUIRED","INVALID_REQUEST","INCIDENT"]},"message":{"type":"string"},"retryable":{"type":"boolean"}}}}}}}}},"/v1/instant/create":{"post":{"operationId":"createInstantShift","summary":"Open an instant shift — returns a deposit address; send `from` there and `to` settles to your address. Custodial at the venue during the swap; blueDEX never holds funds.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["from","to","settleAddress"],"properties":{"from":{"type":"string","description":"instant asset id to send, e.g. 'usdc-base'"},"to":{"type":"string","description":"instant asset id to receive, e.g. 'usdt-tron'"},"settleAddress":{"type":"string","description":"your receiving address for `to`"},"refundAddress":{"type":"string","description":"optional refund destination if the shift fails/expires"}}}}}},"responses":{"200":{"description":"Shift: id, depositAddress (+depositMemo if required), depositMin/Max, expiresAt, statusUrl"},"400":{"description":"Invalid request / venue rejected","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["GEO_BLOCKED","VENUE_PAUSED","NO_ROUTE","AMOUNT_TOO_SMALL","UPSTREAM_ERROR","RATE_LIMITED","PAYMENT_REQUIRED","INVALID_REQUEST","INCIDENT"]},"message":{"type":"string"},"retryable":{"type":"boolean"}}}}}},"503":{"description":"Instant execution not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["GEO_BLOCKED","VENUE_PAUSED","NO_ROUTE","AMOUNT_TOO_SMALL","UPSTREAM_ERROR","RATE_LIMITED","PAYMENT_REQUIRED","INVALID_REQUEST","INCIDENT"]},"message":{"type":"string"},"retryable":{"type":"boolean"}}}}}}}}},"/v1/instant/status/{id}":{"get":{"operationId":"getInstantStatus","summary":"Live status of a shift (waiting → settled), with deposit/settle tx hashes once available","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Shift status"},"404":{"description":"Unknown shift","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["GEO_BLOCKED","VENUE_PAUSED","NO_ROUTE","AMOUNT_TOO_SMALL","UPSTREAM_ERROR","RATE_LIMITED","PAYMENT_REQUIRED","INVALID_REQUEST","INCIDENT"]},"message":{"type":"string"},"retryable":{"type":"boolean"}}}}}}}}},"/v1/sweep":{"post":{"operationId":"sweepDust","summary":"Consolidate small leftover balances (dust) into one token (default USDC). Pass your dust list; returns a plan of unsigned gas-positive swaps, the whole tiny fee riding one leg. Non-custodial — approve each leg + sign. EVM only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["wallet","dust"],"properties":{"wallet":{"type":"string","description":"your 0x address (the taker)"},"chain":{"type":"string","enum":["base","ethereum","arbitrum","optimism","bsc","polygon","avalanche"],"default":"base"},"dust":{"type":"array","description":"[{ address, amount (integer base units), symbol?, decimals? }]","items":{"type":"object","required":["address","amount"],"properties":{"address":{"type":"string"},"amount":{"type":"string"},"symbol":{"type":"string"},"decimals":{"type":"integer"}}}},"targetToken":{"type":"string","description":"default USDC"},"slippageBps":{"type":"number","default":100}}}}}},"responses":{"200":{"description":"Plan: legs[] (unsigned swaps + approvalTarget), skipped[], fee, summary"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["GEO_BLOCKED","VENUE_PAUSED","NO_ROUTE","AMOUNT_TOO_SMALL","UPSTREAM_ERROR","RATE_LIMITED","PAYMENT_REQUIRED","INVALID_REQUEST","INCIDENT"]},"message":{"type":"string"},"retryable":{"type":"boolean"}}}}}}}}},"/v1/sweep/detect":{"get":{"operationId":"getSweepDetect","summary":"Auto-detect sweepable dust balances for a wallet (best-effort). For reliable results, pass your own balances to POST /v1/sweep.","parameters":[{"name":"wallet","in":"query","required":true,"schema":{"type":"string"},"description":"0x address to scan"},{"name":"chain","in":"query","schema":{"type":"string","enum":["base","ethereum","arbitrum","optimism","bsc","polygon","avalanche"],"default":"base"}}],"responses":{"200":{"description":"Detected dust tokens (address, symbol, amount, estUsd) to feed into /v1/sweep"},"502":{"description":"Upstream detector unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["GEO_BLOCKED","VENUE_PAUSED","NO_ROUTE","AMOUNT_TOO_SMALL","UPSTREAM_ERROR","RATE_LIMITED","PAYMENT_REQUIRED","INVALID_REQUEST","INCIDENT"]},"message":{"type":"string"},"retryable":{"type":"boolean"}}}}}}}}}}}