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.


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://better-intents-ui-testnet.stablecoinxyz.workers.dev/api/base/info
{
  "chainId": 84532,
  "solver": "0x75770a6c6746D8B5B1C82c149B61B5bBc3dEDDe5",
  "router": "0x...",
  "usdc": "0x...",
  "usdcDec": 6,
  "usdcName": "USD Coin",
  "usdcVersion": "2",
  "out": { "SBC": { "addr": "0xf9FB20B8E097904f0aB7d12e9DbeE88f2dcd0F16", "dec": 18 } },
  "redeemInputs": { "SBC": { "addr": "0xf9FB20B8E097904f0aB7d12e9DbeE88f2dcd0F16", "dec": 18 } },
  "max": 100,
  "rate": 1
}

rate: 1 is the par rate. usdcName and usdcVersion are the EIP-2612 permit domain fields for the input token. Use them verbatim when building the permit signature. max is the per-swap notional cap.


GET /api/sol/info

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

curl ".../api/sol/info?net=testnet"
QueryRequiredDescription
netNomainnet or testnet. Defaults to the worker's network.

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.

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


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.


Next steps