Skip to main content

ISaddleSwap

Functions

getA

function getA() external returns (uint256)

getToken

function getToken(
uint8 index
) external returns (contract IERC20)

Parameters

NameTypeDescription
indexuint8

getTokenIndex

function getTokenIndex(
address tokenAddress
) external returns (uint8)

Parameters

NameTypeDescription
tokenAddressaddress

getTokenBalance

function getTokenBalance(
uint8 index
) external returns (uint256)

Parameters

NameTypeDescription
indexuint8

getVirtualPrice

function getVirtualPrice() external returns (uint256)

calculateSwap

function calculateSwap(
uint8 tokenIndexFrom,
uint8 tokenIndexTo,
uint256 dx
) external returns (uint256)

Parameters

NameTypeDescription
tokenIndexFromuint8
tokenIndexTouint8
dxuint256

calculateTokenAmount

function calculateTokenAmount(
uint256[] amounts,
bool deposit
) external returns (uint256)

Parameters

NameTypeDescription
amountsuint256[]
depositbool

calculateRemoveLiquidity

function calculateRemoveLiquidity(
uint256 amount
) external returns (uint256[])

Parameters

NameTypeDescription
amountuint256

calculateRemoveLiquidityOneToken

function calculateRemoveLiquidityOneToken(
uint256 tokenAmount,
uint8 tokenIndex
) external returns (uint256 availableTokenAmount)

Parameters

NameTypeDescription
tokenAmountuint256
tokenIndexuint8

swap

function swap(
uint8 tokenIndexFrom,
uint8 tokenIndexTo,
uint256 dx,
uint256 minDy,
uint256 deadline
) external returns (uint256)

Parameters

NameTypeDescription
tokenIndexFromuint8
tokenIndexTouint8
dxuint256
minDyuint256
deadlineuint256

addLiquidity

function addLiquidity(
uint256[] amounts,
uint256 minToMint,
uint256 deadline
) external returns (uint256)

Parameters

NameTypeDescription
amountsuint256[]
minToMintuint256
deadlineuint256

removeLiquidity

function removeLiquidity(
uint256 amount,
uint256[] minAmounts,
uint256 deadline
) external returns (uint256[])

Parameters

NameTypeDescription
amountuint256
minAmountsuint256[]
deadlineuint256

removeLiquidityOneToken

function removeLiquidityOneToken(
uint256 tokenAmount,
uint8 tokenIndex,
uint256 minAmount,
uint256 deadline
) external returns (uint256)

Parameters

NameTypeDescription
tokenAmountuint256
tokenIndexuint8
minAmountuint256
deadlineuint256