Skip to content

Latest commit

 

History

History
40 lines (24 loc) · 3.34 KB

File metadata and controls

40 lines (24 loc) · 3.34 KB

IKyberMatchingEngine

{% hint style="warning" %} You are referring to the Legacy version of KyberSwap docs.

For the most updated information, please refer to:

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