# IKyberNetwork

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

For the most updated information, please refer to:

* [**`Classic`**](https://github.com/KyberNetwork/kyberswap-documentation/blob/main/reference/legacy/api-abi/core-smart-contracts/broken-reference/README.md)
* [**`Elastic`**](/reference/legacy/kyberswap-elastic.md)
* [**`Limit Order`**](/kyberswap-solutions/limit-order.md)
* [**`Aggregator`**](/kyberswap-solutions/kyberswap-aggregator.md)
  {% endhint %}

## interface IKyberNetwork

imports IERC20

*Source*: [IKyberNetwork.sol](https://github.com/KyberNetwork/smart-contracts/blob/master/contracts/sol6/IKyberNetwork.sol)

***

### INDEX[​](https://docs.kyberswap.com/Legacy/api-abi/core-smart-contracts/api_abi-ikybernetwork#index) <a href="#index" id="index"></a>

\<AUTOGENERATED\_TABLE\_OF\_CONTENTS>

### REFERENCE[​](https://docs.kyberswap.com/Legacy/api-abi/core-smart-contracts/api_abi-ikybernetwork#reference) <a href="#reference" id="reference"></a>

#### Events[​](https://docs.kyberswap.com/Legacy/api-abi/core-smart-contracts/api_abi-ikybernetwork#events) <a href="#events" id="events"></a>

#### `KyberTrade`[​](https://docs.kyberswap.com/Legacy/api-abi/core-smart-contracts/api_abi-ikybernetwork#kybertrade) <a href="#kybertrade" id="kybertrade"></a>

Event for logging execution of trades.

***

event **KyberTrade**(IERC20 src, IERC20 dest, uint256 ethWeiValue, uint256 networkFeeWei, uint256 customPlatformFeeWei, bytes32\[] t2eIds, bytes32\[] e2tIds, uint256\[] t2eSrcAmounts, uint256\[] e2tSrcAmounts, uint256\[] t2eRates, uint256\[] e2tRates) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | `src` | IERC20 | source token address | | `dest` | IERC20 | destination token address | | `ethWeiValue` | uint256 | Ether wei value of the trade | | `networkFeeWei` | uint256 | network fee charged in wei | | `customPlatformFeeWei` | uint256 | platform fee charged in wei | | `t2eIds` | bytes32\[] | the reserve IDs used in the token to eth trade portion | | `e2tIds` | bytes32\[] | the reserve IDs used in the eth to token trade portion | | `t2eSrcAmounts` | uint256\[] | the source smounts used in the token to eth trade portion | | `e2tSrcAmounts` | uint256\[] | the source smounts used in the eth to token trade portion | | `t2eRates` | uint256\[] | the rates used in the token to eth trade portionn | | `e2tRates` | uint256\[] | the source smounts used in the eth to token trade portion | Signature: 0x30bbea603a7b36858fe5e3ec6ba5ff59dde039d02120d758eacfaed01520577d

\\

#### Functions[​](https://docs.kyberswap.com/Legacy/api-abi/core-smart-contracts/api_abi-ikybernetwork#functions) <a href="#functions" id="functions"></a>

#### `tradeWithHintAndFee`[​](https://docs.kyberswap.com/Legacy/api-abi/core-smart-contracts/api_abi-ikybernetwork#tradewithhintandfee) <a href="#tradewithhintandfee" id="tradewithhintandfee"></a>

Executes a trade between src and dest token and send dest tokens to destAddress; includes the platform fee.

***

function **tradeWithHintAndFee**(address payable trader, IERC20 src, uint256 srcAmount, IERC20 dest, address payable destAddress, uint256 maxDestAmount, uint256 minConversionRate, address payable platformWallet, uint256 platformFeeBps, bytes hint) external payable returns (uint256 destAmount) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | `trader` | address | trader's address | | `src` | IERC20 | source ERC20 token contract address | | `srcAmount` | uint256 | source ERC20 token amount in its token decimals | | `dest` | IERC20 | destination ERC20 token contract address | | `destAddress` | address | recipient address for destination ERC20 token | | `maxDestAmount` | uint256 | limit on the amount of destination tokens | | `minConversionRate` | uint256 | minimum conversion rate; trade is canceled if actual rate is lower | | `platformWallet` | address | address receiving the platform fee | | `platformFeeBps` | uint256 | platform fee in BPS to be used in this trade | | `hint` | bytes | hint in bytes for reserve routing | **Returns:**\ Amount of actual destination tokens in twei

\\

#### `enabled`[​](https://docs.kyberswap.com/Legacy/api-abi/core-smart-contracts/api_abi-ikybernetwork#enabled) <a href="#enabled" id="enabled"></a>

Returns a boolean determining if trading is enabled on the network.

***

function **enabled**() external view returns (bool)\ **Returns:**\ Returns `true` if the network is enabled for trading, otherwise `false`.

\
\### \`getExpectedRateWithHintAndFee\` Get the token conversion rate after processing the hint and includes the platform fee. \_\_\_ function \_\_getExpectedRateWithHintAndFee\_\_(IERC20 src, IERC20 dest, uint256 srcQty, uint256 platformFeeBps, bytes hint) external view returns (uint256 expectedRateAfterNetworkFee, uint256 expectedRateAfterAllFees) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | \`src\` | IERC20 | source ERC20 token contract address | | \`dest\` | IERC20 | destination ERC20 token contract address | | \`srcQty\` | uint256 | source ERC20 token amount in its token decimals | | \`platformFeeBps\` | uint256 | platform fee in BPS | | \`hint\` | bytes | hint in bytes for reserve routing | \*\*Returns:\*\*\ expectedRateAfterNetworkFee - conversion rate of the src and dest tokens after deducting the network fee. expectedRateAfterAllFees - conversion rate of the src and dest tokens after deducting the network and platform fee.\
\### \`getNetworkData\` Returns basic network data. \_\_\_ function \_\_getNetworkData\_\_() external view returns (uint256 negligibleDiffBps, uint256 networkFeeBps, uint256 expiryTimestamp)\ \*\*Returns:\*\*\ negligibleDiffBps - neglibigle difference in BPS networkFeeBps - network fees in BPS expiryTimestamp - expiry timestamp in epoch time when the network fees will expire and need to be updated\
\### \`maxGasPrice\` Returns the maximum gas price limit to prevent front running. \_\_\_ function \_\_maxGasPrice\_\_() external view returns (uint256)\ \*\*Returns:\*\*\ The maximum gas price limit


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kyberswap.com/reference/legacy/api-abi/core-smart-contracts/ikybernetwork.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
