DFB API v2 models DeFi products as REST resources with a consistent quote → action → broadcast lifecycle. Your app orchestrates discovery and wallet signing; the API returns executable quotes and unsigned transactions.

Non-custodial by design

v2 does not hold user keys or funds:
  • Returns unsigned transactions for wallets or your custody layer to sign
  • Reads public on-chain state when portfolio and analytics endpoints are enabled
  • Never asks end users for seed phrases or private keys

B2B2C model

Integrator app (your product)
    └── End users (custodial or non-custodial)
            └── Sign & broadcast txs built by v2
You own onboarding, KYC, wallet UX, and compliance. v2 owns quoting, routing logic, and transaction construction for DFB-supported products.

Discovery vs live operations

ClassBehaviorExamples
CatalogStructured lists; may include preview metricsGET /v2/pools, GET /v2/vaults
AnalyticsTime series and positions (indexed/on-chain)GET /v2/pools/{poolId}/tvl, /apr
MutationsQuote then action with unsigned txsSwap, LP add/remove, vault deposit/withdraw
If a capability is not live yet, you get 503 provider_unavailable — not synthetic data.

Quote → action → broadcast

Quote tokens

Quotes return a quoteId — a short-lived signed token, not a server session id:
  • Contains quote summary and expiry
  • Typically valid for a few minutes
  • Same token can be exchanged for an action while valid
  • GET /v2/swaps/quote/{quoteId} decodes a swap quote for display

Actions

An action packages one or more unsigned transactions:
{
  "actionId": "...",
  "status": "awaiting_signature",
  "transactions": [{
    "network": "polygon",
    "to": "0x…",
    "data": "0x…",
    "value": "0x0",
    "chainId": 137
  }]
}
Your client signs each entry and broadcasts via your wallet provider or RPC.

Resource identifiers

ResourceID formatExample
Networkslugpolygon, base
Pool{chainId}:{address}137:0x4Af62…
Vault{chainId}:{address}8453:0x09C0…
Quotesigned tokeneyJ…
Actionstringoften the quote token in early releases
Uniswap v4 pools use a bytes32 pool id in the address segment of the pool id.

Pools and vaults

Pools are liquidity venues (DEX LP). Integrators can:
  • List pools and filter by network, protocol, or token
  • Read APR, TVL, volume, and fees (live indexing rolling out)
  • Add or remove liquidity via quote → action (rolling out)
Vaults are strategy products (yield optimizers, managed LP). Integrators can:
  • List vaults with strategy name, asset, preview APY, and risk score
  • Deposit and withdraw via quote → action (rolling out)
See Roadmap for live APR/APY and full mutation support.

Providers

GET /v2/providers lists which product backends power each capability (swap routing, pool reads, vault actions, bridges). The enabled flag reflects what is active in the current API deployment — not something you configure per request.

Errors

All errors share one envelope:
{
  "error": {
    "code": "validation_error",
    "message": "…",
    "requestId": "req_abc123"
  }
}
HTTPcodeMeaning
400invalid_requestMalformed request
422validation_errorInvalid parameters
404not_foundUnknown quote, pool, or action
429rate_limit_exceededToo many requests
503provider_unavailableFeature not enabled yet
502upstream_errorTemporary routing or pricing failure
Every response includes X-Request-ID. Pass it when contacting support.