Skip to content

IteraLabs/vaulted

Repository files navigation

Overview

USDv is a fully-collateralized stablecoin pegged 1:1 to USDc on the Solana blockchain. This document outlines the technical architecture, security model, and operational procedures.

System Components

1. Core Program (programs/usdv-program)

The main Solana program implementing the stablecoin logic:

  • Program State: Global configuration and statistics
  • Vault Authority (PDA): Controls USDc vault and USDv mint authority
  • Instructions: Initialize, deposit_and_mint, burn_and_withdraw, update_program_state

2. Client Library (programs/usdv-client)

Rust client library for interacting with the program:

  • USDvClient: Main client interface
  • Configuration: Network-specific settings
  • Error Handling: Comprehensive error types
  • Async Support: Tokio-based async operations

3. Utilities (programs/usdv-utils)

Shared utilities and helper functions:

  • Math Operations: Safe arithmetic with overflow protection
  • PDA Derivation: Address generation utilities
  • Validation: Input sanitization and validation
  • Constants: Program-wide configuration values

Architecture Diagram

┌─────────────────────────────────────────────────────────────┐
│                    USDv Stablecoin System                   │
└─────────────────────────────────────────────────────────────┘
                                │
                                ▼
┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   User Client   │───▶│  USDv Program   │───▶│  Solana Runtime │
│                 │    │   (On-chain)    │    │                 │
└─────────────────┘    └─────────────────┘    └─────────────────┘
         │                      │                      │
         ▼                      ▼                      ▼
┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│  usdv-client    │    │ Program State   │    │ SPL Token       │
│ (Rust Library)  │    │ Vault Authority │    │ Program         │
└─────────────────┘    │ USDc Vault      │    └─────────────────┘
         │             │ USDv Mint       │             │
         ▼             └─────────────────┘             ▼
┌─────────────────┐             │              ┌─────────────────┐
│  usdv-utils     │             ▼              │ Associated      │
│ (Shared Utils)  │    ┌─────────────────┐     │ Token Accounts  │
└─────────────────┘    │ Token Accounts  │     └─────────────────┘
                       │ - User USDc     │
                       │ - User USDv     │
                       │ - Vault USDc    │
                       └─────────────────┘

Security Model

1. Collateralization

  • 1:1 Backing: Every USDv token is backed by exactly 1 USDc
  • Vault Custody: All USDc held in PDA-controlled vault
  • No Fractional Reserve: System maintains full reserves at all times

2. Access Controls

  • Admin Authority: Limited to parameter updates only
  • User-Only Burns: Only token holders can burn their USDv
  • PDA Security: Vault controlled by program-derived address

3. Validation & Safety

  • Input Validation: Comprehensive amount and account validation
  • Overflow Protection: Safe arithmetic operations throughout
  • Constraint Checking: Anchor framework constraint validation

Data Flow

Deposit Flow

  1. User initiates deposit with USDc amount
  2. Program validates amount and user balance
  3. USDc transferred from user to vault
  4. Equivalent USDv minted to user
  5. Program state updated (supply counters)

Withdraw Flow

  1. User initiates burn with USDv amount
  2. Program validates amount and user balance
  3. USDv burned from user account
  4. Equivalent USDc transferred from vault to user
  5. Program state updated (supply counters)

Key Design Decisions

1. Direct Collateralization

  • Rationale: Eliminates algorithmic complexity and peg risk
  • Trade-off: Requires full USDc backing but ensures stability
  • Implementation: 1:1 deposit/withdraw mechanism

2. PDA Vault Authority

  • Rationale: Eliminates private key risk for vault control
  • Implementation: Deterministic address derivation
  • Security: Only program can sign for vault operations

3. User-Controlled Burns

  • Rationale: Prevents programmatic draining of user funds
  • Implementation: Only token holder can initiate burn
  • Protection: No emergency withdraw functions

Operational Procedures

Initialization

  1. Deploy program to target network
  2. Generate program keypairs and PDAs
  3. Initialize program state with admin and USDc mint
  4. Verify deployment and configuration

Monitoring

  • Supply Tracking: Monitor total USDv supply vs USDc deposits
  • Vault Balance: Ensure vault maintains adequate USDc
  • Transaction Volume: Track deposit/withdraw activity
  • Error Rates: Monitor failed transactions and causes

Upgrades

  • Program Updates: Controlled by admin authority
  • Parameter Changes: Limited to configuration updates
  • Emergency Procedures: Documented incident response

Performance Characteristics

Transaction Costs

  • Deposit: ~0.002 SOL (account creation + transaction)
  • Withdraw: ~0.0005 SOL (standard transaction)
  • Gas Efficiency: Optimized instruction set

Throughput

  • Network Limit: Bound by Solana's 65k TPS theoretical limit
  • Program Limit: No artificial throughput restrictions
  • Scalability: Horizontal scaling through multiple instances

Future Enhancements

Phase 2: Advanced Features

  • Multi-signature Admin: Enhanced admin controls
  • Fee Mechanisms: Optional fee collection for sustainability
  • Oracle Integration: Price feed monitoring
  • Cross-chain Bridge: Multi-chain USDc support

Phase 3: DeFi Integration

  • Lending Protocols: USDv as collateral
  • DEX Integration: Trading pair liquidity
  • Yield Farming: Staking and reward mechanisms
  • Governance: Decentralized parameter control

About

USDv is a stable coin pegged to vaulted USDc

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published