Skip to content

Quotes and token info

These are the read endpoints. None of them require a signature, and none of them move funds.

For par routes there is no quote call: the output equals the input, rescaled to the output token's decimals. You only need a quote when redeeming to USDC, where the price depends on live pool depth.

The info and balance endpoints are open. The redeem quotes price a fill, so they take a partner x-api-key like the swap routes do — see Authentication.


GET /api/base/info

Chain configuration for Base: the router and solver addresses you'll sign against, the supported tokens, and the current per-swap cap.

curl https://swap.stablecoin.xyz/api/base/info
{
  "chainId": 8453,
  "solver": "0x75770a6c6746D8B5B1C82c149B61B5bBc3dEDDe5",
  "router": "0xac01Aba9b7dF219eD83Bfd6914785E00b163eFe6",
  "usdc": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "usdcDec": 6,
  "usdcName": "USD Coin",
  "usdcVersion": "2",
  "out": {
    "SBC":   { "addr": "0xfdcC3dd6671eaB0709A4C0f3F53De9a333d80798", "dec": 18, "inventory": 108.28, "routerAllowance": 1.15e59 },
    "cfUSD": { "addr": "0x131409B31bF446737dD04353D43DACada544b6fA", "dec": 6,  "inventory": 10.01,  "routerAllowance": 1.15e71 }
  },
  "redeemInputs": {
    "SBC": {
      "addr": "0xfdcC3dd6671eaB0709A4C0f3F53De9a333d80798",
      "dec": 18,
      "cap": "SBC",
      "permitDomain": {
        "name": "Stable Coin",
        "version": "1",
        "chainId": 8453,
        "verifyingContract": "0xfdcC3dd6671eaB0709A4C0f3F53De9a333d80798"
      }
    }
  },
  "max": null,
  "rate": 1
}

rate: 1 is the par rate. router is the verifyingContract for the EIP-712 order domain.

Permit domains. For the USDC entry route, usdcName and usdcVersion are the EIP-2612 domain fields for the input token — use them verbatim. When the input is a Brale stable (redemption, or a par swap out of one), take the domain from that token's redeemInputs[SYMBOL].permitDomain instead; the name and version differ per token (Stable Coin / 1 for SBC, Coinflow USD / 1 for cfUSD) and a mismatched domain produces a signature the token contract rejects.

Inventory. Each out entry reports the solver's live inventory in that token and its routerAllowance. A swap larger than inventory will be rejected with INVENTORY_SHORT, so this is the field to pre-flight against before asking a user to sign.


GET /api/sol/info

The Solana equivalent. Reports the canonical SBC mint for the network.

curl ".../api/sol/info?net=mainnet"
QueryRequiredDescription
netNomainnet. Defaults to the worker's network, so you can omit it.

GET /api/base/balance

Balances for one owner across every enabled Base token, as both raw and UI amounts.

curl ".../api/base/balance?owner=0xYourAddress"
{
  "owner": "0xYourAddress",
  "eth": 0.0,
  "tokens": {
    "SBC":  { "ui": 12.5, "raw": "12500000000000000000", "dec": 18 },
    "USDC": { "ui": 40.0, "raw": "40000000", "dec": 6 }
  },
  "usdc": 40.0, "usdcRaw": "40000000", "usdcDec": 6,
  "sbc": 12.5, "sbcRaw": "12500000000000000000", "sbcDec": 18
}

Use raw when computing a "max" amount. Rounding through the ui float loses precision at 18 decimals.

GET /api/sol/balance?owner=<pubkey>&net=<net> is the Solana counterpart.


GET /api/base/redeem/quote

Prices a Brale stable → USDC exit on Base. This is the only quote you must fetch before signing, because the output depends on live DEX pool depth. Requires x-api-key.

curl -H "x-api-key: $SBC_API_KEY" \
  ".../api/base/redeem/quote?in=SBC&amount=25"
QueryRequiredDescription
inNoInput token symbol. Defaults to SBC.
amountYesHuman decimal amount of the input token.
{
  "in": "SBC",
  "out": "USDC",
  "chain": "base",
  "inAmount": 25,
  "usdcOut": 24.97,
  "usdcOutBase": "24970000",
  "slippageBps": 12,
  "minOutBase": "24845150",
  "slippageBpsMax": 50,
  "usdcDec": 6,
  "usdc": "0x...",
  "deliverFrom": "inventory",
  "maxUsd": 250,
  "hardMaxUsd": 1000,
  "solverUsdcInventory": 5000,
  "rate": 0.9988,
  "inputToken": "0x..."
}

minOutBase is the field that matters. It is the proceeds floor, computed server-side from the registry's slippage budget, and it is what the user signs as minOutputAmount in the swap order. Sign the value returned here; do not derive your own floor. The on-chain router enforces it, so a solver cannot deliver less than this even if the pool moves.

deliverFrom tells you whether the solver will fill from its own USDC inventory or execute a live DEX swap. It does not change the price.

maxUsd is the largest single-shot size; hardMaxUsd is the absolute ceiling. Requests above hardMaxUsd, or whose slippageBps would exceed slippageBpsMax, are rejected with a 400. Reduce the size and re-quote.

GET /api/sol/redeem/quote?net=<net>&in=CFUSD&amount=<n> is the Solana counterpart, and takes the same key header.


GET /api/health

Liveness. Returns { "ok": true, "ts": 1750000000000 }.

GET /api/capabilities

Reports which flows are currently enabled for which routes. Useful for feature-gating your UI: a route that is disabled here will reject a swap attempt, so check it before presenting the option. A disabled flow fails with code FLOW_DISABLED.

Both of these, like /api/base/info, /api/sol/info, and the balance endpoints, are open — no key needed.


Next steps