Skip to main content

Module ITIPFeeAMM

Module ITIPFeeAMM 

Expand description

TIPFeeAMM interface defining the base AMM functionality for stablecoin pools. This interface provides core liquidity pool management and swap operations.

NOTE: The FeeManager contract inherits from TIPFeeAMM and shares the same storage layout. When FeeManager is deployed, it effectively “is” a TIPFeeAMM with additional fee management capabilities layered on top. Both contracts operate on the same storage slots.

interface ITIPFeeAMM {
    struct Pool { uint128 reserveUserToken; uint128 reserveValidatorToken; }
    struct PoolKey { address token0; address token1; }
    function M() external view returns (uint256);
    function N() external view returns (uint256);
    function SCALE() external view returns (uint256);
    function MIN_LIQUIDITY() external view returns (uint256);
    function getPoolId(address userToken, address validatorToken) external pure returns (bytes32);
    function getPool(address userToken, address validatorToken) external view returns (Pool memory);
    function pools(bytes32 poolId) external view returns (Pool memory);
    function mint(address userToken, address validatorToken, uint256 amountValidatorToken, address to) external returns (uint256 liquidity);
    function burn(address userToken, address validatorToken, uint256 liquidity, address to) external returns (uint256 amountUserToken, uint256 amountValidatorToken);
    function totalSupply(bytes32 poolId) external view returns (uint256);
    function liquidityBalances(bytes32 poolId, address user) external view returns (uint256);
    function rebalanceSwap(address userToken, address validatorToken, uint256 amountOut, address to) external returns (uint256 amountIn);
    event Mint(address sender, address indexed to, address indexed userToken, address indexed validatorToken, uint256 amountValidatorToken, uint256 liquidity);
    event Burn(address indexed sender, address indexed userToken, address indexed validatorToken, uint256 amountUserToken, uint256 amountValidatorToken, uint256 liquidity, address to);
    event RebalanceSwap(address indexed userToken, address indexed validatorToken, address indexed swapper, uint256 amountIn, uint256 amountOut);
    error IdenticalAddresses();
    error InvalidToken();
    error InsufficientLiquidity();
    error InsufficientReserves();
    error InvalidAmount();
    error DivisionByZero();
    error InvalidSwapCalculation();
}

Structs§

Burn
Event with signature Burn(address,address,address,uint256,uint256,uint256,address) and selector 0xa1306df62797fd30333308e15e2db0aed324580be7f22c124614a44310ec7fcc.
DivisionByZero
Custom error with signature DivisionByZero() and selector 0x23d359a3.
ITIPFeeAMMInstance
A ITIPFeeAMM instance.
IdenticalAddresses
Custom error with signature IdenticalAddresses() and selector 0xbd969eb0.
InsufficientLiquidity
Custom error with signature InsufficientLiquidity() and selector 0xbb55fd27.
InsufficientReserves
Custom error with signature InsufficientReserves() and selector 0x945e9268.
InvalidAmount
Custom error with signature InvalidAmount() and selector 0x2c5211c6.
InvalidSwapCalculation
Custom error with signature InvalidSwapCalculation() and selector 0x337e5a83.
InvalidToken
Custom error with signature InvalidToken() and selector 0xc1ab6dc1.
MCall
Function with signature M() and selector 0x693f917e.
MIN_LIQUIDITYCall
Function with signature MIN_LIQUIDITY() and selector 0x21b77d63.
MIN_LIQUIDITYReturn
Container type for the return parameters of the MIN_LIQUIDITY() function.
MReturn
Container type for the return parameters of the M() function.
Mint
Event with signature Mint(address,address,address,address,uint256,uint256) and selector 0xf114ca9eb82947af39f957fa726280fd3d5d81c3d7635a4aeb5c302962856eba.
NCall
Function with signature N() and selector 0xc9e525df.
NReturn
Container type for the return parameters of the N() function.
Pool
PoolKey
RebalanceSwap
Event with signature RebalanceSwap(address,address,address,uint256,uint256) and selector 0x1e9bc167ac8bc86f20f6d5c4c24338e554a9ae0f92faa67d1e2f59fe4a89c97f.
SCALECall
Function with signature SCALE() and selector 0xeced5526.
SCALEReturn
Container type for the return parameters of the SCALE() function.
burnCall
Function with signature burn(address,address,uint256,address) and selector 0xfa291e53.
burnReturn
Container type for the return parameters of the burn(address,address,uint256,address) function.
getPoolCall
Function with signature getPool(address,address) and selector 0x531aa03e.
getPoolIdCall
Function with signature getPoolId(address,address) and selector 0x2ef61c21.
getPoolIdReturn
Container type for the return parameters of the getPoolId(address,address) function.
getPoolReturn
Container type for the return parameters of the getPool(address,address) function.
liquidityBalancesCall
Function with signature liquidityBalances(bytes32,address) and selector 0x4fb5bf7f.
liquidityBalancesReturn
Container type for the return parameters of the liquidityBalances(bytes32,address) function.
mintCall
Function with signature mint(address,address,uint256,address) and selector 0xf1aa8cb8.
mintReturn
Container type for the return parameters of the mint(address,address,uint256,address) function.
poolsCall
Function with signature pools(bytes32) and selector 0xb5217bb4.
poolsReturn
Container type for the return parameters of the pools(bytes32) function.
rebalanceSwapCall
Function with signature rebalanceSwap(address,address,uint256,address) and selector 0x1bd94ac7.
rebalanceSwapReturn
Container type for the return parameters of the rebalanceSwap(address,address,uint256,address) function.
totalSupplyCall
Function with signature totalSupply(bytes32) and selector 0xb524abcf.
totalSupplyReturn
Container type for the return parameters of the totalSupply(bytes32) function.

Enums§

ITIPFeeAMMCalls
Container for all the ITIPFeeAMM function calls.
ITIPFeeAMMErrors
Container for all the ITIPFeeAMM custom errors.
ITIPFeeAMMEvents
Container for all the ITIPFeeAMM events.

Functions§

new
Creates a new wrapper around an on-chain ITIPFeeAMM contract instance.