Authentication

The public v2 API does not require client API keys. Send standard HTTPS requests from your server or (for read-only calls) from the browser. For browser apps, ensure your production origin is allowed by the API CORS policy. Contact DFB if you need your app domain allowlisted.

First request

curl -sS https://api.dfb.network/v2/health
curl -sS https://api.dfb.network/v2/networks
curl -sS https://api.dfb.network/v2/pools
Your frontend calls v2 for quotes and unsigned transactions. A wallet SDK (MetaMask, WalletConnect, etc.) signs and broadcasts. Never send user private keys to DFB or to your backend for signing unless you operate custody.
Your backend calls v2, receives unsigned transactions, signs with your custody system, and broadcasts. Same HTTP contract; signing happens entirely on your side.
Reads (balances, pool lists) can be proxied through your backend for caching and analytics. Mutations still follow quote → action → sign → broadcast.

TypeScript SDK (roadmap)

A TypeScript SDK is planned so integrators can wire frontend or Node backends without hand-rolling every route:
  • Typed requests and responses aligned with OpenAPI
  • Helpers for quote → action flows (swap, pool deposit/withdraw, vault deposit/withdraw, bridge)
  • Network and token utilities
  • Optional React hooks for wallet-connected UIs
Until the SDK ships, use the API Reference or generate a client from the OpenAPI spec. See Roadmap.

Client responsibilities

ResponsibilityOwner
User authentication in your appYou
Wallet connection / key managementYou
Signing unsigned transactions from v2You
Broadcasting to the chainYou
Slippage, deadlines, and UX copyYou
Quoting and tx constructionDFB API v2

Error handling

Always read the error.code field and surface requestId in support tickets:
{
  "error": {
    "code": "validation_error",
    "message": "amount must be a positive integer in atomic units",
    "requestId": "req_abc123"
  }
}
See Errors and limits.

Amounts and addresses

  • Token amounts are atomic integers (wei/smallest unit), passed as strings.
  • Addresses are checksummed or lowercase 0x + 40 hex characters.
  • Pool and vault ids use {chainId}:{address} (Uni V4 pools use a bytes32 id in the address segment).

OpenAPI and code generation

The machine-readable contract is OpenAPI 3. Use it to generate clients in any language:
  • Browse interactively in the API Reference tab on this site
  • Download the spec from your integration environment or generate from the published OpenAPI bundle
Details: OpenAPI contract.