Skip to main content

Architecture

This document describes the technical architecture of Unbound’s delta-neutral vault.

System Overview

Smart Contracts

Vault Contract (vault.cairo)

ERC-4626 tokenized vault with queue system: Storage:
Key Functions:

Backend Services

DepositProcessor (deposit_processor.py)

Polls vault for pending deposits every 30 seconds:
  1. Reads deposit queue from contract
  2. For each unprocessed deposit:
    • Calls process_deposits() (mints shares, transfers USDC)
    • Deposits USDC to Extended
    • Opens SHORT position

WithdrawalProcessor (withdrawal_processor.py)

Polls vault for pending withdrawals every 30 seconds:
  1. Detects PENDING withdrawals
  2. Calculates USDC value of shares
  3. Closes proportional position on Extended
  4. Requests USDC withdrawal from Extended
  5. Calls mark_withdrawal_ready() when USDC arrives

PositionManager (position_manager.py)

Monitors position health every 60 seconds:
  • Checks funding rate
  • Closes positions if funding < -0.01%
  • Reopens when funding recovers
  • Monitors margin ratio for liquidation risk
Reports NAV to vault periodically:
  • Calculates: wBTC value + Extended equity
  • Signs NAV update
  • Submits to vault contract

API Endpoints

External Integrations

Extended Exchange

Perpetual futures on Starknet:
  • Deposit contract: 0x062da0780fae...
  • Funding payments every hour
  • Formula: Position × Price × Rate

AVNU Router

DEX aggregator for swaps:
  • Address: 0x04270219d365d6...
  • Used for wBTC ↔ USDC swaps on deposit/withdrawal

Data Flow

Deposit

Yield Generation

Withdrawal

Security Model