Smeltor API Docs

Smeltor is a single API that connects apps and agents to DeFi protocols — swap, earn, trade, bridge — without deploying smart contracts or touching user funds.

1The five tools

Same surface, two transports. Use the MCP server from any LLM client; use the REST API from anywhere else. Both wrap the same logic — fee params, slippage clamping, aggregator failover live in one place.

smeltor_swap
Best-of-4 DEX aggregator quote + ready-to-sign EVM calldata, including the ERC-20 approval.
smeltor_earn
Aave vs Moonwell APY compare, auto-pick highest-yield, return approve + supply calldata.
smeltor_perp
Hyperliquid perp open / close. USDC bridge2 deposit calldata + unsigned EIP-712 order body.
smeltor_workflow
Single entry that routes swap | earn | perp_short | perp_long | bridge to the right tool.
parse_intent
Natural-language intent → structured workflow params. Pure regex, no LLM call inside.

2MCP server config

Streamable HTTP transport, no auth, hosted on Supabase Edge Functions. Drop this block into your MCP client config (Claude Desktop, Inspector, custom LLM agent) and the five tools become available immediately.

MCPhttps://juaroposgdkfbvqvzvxf.supabase.co/functions/v1/smeltor-mcp
{
  "mcpServers": {
    "smeltor": {
      "transport": "streamable-http",
      "url": "https://juaroposgdkfbvqvzvxf.supabase.co/functions/v1/smeltor-mcp"
    }
  }
}

Test from a terminal:

curl -sX POST https://juaroposgdkfbvqvzvxf.supabase.co/functions/v1/smeltor-mcp \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream, application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

3REST: best-quote (swap)

Compares 1inch / KyberSwap / ParaSwap / OpenOcean in parallel and returns ready-to-sign calldata for the winner — including the unlimited ERC-20 approval as transactions[0].

POSThttps://basiyx.vercel.app/api/public/swap/best-quote
curl -sX POST https://basiyx.vercel.app/api/public/swap/best-quote \
  -H "Content-Type: application/json" \
  -d '{
    "fromToken": "USDC",
    "toToken": "ETH",
    "amount": "10",
    "chain": "base",
    "walletAddress": "0xYourWallet…"
  }'
{
  "bestAggregator": "paraswap",
  "estimatedOutput": "0.004323728733018535",
  "transactions": [
    {
      "kind": "approval",
      "chainId": 8453,
      "to": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "data": "0x095ea7b3…",
      "value": "0"
    },
    {
      "kind": "swap",
      "chainId": 8453,
      "to": "0x59C7C832e96D2568bea6db468C1aAdcbbDa08A52",
      "data": "0x54e3f31b…",
      "value": "0",
      "gas": "300000"
    }
  ],
  "savings": { "amount": "0.000033", "percent": 0.78, "vs": "openocean" },
  "allQuotes": [
    { "aggregator": "paraswap",  "output": "0.0043237" },
    { "aggregator": "1inch",     "output": "0.0043108" },
    { "aggregator": "kyberswap", "output": "0.0042915" },
    { "aggregator": "openocean", "output": "0.0042914" }
  ],
  "failedAggregators": [],
  "chain": "base"
}

4REST: best-deposit (earn)

Compares Aave V3 and Moonwell APYs and returns approve + supply calldata for the higher-yielding protocol. Pass protocol: "aave" or protocol: "moonwell" to override the auto-pick.

POSThttps://basiyx.vercel.app/api/public/earn/best-deposit
curl -sX POST https://basiyx.vercel.app/api/public/earn/best-deposit \
  -H "Content-Type: application/json" \
  -d '{
    "token": "USDC",
    "amount": "1000",
    "chain": "base",
    "walletAddress": "0xYourWallet…"
  }'
{
  "bestProtocol": "moonwell",
  "apy": 4.74,
  "transactions": [
    {
      "kind": "approval",
      "chainId": 8453,
      "to": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "data": "0x095ea7b3…"
    },
    {
      "kind": "deposit",
      "chainId": 8453,
      "to": "0xEdc817A28E8B93B03976FBd4a3dDBc9f7D176c22",
      "data": "0xa0712d68…"
    }
  ],
  "approvalSpender": "0xEdc817A28E8B93B03976FBd4a3dDBc9f7D176c22",
  "allYields": { "aave": 3.93, "moonwell": 4.74 },
  "chain": "base"
}

5REST: order plan (perp)

Detects HL state, computes order size + tick-formatted limit price, and returns the unsigned order body for an HL-aware client to sign with the user's local agent key. Hard floor at $5 minimum margin (status = below_minimum); per-asset leverage advisories surface in warnings[].

POSThttps://basiyx.vercel.app/api/public/perp/order
curl -sX POST https://basiyx.vercel.app/api/public/perp/order \
  -H "Content-Type: application/json" \
  -d '{
    "action": "open",
    "asset": "ETH",
    "amount": "50",
    "leverage": 5,
    "side": "short",
    "walletAddress": "0xYourWallet…"
  }'
{
  "status": "needs_deposit",
  "warnings": [],
  "requirements": {
    "hasAgentWallet": true,
    "hasBuilderApproval": true,
    "balanceUsdcOnHl": 32.78,
    "requiredUsdcOnHl": 50,
    "assetTradeable": true
  },
  "transactions": [
    { "kind": "approval", "chainId": 42161, "to": "0xaf88…", "data": "0x095ea7b3…" },
    { "kind": "deposit",  "chainId": 42161, "to": "0xaf88…", "data": "0xa9059cbb…" }
  ],
  "orderAction": {
    "type": "order",
    "orders": [{
      "a": 1, "b": false, "p": "2306.8", "s": "0.1083",
      "r": false, "t": { "limit": { "tif": "Ioc" } }
    }],
    "builder": { "b": "0x7c65…d543", "f": 50 }
  },
  "submitUrl": "https://api.hyperliquid.xyz/exchange"
}

6Try it

The fastest way to internalize the surface is the live demo — same routes, browser-side, no setup. Click around and watch real on-chain data.