Utils
This contract can check asset details and swap estimates of KLAYswap service
Address
Read-Only Functions
getPoolData
Amount of TokenA held by LP
Airdrop only between startBlock and endBlock of blocks in the network
Parameters
miningRate
: KSP distribution ratio numerator valuerateDecimals
: KSP distribution ratio denominator예) Daily KSP distribution ratio
miningRate - 130323276365080043, rateDecimals - 10000000000000000
130323276365080043 / 10000000000000000 = 13.03...%
tokenA
: LP tokenAreserveA
: Amount of tokenA held by LPtokenB
: LP tokenBreserveB
: Amount of tokenB held by LPairdropCount
: Number of airdrop plans in progress at LPairdropTokens
: Airdrop token address arrayairdropSettings
: Airdrop info array[0]: blockAmount, [1]: startBlock, [2]: endBlock
airdropSettings
Data format예) TokenA, TokenB Airdrop
airdropTokens = [ TokenA address, TokenB address]
airdropSettings = [ TokenA blockAmount, TokenA startBlock, TokenA endBlock, TokenB blockAmount, TokenB startBlock, TokenB endBlock ]
getPendingReward
User's claimable reward information
Parameters
kspReward
: Claimable KSPairdropCount
: Number of airdrop plans the LP hasairdropTokens
: Airdrop token address arrayairdropRewards
: Arrangement of Airdrop token amount Information claimable
airdrop
data format예) TokenA, TokenB Airdrop
airdropTokens = [ TokenA address, TokenB address]
airdropSettings = [ TokenA reward, TokenB reward ]
estimateSwap
KLAYswap swap estimate lookup function
Input Parameters
tokenIn
: Token address to be exchangedtokenOut
: Token address to receiveamountIn
: Token amount to be exchangedpath
: exchange route
example
KLAY -> KSP
tokenIn = KLAY token address
tokenOut = KSP token address
amountIn = 1e18 ( = 1 KLAY )
path = []
KLAY -> ORC -> KSP
tokenIn = KLAY token address
tokenOut = KSP token address
amountIn = 1e18 ( = 1 KLAY )
path = ["{ORC token Address}"]
Last updated