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
Recommended architecture
Non-custodial app (user holds keys)
Non-custodial app (user holds keys)
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.
Custodial app (you hold keys)
Custodial app (you hold keys)
Your backend calls v2, receives unsigned transactions, signs with your custody system, and broadcasts. Same HTTP contract; signing happens entirely on your side.
Hybrid
Hybrid
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
Client responsibilities
| Responsibility | Owner |
|---|---|
| User authentication in your app | You |
| Wallet connection / key management | You |
| Signing unsigned transactions from v2 | You |
| Broadcasting to the chain | You |
| Slippage, deadlines, and UX copy | You |
| Quoting and tx construction | DFB API v2 |
Error handling
Always read theerror.code field and surface requestId in support tickets:
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