The SolvBTC Program is a Solana-based implementation that combines vault management, minter management, and oracle functionality into a single program. It enables users to deposit tokens, mint yield-bearing derivatives, and withdraw funds with cryptographic verification.
The program consists of three main components:
Handles liquidity deposits, withdrawals, and token minting/burning with NAV-based pricing.
Controls mint authority and whitelist management for authorized minters.
Provides NAV (Net Asset Value) updates with signature verification for accurate pricing.
Initialize a new vault with admin, fee settings, and oracle configuration.
- Parameters:
admin,fee_receiver,treasurer,verifier(64-byte ECDSA public key),oracle_manager,nav,fee(basis points)
Deposit tokens to mint target tokens based on current NAV.
- Parameters:
amount,min_amount_out(slippage protection)
Create a withdrawal request that burns target tokens and records withdrawal intent.
- Parameters:
request_hash(32-byte unique identifier),amount(shares to burn)
Process a withdrawal request with cryptographic signature verification.
- Parameters:
hash(request hash),signature(64-byte ECDSA signature)
Transfer vault admin privileges to a new address.
Manage supported deposit currencies for the vault.
Set withdrawal fee in basis points (e.g., 50 = 0.5%).
Update the address that receives withdrawal fees.
Update the treasurer address for deposits.
Update the ECDSA public key used for withdrawal signature verification.
Update the NAV (Net Asset Value) of the vault. Must be >= 1 Bitcoin (100,000,000 base units).
Transfer oracle management privileges to a new address.
Initialize a minter manager for a specific vault.
Add or remove addresses from the authorized minters list (max 10 minters).
Mint tokens to a specified address (requires minter authorization).
Transfer minter manager admin privileges.
Withdrawals require cryptographic signatures from authorized verifiers, ensuring secure fund management.
All deposits and withdrawals are calculated based on the current Net Asset Value, providing fair pricing.
Vaults can accept deposits in multiple supported currencies.
Deposits include minimum output amount protection against price movements.
Configurable withdrawal fees with dedicated fee receiver addresses.
Withdrawal request accounts are resized and rent-refunded upon completion.
- All admin functions require proper authorization
- Withdrawal signatures are cryptographically verified
- NAV updates have minimum value validation (>= 1 Bitcoin)
- Account seeds prevent unauthorized access to user funds
- Slippage protection prevents sandwich attacks on deposits
The test suite covers:
- Complete vault lifecycle (initialize → deposit → withdraw request → withdraw)
- Admin function authorization and transfers
- Error conditions and edge cases
- Multi-vault scenarios
- Fee calculations and transfers
- Oracle NAV management
Run tests with: anchor test