Skip to main content

Vault System

The Citadel Finance Vault System provides leveraged exposure to the synthetic EUR positions through a sophisticated vault architecture. Users can deposit collateral and receive amplified exposure to price movements with different risk/reward profiles.

🏗️ Architecture Overview

The vault system consists of three main components:

  • VaultFactory: Creates and manages vault instances
  • VaultRegistry: Tracks and registers deployed vaults
  • Vault Implementation: Core vault logic with leverage mechanics

📋 Deployed Vaults

Vault TypeLeverageCollateral RequirementDeployment
Conservative Vault1x200%testnet
Moderate Vault5x120%testnet
Aggressive Vault20x105%testnet

🔧 Core Contracts

VaultFactory

Address: 0x17FE9FE1d839097a07635f0CE6c6292D422334b2

Purpose: Factory contract responsible for deploying new vault instances using the EIP-1167 minimal proxy pattern.

Key Functions:

function createVault(
string memory _lpTokenName,
string memory _lpTokenSymbol,
address _pool,
uint128 _overCollateralization
) external returns (IVault vault)

Access Control: Only the protocol deployer can create new vaults through this factory.

VaultRegistry

Address: 0x49D97f8a2f65ec3B0719Fe0a1B83aA50Bd1d593F

Purpose: Maintains a registry of all deployed vaults and their associated pools for tracking and management.

Key Functions:

function registerVault(address pool, address vault) external
function isVaultRegistered(address vault) external view returns (bool)
function getVaultsForPool(address pool) external view returns (address[] memory)

Vault Implementation

Address: 0xd4438c02Ed3e56F3F7fCA535Ac967602C0bA4b45

Purpose: The core vault logic contract that all vault proxies delegate to. Implements leveraged liquidity provision mechanics.

💡 How Vaults Work

Leverage Mechanics

Vaults provide leveraged exposure by automatically managing overcollateralization requirements:

  • 1x Vault: Requires 100% collateral (1.0 ether overcollateralization)
  • 5x Vault: Requires 20% collateral (0.2 ether overcollateralization)
  • 20x Vault: Requires 5% collateral (0.05 ether overcollateralization)

User Workflow

  1. Deposit: Users deposit FDUSD collateral into a vault
  2. LP Token Minting: Receive vault-specific LP tokens representing their share
  3. Automatic Position: Vault automatically opens leveraged liquidity provider position
  4. Yield Generation: Earn amplified fees and lending yields based on leverage
  5. Withdrawal: Burn LP tokens to withdraw collateral plus/minus gains/losses

🔄 Key Functions

Deposit Function

function deposit(uint256 collateralAmount, address recipient) 
external returns (uint256 lpTokensOut)

Deposits collateral and mints LP tokens representing the user's leveraged position.

Withdraw Function

function withdraw(uint256 lpTokensAmount, address recipient)
external returns (uint256 collateralOut)

Burns LP tokens and returns collateral adjusted for gains/losses from leveraged position.

Rate Functions

function getRate() external view returns (uint256 rate)
function getDiscountedRate() external view returns (
uint256 rate,
uint256 discountedRate,
uint256 maxCollateralDiscounted
)

Returns current exchange rates between collateral and LP tokens.

⚡ Integration with MultiLP Pool

Vaults act as sophisticated liquidity providers to the main MultiLP pool:

  • Position Management: Automatically manage LP positions with specified leverage
  • Fee Collection: Collect amplified trading fees from the pool
  • Yield Optimization: Deploy idle collateral to lending protocols for additional yield
  • Risk Management: Monitor overcollateralization ratios and liquidation thresholds

🎯 Risk Profiles

Conservative Vault (1x Leverage)

  • Risk: Low - No leverage amplification
  • Reward: Base pool fees + lending yield
  • Use Case: Stable yield generation with minimal risk

Moderate Vault (5x Leverage)

  • Risk: Medium - 5x amplified price exposure
  • Reward: 5x pool fees + leveraged lending yield
  • Use Case: Balanced risk/reward for experienced users

Aggressive Vault (20x Leverage)

  • Risk: High - 20x amplified price exposure
  • Reward: 20x pool fees + highly leveraged yield
  • Use Case: Maximum yield potential for risk-tolerant users

🛡️ Security Features

Access Control

  • Factory creation restricted to protocol deployer
  • Vault operations follow standard ERC-20 patterns
  • Emergency pause capabilities through Manager contract

Risk Management

  • Overcollateralization requirements prevent excessive leverage
  • Liquidation mechanisms protect against undercollateralization
  • Rate limits and slippage protection on large operations

Upgradability

  • Transparent proxy pattern allows for vault logic upgrades
  • Manager contract controls upgrade authority
  • Timelock mechanisms prevent immediate dangerous changes

📊 Events

Vault Operations

event Deposit(
address indexed sender,
address indexed recipient,
uint256 netCollateralDeposited,
uint256 lpTokensOut,
uint256 rate,
uint256 discountedRate
)

event Withdraw(
address indexed sender,
address indexed recipient,
uint256 lpTokensBurned,
uint256 netCollateralOut,
uint256 rate
)

event LPActivated(uint256 collateralAmount, uint128 overCollateralization)

🔗 Integration Examples

Depositing into 5x Vault

// Approve FDUSD spending
await fdusd.approve(vault5x.address, depositAmount);

// Deposit and receive LP tokens
const lpTokens = await vault5x.deposit(depositAmount, userAddress);

// Check current rate
const rate = await vault5x.getRate();

Withdrawing from Vault

// Check LP token balance
const lpBalance = await vault5x.balanceOf(userAddress);

// Withdraw all position
const collateralOut = await vault5x.withdraw(lpBalance, userAddress);

⚠️ Important Considerations

Liquidation Risk

Higher leverage vaults have increased liquidation risk during adverse price movements. Users should monitor positions closely.

Impermanent Loss

Vault positions are subject to amplified impermanent loss due to leveraged LP exposure.

Smart Contract Risk

While audited, vault contracts carry inherent smart contract risks. Users should understand the code before depositing significant amounts.


The Vault System represents an advanced DeFi primitive, providing sophisticated leveraged yield strategies while maintaining security and transparency through the Citadel Finance protocol.