ConversionRatesInterface
Last updated
Was this helpful?
Last updated
Was this helpful?
You are referring to the Legacy
version of KyberSwap docs.
For the most updated information, please refer to:
Source:
<AUTOGENERATED_TABLE_OF_CONTENTS>
getRate
Gets the conversion rate of the ERC20 token depending on quantity at block height
function getRate(ERC20 token, uint currentBlockNumber, bool buy, uint qty) public view returns (uint) | Parameter | Type | Description | | -------------------- |:-----:|:------------------------------------------------------------------:| | token
| ERC20 | ERC20 token contract address | | currentBlockNumber
| uint | current block height or block number | | buy
| bool | true
if action is to buy, otherwise false
if action is to sell | | qty
| uint | wei amount of ERC20 tokens | Returns:\ Conversion rate of ERC20 token depending on quantity at block height\
Records the wei amount of net absolute (+/-) change for a token in a block
function recordImbalance(ERC20 token, int buyAmount, uint rateUpdateBlock, uint currentBlock) public | Parameter | Type | Description | | ----------------- |:-----:|:------------------------------------:| | token
| ERC20 | ERC20 token contract address | | buyAmount
| int | buy amount of ERC20 tokens in wei | | rateUpdateBlock
| uint | NOT SURE | | currentBlock
| uint | current block height or block number |