Contracts
This is the list of contracts on the Avalance Fuji Testnet and the Sepolia Blockchain
Avalance Fuji Testnet
Perps.solMain perpetual futures contract handling:
Position management (open/close with leverage)
USDC collateral deposits/withdrawals
Automated liquidations with VRF randomization
Risk management and user limits
Key Functions:
function depositUSDC(uint256 usdcAmount) function openPosition(string symbol, uint256 collateralUSDC, uint256 leverage, bool isLong) function closePosition(string symbol) function liquidatePositions() returns (uint256 liquidated)CONTRACT_ADDRESS_AVAX=0x9d2b2005ec13fb8a7191b0df208dfbd541827c19PerpsCalculations.solRisk calculation engine:
P&L calculations for long/short positions
Liquidation price computation
Margin ratio monitoring
Position health checks
PERPS_CALCULATIONS_CONTRACT_ADDRESS : 0xb6fc2a81fc5803a1e5a855e69cdad79eae9a91bcPerpsFeeManager.solFee structure management:
Opening fee: 1% of collateral
Closing fee: 1% of collateral
Holding fee: 1% daily on collateral
Profit tax: 30% on realized gains
PERPS_FEE_MANAGER_CONTRACT_ADDRESS : 0x117d284f89fe797a65145e67cc31e21dbbf60cdcPoolManager.sol
Multi-token deposit handler:
Accepts AVAX, LINK, and USDC deposits
Converts tokens to USDC using Chainlink price feeds
Forwards converted USDC to Perps contract
Handles both direct deposits and cross-chain CCIP messages
PRICE_ORACLE
Supplies real-time price feeds for all supported trading assets.
Chainlink price feed aggregator:
Supports BTC/USD, ETH/USD, AVAX/USD, LINK/USD
Normalizes all prices to 8 decimals
Real-time price data for position calculations
Sepolia Testnet
Uses Chainlink CCIP to bridge assets from Sepolia to Avalanche
Deposits USDC on behalf of users into the main Perps contract on Avalanche Fuji
Automation & Randomizer
VRFRandomizer.solChainlink VRF integration for fair liquidation ordering:
Generates verifiable randomness
Shuffles user arrays to prevent liquidation front-running
Auto-refreshes randomness every 6 hours
TimeLiquidationAutomation.sol&LogLiquidationAutomation.solChainlink AutomationTimeLiquidationAutomation.sol&LogLiquidationAutomation.solTime-based: Triggers liquidations every 4 hours
Log-based: Triggers on position events for immediate liquidation checks
Addresses:
Time-based:
0x636f1b91cfd7b91a4f7fb01e52a5df5d818a6060Log-based:
0xaa3ffc9a984d4fcac150a9d5f2b3ce004234b471
VRFAutomation.solAutomation contract for VRF randomness refresh:
Automatically calls
requestRandomWords()every 6 hoursEnsures liquidation fairness is maintained
Keeps VRF randomization up to date
Last updated