Withdraw
Withdrawal is never blocked — even while the agent is paused or the vault is in emergency mode. This is the core non-custodial guarantee.
How Withdrawals Work
From Idle Balance
If the vault has enough undeployed (idle) capital:
User signs withdraw instruction
→ Vault transfers from idle balance to user's wallet
→ Done — instant, one transactionFrom Deployed Capital
If the user wants to withdraw more than the idle balance, the system first deallocates:
User requests full withdrawal
→ Backend triggers deallocate (redeems from venue)
→ Capital returns to vault idle balance
→ User signs withdraw instruction
→ Assets arrive in user's walletOn Solana, users can also use emergency_exit to sweep all venues back to idle in a single transaction, then withdraw.
Non-Custodial Guarantee
| Scenario | Can user withdraw? |
|---|---|
| Agent running normally | ✓ Always |
Agent paused (set_paused) | ✓ Always |
| Emergency exit triggered | ✓ Always |
| Sentinel lowered caps | ✓ Always |
| Keeper offline | ✓ Always (from idle, or emergency_exit first) |
The agent can be frozen. The user cannot be.
API
| Endpoint | Description |
|---|---|
GET /api/portfolio?chain=...&wallet=... | Check idle vs deployed balances |
GET /api/config?chain=...&wallet=... | Get vault address for signing |
The actual withdrawal transaction is signed and submitted by the user's wallet directly — no backend intermediary.
Emergency Exit (Solana)
The emergency_exit instruction allows the vault owner to sweep ALL deployed capital back to idle in a single transaction, regardless of agent state:
emergency_exit instruction
→ Redeems all cTokens from Solend
→ Returns wSOL to vault idle balance
→ User can then withdraw everythingThis is the ultimate escape hatch — no keeper, no agent, no operator can prevent it.