How It Works
This document explains the complete flow of Unbound’s delta-neutral vault.Deposit Flow
Step 1: User Initiates Deposit
User connects wallet and deposits wBTC through the frontend.Step 2: Vault Processes Deposit
The vault smart contract:- Receives user’s wBTC
- Keeps 50% as wBTC in vault (LONG exposure)
- Swaps other 50% to USDC via AVNU
- Queues deposit for backend processing
- Mints vault shares to user
Step 3: Backend Opens Position
BackendDepositProcessor detects queued deposit:
- Calls
process_deposits()on vault (mints shares, transfers USDC) - Deposits USDC to Extended exchange
- Opens SHORT position matching wBTC value (delta-neutral)
Deposit Flow Diagram
Delta-Neutral Position
After deposit, the vault holds:| Component | Location | BTC Exposure |
|---|---|---|
| 50% wBTC | Vault contract | +0.5 BTC (LONG) |
| 50% USDC | Extended exchange | 0 (margin) |
| SHORT position | Extended | -0.5 BTC |
| Net exposure | 0 (NEUTRAL) |
Funding Payments
Extended charges/pays funding every hour using this formula:When Funding is Positive (84% of time)
When Funding is Negative (16% of time)
Position Manager
BackendPositionManager monitors funding rate every 60 seconds:
- If funding < -0.01%: Closes all shorts to avoid paying
- If funding recovers: Allows reopening positions
NAV Calculation
NAV = wBTC Value + Extended EquityWithdrawal Flow
Step 1: User Requests Withdrawal
User callsrequest_withdraw(shares) on vault:
- Shares are locked
- Withdrawal queued with status PENDING
Step 2: Backend Processes Withdrawal
BackendWithdrawalProcessor detects pending withdrawal:
- Calculates USDC value of shares
- Closes proportional short position
- Withdraws USDC from Extended
- Calls
mark_withdrawal_ready()on vault
Step 3: User Completes Withdrawal
User callscomplete_withdrawal():
- Vault swaps USDC → wBTC via AVNU
- Distributes proportional wBTC from vault holdings
- Burns shares
- Sends total wBTC to user
Withdrawal Flow Diagram
Key Events
| Event | What Happens |
|---|---|
| User Deposits | 50% kept as wBTC, 50% → USDC → Extended → SHORT |
| Funding Payment | Every hour, equity grows/shrinks based on funding rate |
| User Withdraws | Close proportional SHORT → USDC + wBTC → User |
