Skip to main content
Version: Legacy

IKyberMatchingEngine

interface IKyberMatchingEngine

is IKyberReserve, IKyberNetwork, IKyberStorage\

Source: IKyberMatchingEngine.sol


INDEX

<AUTOGENERATED_TABLE_OF_CONTENTS>

REFERENCE

Functions

getNegligibleRateDiffBps

Returns the negligible rate difference in BPS.


function getNegligibleRateDiffBps() external view returns (uint256)\ Returns:\ The negligible rate difference in BPS.


### `getTradingReserves` Returns trading reserves info for a trade. ___ function __getTradingReserves__(IERC20 src, IERC20 dest, bool isTokenToToken, bytes hint) external returns (bytes32[] reserveIds, uint256[] splitValuesBps, ProcessWithRate processWithRate) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | `src` | IERC20 | source token address | | `dest` | IERC20 | destination token address | | `isTokenToToken` | bool | whether the trade is token -> token | | `hint` | bytes | encoded hint for reserve routing | **Returns:**\ reserveIds - array of 32-byte reserve IDs for the trade splitValuesBps - array of split values in BPS for the trade respective to reserveIds processWithRate - whether extra processing is required or not
### `doMatch` Returns the indexes of the best rate from the rates array for token -> eth or eth -> token trade. ___ function __doMatch__(IERC20 src, IERC20 dest, uint256[] srcAmounts, uint256[] feesAccountedDestBps, uint256[] rates) external view returns (uint256[] reserveIndexes) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | `src` | IERC20 | source token address | | `dest` | IERC20 | destination token address | | `srcAmounts` | uint256[] | array of srcAmounts after deducting fees: | | `feesAccountedDestBps` | uint256[] | fees charged in BPS, to be deducted from calculated destAmount | | `rates` | uint256[] | array of rates queried from reserves | **Returns:**\ reserveIndexes - array of the indexes most suited for the trade