Quote and execute deposits and withdrawals. Cross-chain routing is handled automatically.Documentation Index
Fetch the complete documentation index at: https://docs.blend.money/llms.txt
Use this file to discover all available pages before exploring further.
Deposits
Discover chains and tokens
Find which chains and tokens are available for deposits.- Frontend
- Server
depositTokens includes wallet balances when the user is signed in.Quoting a deposit
- Frontend
- Server
tokenAddress. It creates a session automatically.| Field | Type | Description |
|---|---|---|
intentId | string | Session ID |
input | object | Symbol, amount, and USD value the user sends |
output | object | Symbol, amount, and USD value arriving in the vault |
fees.totalUsd | string | Total fees in USD |
estimatedSeconds | number | Estimated time to settlement |
expiresAt | string | When this quote expires |
Executing a deposit
- Frontend
- Server
Re-quoting the same session
CallquoteDeposit() again on an open session to update prices. The session stays the same. Don’t create a new session for price refreshes.
- Frontend
- Server
forceReset: true. This cancels the existing session and creates a new one.
Withdrawals
Discover destinations
Find which chains accept withdrawals and which loan token the user will receive.Quoting a withdrawal
- Frontend
- Server
| Field | Type | Description |
|---|---|---|
intentId | string | Session ID |
totalAmount | string | Total withdrawal in loan token smallest units |
totalFeesUsd | string | Total fees in USD |
estimatedSeconds | number | Estimated time to settlement |
sourceChainIds | number[] | Which chains Blend pulls funds from |
sourceChainCount | number | Number of source chains |
Executing a withdrawal
Withdrawals may span multiple chains. The SDK handles multi-chain signing automatically.- Frontend
- Server
deriveSigner is called once per source chain. Handle wallet chain-switching inside the callback.Flow plan conflicts
If a rebalance is in progress, withdrawal quoting returns a409 with error code FLOWPLAN_CONFLICT. Show a “try again shortly” message to your user. Don’t auto-retry - wait for the rebalance to finish.
Cross-chain
Blend routes deposits and withdrawals across chains automatically using the Relay bridge.Bridge adapters
| Adapter | Protocol | When it’s used |
|---|---|---|
| Across | Across Protocol | Primary bridge for cross-chain transfers. Fast finality. |
| CCTP | Circle CCTP | Native USDC bridging between supported chains. No wrapped tokens. |
Safe address determinism
Safe addresses are deterministic. The same wallet address produces the same Safe address on every chain. This means cross-chain deposits route to the correct Safe automatically, even if the Safe hasn’t been deployed on the destination chain yet.liquidityReset as delegateCall
During withdrawals, theliquidityReset step flushes vault positions back to the loan token. This step runs as a delegateCall through the Safe (the only step that does). The isDelegateCall: true flag in the action plan’s transaction marks it.
Testing
Test these scenarios before going to production:| Scenario | How to test | Expected result |
|---|---|---|
| Same-chain deposit | Deposit USDC on Base to a Base-native vault | Single action plan, fast settlement |
| Cross-chain deposit | Deposit USDC on Ethereum to a Base vault | Bridge routing, longer settlement |
| Partial withdrawal | Withdraw 50% of balance | Funds pulled from fewest chains possible |
| Full withdrawal | isMaxWithdraw: true | All positions closed across all chains |
| Quote expiration | Wait past expiresAt | Re-quote required, same session ID |
| Flow plan conflict | Withdraw during an active rebalance | 409 with FLOWPLAN_CONFLICT |
What to watch out for
Don’t useforceReset: true to update prices. Call quoteDeposit() or quoteWithdraw() on the existing session. forceReset cancels the session and starts fresh - use it only when switching tokens or chains.
Don’t auto-retry on FLOWPLAN_CONFLICT. The rebalance needs to finish first. Show a message and let the user try again.
Don’t assume single-chain for withdrawals. Funds may be spread across chains. Your deriveSigner (frontend) or submitActionPlan (server) callback must handle multiple chains.
Don’t skip the amount field when using isMaxWithdraw: true. Pass "0" as the amount.
Frontend SDK
Frontend configuration, auth, and execution details.
Server SDK
Server configuration, account management, and session lifecycle.
SDK Reference
Error codes, types, and utility functions.
Best Practices
Production patterns for session management and error recovery.