Smart Contracts

TL;DR: Complete reference for all XCCY smart contracts — addresses, interfaces, and key functions.

Deployed Contracts (Polygon)

Contract
Address
Purpose

VAMMManager

0xe8FE9b71355B1701036671AD3c8F6dF585eb7eBd

Trading engine

CollateralEngine

0x23E2DD3bB6e35162eB48d473d540764d5902BAe5

Margin & positions

OracleHub

0x7a5084DEc5Fd89Ee1079005cE9cEa094c2A66E8E

Price feeds

AprOracle

0xA192144F89edC9fBB3D225856FaF284d9287EDb8

Yield rates

Tokens

Token
Address
Decimals

USDC

0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359

6

aUSDC (Aave)

0xA4D94019934D8333Ef880ABFFbF2FDd611C762BD

6


VAMMManager

The core trading engine for all XCCY pools.

Interface

interface IVAMMManager {
    // Pool Management
    function createPool(
        PoolKey memory key,
        IAprOracle aprOracle,
        uint160 sqrtPriceX96
    ) external returns (int24 tick, bytes32 poolId);
    
    function poolExists(PoolKey memory key) external view returns (bool exists);
    
    // Trading
    function swap(
        PoolKey memory key,
        SwapParams calldata params
    ) external returns (
        int256 fixedTokenDelta,
        int256 variableTokenDelta,
        uint256 cumulativeFeeIncurred,
        int256 fixedTokenDeltaUnbalanced,
        uint256 positionMarginRequirement
    );
    
    // Liquidity
    function mint(
        PoolKey memory key,
        AccountId calldata account,
        int24 tickLower,
        int24 tickUpper,
        uint128 amount
    ) external returns (uint256 positionMarginRequirement);
    
    function burn(
        PoolKey memory key,
        AccountId calldata account,
        int24 tickLower,
        int24 tickUpper,
        uint128 amount
    ) external returns (uint256 positionMarginRequirement);
    
    // View Functions
    function getVAMMState(bytes32 poolId) 
        external view returns (int24 tick, uint160 sqrtPriceX96);
    
    function computeGrowthInside(
        bytes32 poolId,
        int24 tickLower,
        int24 tickUpper
    ) external view returns (
        int256 fixedTokenGrowthInsideX128,
        int256 variableTokenGrowthInsideX128,
        uint256 feeGrowthInsideX128
    );
}

Data Structures

Events


CollateralEngine

Manages all margin, positions, and settlements.

Interface

Data Structures

Events


OracleHub

Provides USD price feeds for all supported assets.

Interface


AprOracle

Tracks Variable Yield rates for yield-bearing tokens.

Interface


ABIs

Minimal ABIs for Integration

Source Code

All contracts are open source:

Next Steps

  • API Reference — Detailed function documentation

  • Examples — Code examples

  • Integration Overview — Getting started guide

Last updated