# IKyberNetworkProxy

{% 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`**](https://docs.kyberswap.com/reference/legacy/kyberswap-elastic)
* [**`Limit Order`**](https://docs.kyberswap.com/kyberswap-solutions/limit-order)
* [**`Aggregator`**](https://docs.kyberswap.com/kyberswap-solutions/kyberswap-aggregator)
  {% endhint %}

## interface IKyberNetworkProxy

imports IERC20

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

***

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

\<AUTOGENERATED\_TABLE\_OF\_CONTENTS>

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

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

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

Event for logging execution of trades.

***

event **ExecuteTrade**(address trader, IERC20 src, IERC20 dest, address destAddress, uint256 actualSrcAmount, uint256 actualDestAmount, address platformWallet, uint256 platformFeeBps) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | `trader` | address | trader's/taker's address | | `src` | IERC20 | source ERC20 token contract address | | `dest` | IERC20 | destination ERC20 Token contract address | | `destAddress` | address | the address where the destAmount will be sent to | | `actualSrcAmount` | uint256 | source ERC20 token amount in wei | | `actualDestAmount` | uint256 | destination ERC20 token amount in wei | | `platformWallet` | address | address receiving the platform fee | | `platformFeeBps` | uint256 | platform fee in BPS used in this trade | Signature: 0xf724b4df6617473612b53d7f88ecc6ea983074b30960a049fcd0657ffe808083

\\

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

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

Executes a trade between src and dest token and send dest tokens to destAddress; platform fee is ignored and is pre-Katalyst/backwards compatible.

***

function **tradeWithHint**(ERC20 src, uint256 srcAmount, ERC20 dest, address payable destAddress, uint256 maxDestAmount, uint256 minConversionRate, address payable walletId, bytes hint) external payable returns (uint256) | Parameter | Type | Description | | ------------------- |:-------:|:--------------------------------------------------------------------:| | `src` | ERC20 | source ERC20 token contract address | | `srcAmount` | uint256 | source ERC20 token amount in its token decimals | | `dest` | ERC20 | 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 | | `walletId` | address | deprecated | | `hint` | bytes | hint in bytes for reserve routing | **Returns:**\ Amount of actual destination tokens in twei

\
\### \`tradeWithHintAndFee\` Executes a trade between src and dest token and send dest tokens to destAddress; includes the platform fee. \_\_\_ function \_\_tradeWithHintAndFee\_\_(IERC20 src, uint256 srcAmount, IERC20 dest, address payable destAddress, uint256 maxDestAmount, uint256 minConversionRate, address payable platformWallet, uint256 platformFeeBps, bytes hint) external returns (uint256 destAmount) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | \`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:\*\*\ destAmount - Amount of actual destination tokens in twei\
\### \`trade\` Executes a Best-of-All trade (no reserve routing) between src and dest token and send dest tokens to destAddress; platform fee is ignored and is pre-Katalyst/backwards compatible. \_\_\_ function \_\_trade\_\_(IERC20 src, uint256 srcAmount, IERC20 dest, address payable destAddress, uint256 maxDestAmount, uint256 minConversionRate, address payable platformWallet) external returns (uint256) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | \`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 | \*\*Returns:\*\*\ Amount of actual destination tokens in twei\
\### \`getExpectedRate\` Get the token conversion rate without platform fee; pre-Katalyst/backwards compatible. \_\_\_ function \_\_getExpectedRate\_\_(ERC20 src, contract ERC20 dest, uint256 srcQty) external returns (uint256 expectedRate, uint256 worstRate) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | \`src\` | ERC20 | source ERC20 token contract address | | \`dest\` | ERC20 | destination ERC20 token contract address | | \`srcQty\` | uint256 | source ERC20 token amount in its token decimals | \*\*Returns:\*\*\ expectedRate - conversion rate of the src and dest tokens after deducting the network fee. worstRate - 97% rate of the conversion rate, allowaing a 3% buffer for use in minConversionRate in trade.\
\### \`getExpectedRateAfterFee\` Get the token conversion rate after processing the hint and includes the platform fee. \_\_\_ function \_\_getExpectedRateAfterFee\_\_(IERC20 src, IERC20 dest, uint256 srcQty, uint256 platformFeeBps, bytes hint) external returns (uint256 expectedRate) | 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:\*\*\ expectedRate - conversion rate of the src and dest tokens after deducting the network and platform fee.
