Skip to content

UltrasoundProtocol/contracts

Repository files navigation

Balanced Vault Contracts

Generic 50/50 balanced vault system with automated rebalancing.

Setup

# Install dependencies
forge install

# Build
forge build

# Test
forge test

What's Here

  • BalancedVault - Generic vault for any two-asset 50/50 strategy
  • Modular architecture - Swappable oracle, rebalancer, and fee collector modules
  • Guardian sunset - Progressive decentralization over 6 months
  • OpenZeppelin security standards
  • Comprehensive test suite (96%+ coverage)
  • CI/CD with automated Slither analysis

Scripts

# 1. Start Anvil fork
anvil --fork-url $MAINNET_RPC_URL

# 2. Deploy contracts (new terminal)
bash ./script/fork/deploy-fork.sh

# 3. Load addresses
source .env.fork

# 4. Check vault info
bash ./script/fork/info.sh $VAULT_ADDRESS

# 5. Deposit 1000 USDC
bash ./script/fork/deposit.sh $VAULT_ADDRESS 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 1000000000

# 6. Check vault after deposit
bash ./script/fork/info.sh $VAULT_ADDRESS

# 7. Create price drift (pump PAXG)
bash ./script/fork/drift.sh $VAULT_ADDRESS paxg

# 8. Check if rebalance needed
bash ./script/fork/info.sh $VAULT_ADDRESS

# 9. Trigger rebalance (if needed)
cast send $VAULT_ADDRESS "rebalance()" \
  --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \
  --rpc-url http://localhost:8545

# 10. Verify rebalance worked
bash ./script/fork/info.sh $VAULT_ADDRESS

Status

Core architecture complete. Module implementations in progress.

About

Ultrasound smart contracts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors