Contract Events
You are referring to the Legacy
version of KyberSwap docs.
For the most updated information, please refer to:
Introduction
Ethereum allows smart contracts to emit events during the execution of a function. Your application can track these events to find information such as trades, platform fees, reserve rebates, KNC burnt etc.
Using these events, you will be able to calculate other important information such as overall volume, volume per token, volume per reserve, and more. Our in-house built tracker uses the events emitted to track these statistics.
Volume and Trade Events
The ExecuteTrade
event is emitted by the KyberNetworkProxy contracts.
The KyberTrade
event is emitted by the KyberNetwork contracts.
Fee Tracking Events
The following events are emitted by the KyberFeeHandler contract(s).
Events to track Fed Price Reserve (FPR) and Automated Price Reserve (APR) statistics
These events are emitted by the FPRs and APRs.
Historical Events
These events are no longer emitted, but remain documented.
Contract Address: 0x9AAb3f75489902f3a48495025729a0AF77d4b11e Source: KyberNetworkProxy.sol
ExecuteTrade (V2)
ExecuteTrade (V2)
Event is emitted when a trade is executed.
event ExecuteTrade(address indexed trader, IERC20 src, IERC20 dest, address destAddress, uint256 actualSrcAmount, uint256 actualDestAmount, address platformWallet, uint256 platformFeeBps)
Parameter | Type | Indexed | Description |
---|---|---|---|
| address | YES | trader's address |
trader's address | IERC20 | NO | source ERC20 token contract address |
| IERC20 | NO | destination ERC20 token contract address |
| address | NO | destination address for receiving |
| uint256 | NO |
|
| address | NO | wallet address receiving trade fees |
| uint256 | NO | platform fee percentage (in basis points) of trade |
Event Signature: 0xf724b4df6617473612b53d7f88ecc6ea983074b30960a049fcd0657ffe808083
Contract Address: 0x818E6FECD516Ecc3849DAf6845e3EC868087B755 Source: KyberNetworkProxy.sol
ExecuteTrade (V1)
ExecuteTrade (V1)
Event is emitted when a trade is executed.
event ExecuteTrade(address indexed sender, ERC20 src, ERC20 dest, uint actualSrcAmount, uint actualDestAmount)
Parameter | Type | Indexed | Description |
---|---|---|---|
| address | YES | sender's address |
| ERC20 | NO | source ERC20 token contract address |
| ERC20 | NO | destination ERC20 Token contract address |
| uint | uint | source ERC20 token amount in wei |
| uint | NO | destination ERC20 token amount in wei |
Event Signature: 0x1849bd6a030a1bca28b83437fd3de96f3d27a5d172fa7e9c78e7b61468928a39
Contract Address: 0x7C66550C9c730B6fdd4C03bc2e73c5462c5F7ACC Source: KyberNetwork.sol
KyberTrade (V2)
KyberTrade (V2)
Emitted when a trade is executed in the internal network.
event KyberTrade(IERC20 indexed src, ERC20 indexed dest, uint256 ethWeiValue, uint256 networkFeeWei, uint256 customPlatformFeeWei, bytes32[] t2eIds, bytes32[] e2tIds, uint256[] t2eSrcAmounts, uint256[] e2tSrcAmounts, uint256[] t2eRates, uint256[] e2tRates)
Parameter | Type | Indexed | Description |
---|---|---|---|
| ERC20 | YES | source ERC20 token contract address |
| ERC20 | YES | destination ERC20 token contract address |
| uint256 | NO | ether wei value of the trade |
| uint256 | NO | network fee in ether wei |
| uint256 | NO | platform fee in ether wei |
| bytes32[] | NO | token -> ether reserve IDs used for the trade |
| bytes32[] | NO | Ether to token reserve IDs used for the trade |
| uint256[] | NO | token -> ether source amounts in source token wei |
| uint256[] | NO | Ether to token source amounts in destination token wei |
| uint256[] | NO | token -> ether rates used for the trade |
| uint256[] | NO | Ether to token rates used for the trade |
Event Signature: 0xc6efb0df0b5d684cd6482e00270d068229ca5833634798e25f85b79eee5183f9
Note
For token to token trades, the
ethWeiValue
will be just 1 side of the trade. As an example, X KNC -> 10 ETH -> Y DAI yieldsethWeiValue = 10e18
.
Contract Address: 0xd3d2b5643e506c6d9B7099E9116D7aAa941114fe Source: KyberFeeHandler.sol
FeeDistributed
FeeDistributed
Emitted when there are fees to be given to various parties, based on the BRR distribution determined by the KyberDAO.
event FeeDistributed(IERC20 indexed token, address indexed platformWallet, uint256 platformFeeWei, uint256 rewardWei, uint256 rebateWei, address[] rebateWallets, uint256[] rebatePercentBpsPerWallet, uint256 burnAmtWei)
Parameter | Type | Indexed | Description |
---|---|---|---|
| IERC20 | YES | token for which fees will be distributed in |
| address | YES | Wallet address that gets fees from the trade |
| uint256 | NO | Platform fee in |
| uint256 | NO | KNC stakers' rewards in |
| uint256 | NO | Reserve rebates in |
| address[] | NO | List of rebate wallet addresses receiving rebates |
| uint256[] | NO | Corresponding rebate proportions in basis points |
| uint256 | NO |
|
Event Signature: 0xd66a6cfa04148d5e34fd3da6bbabc8a7e6c9ebffb1638f00e9c35d67b51c6bd2
BRRUpdated
BRRUpdated
Emitted when there is a change made to the BRR distribution, as determined by the KyberDAO.
event BRRUpdated(uint256 rewardBps, uint256 rebateBps, uint256 burnBps, uint256 expiryTimestamp, uint256 indexed epoch)
Parameter | Type | Indexed | Description |
---|---|---|---|
| uint256 | NO | proportion (in basis points) of network fee allocated to staker rewards |
| uint256 | NO | proportion (in basis points) of network fee allocated to reserve rebates |
| uint256 | NO | proportion (in basis points) of network fee allocated to burning KNC |
| uint256 | NO | timestamp after which this BRR configuration will be invalid |
| uint256 | YES | current epoch number |
Event Signature: 0x90da252e8e1873b40c0a15bba09620de70b1550bcd36e796175beb6f259c797d
KNCBurned
KNCBurned
Emitted when KNC has been burnt.
event KncBurned(uint256 kncTWei, IERC20 indexed token, uint256 amount)
Parameter | Type | Indexed | Description |
---|---|---|---|
| uint256 | NO | KNC burnt amont in KNC token wei |
| IERC20 | YES | token for which KNC was converted from |
| uint256 | NO |
|
Event Signature: 0xd66a6cfa04148d5e34fd3da6bbabc8a7e6c9ebffb1638f00e9c35d67b51c6bd2
RewardsRemovedToBurn
RewardsRemovedToBurn
Emitted when an entire epoch's reward has been allocated for burning KNC (Eg. epoch 0).
event RewardsRemovedToBurn(uint256 indexed epoch, uint256 rewardsWei)
Parameter | Type | Indexed | Description |
---|---|---|---|
| uint256 | YES | epoch number for which rewards are entirely for burning KNC |
| uint256 | NO | ether wei amount allocated for burning KNC |
Event Signature: 0x11c852d8be537f120b8d4b4d5c3c211870522fd96a8bd9fa51d102774077a51b
Contract Address: 0x63825c174ab367968EC60f061753D3bbD36A0D8F Other Reserves: Visit our tracker to see other reserve addresses. Source: KyberReserve.sol
DepositToken
DepositToken
Event is emitted when the contract receives the token deposit.
event DepositToken(ERC20 token, uint amount)
Parameter | Type | Indexed | Description |
---|---|---|---|
| ERC20 | NO | ERC20 token contract address |
| uint | NO | ERC20 token amount in wei |
Event Signature: 0x2d0c0a8842b9944ece1495eb61121621b5e36bd6af3bba0318c695f525aef79f
TradeEnabled
TradeEnabled
Event is emitted when trading is enabled for the reserve.
event TradeEnabled(bool enable)
Parameter | Type | Indexed | Description |
---|---|---|---|
| bool | NO |
|
Event Signature: 0x7d7f00509dd73ac4449f698ae75ccc797895eff5fa9d446d3df387598a26e735
TradeExecute
TradeExecute
Event is emitted when the reserve has executed a trade.
event TradeExecute(address indexed origin, address src, uint srcAmount, address destToken, uint destAmount, address destAddress)
Parameter | Type | Indexed | Description |
---|---|---|---|
| address | YES | sender's address |
| address | NO | source ERC20 token contract address |
| uint | NO | wei amount of source ERC20 tokens |
|
| NO | destination ERC20 token contract address |
| uint | NO | wei amount of destination ERC20 tokens |
| address | NO | recipient address for destination ERC20 tokens |
Event Signature: 0xea9415385bae08fe9f6dc457b02577166790cde83bb18cc340aac6cb81b824de
WithdrawFunds
WithdrawFunds
Event is emitted with funds are withdrawn from the reserve.
event WithdrawFunds(ERC20 token, uint amount, address destination)
Parameter | Type | Indexed | Description |
---|---|---|---|
| ERC20 | NO | ERC20 token contract address |
| uint | NO | wei amount of tokens that was withdrawn |
| address | NO | recipient address of withdrawn funds |
Event Signature: 0xb67719fc33c1f17d31bf3a698690d62066b1e0bae28fcd3c56cf2c015c2863d6
KyberNetwork (Old)
Past Contract Addresses: v4 - 0x65bF64Ff5f51272f729BDcD7AcFB00677ced86Cd v3 - 0x9ae49C0d7F8F9EF4B864e004FE86Ac8294E20950 v2 - 0x91a502C678605fbCe581eae053319747482276b9 v1 - 0x964F35fAe36d75B1e72770e244F6595B68508CF5
KyberTrade (V1)
KyberTrade (V1)
Emitted when a trade is executed in the internal network.
event KyberTrade(address indexed trader, ERC20 src, ERC20 dest, uint srcAmount, uint dstAmount, address destAddress, uint ethWeiValue, address reserve1, address reserve2, bytes hint)
Parameter | Type | Indexed | Description |
---|---|---|---|
| address | YES | trader's address |
| ERC20 | NO | source ERC20 token contract address |
| ERC20 | NO | destination ERC20 token contract address |
| uint | NO | source ERC20 token amount |
| uint | NO | destination ERC20 token amount |
| ERC20 | NO | recipient address for destination ERC20 token |
| uint | NO | Ether wei value of the trade |
| address | NO | address of reserve selected for source token -> ether trade |
| address | NO | address of reserve selected for source ether -> token trade |
| bytes | NO | used to determine if permissionless reserves are to be used |
Event Signature: 0xd30ca399cb43507ecec6a629a35cf45eb98cda550c27696dcb0d8c4a3873ce6c
FeeBurner
Past Contract Addresses: v4 - 0x8007aa43792A392b221DC091bdb2191E5fF626d1 v3 - 0x52166528FCC12681aF996e409Ee3a421a4e128A3 v2 - 0xed4f53268bfdFF39B36E8786247bA3A02Cf34B04 v1 - 0x07f6e905f2a1559cd9fd43cb92f8a1062a3ca706
AssignBurnFees
AssignBurnFees
Event is emitted when fees for burning are assigned for a reserve.
event AssignBurnFees(address reserve, uint burnFee)
Parameter | Type | Indexed | Description |
---|---|---|---|
| address | NO | reserve's contract address |
|
| NO | amount of fees to be burned in wei |
Event Signature: 0xf838f6ddc89706878e3c3e698e9b5cbfbf2c0e3d3dcd0bd2e00f1ccf313e0185
AssignFeeToWallet
AssignFeeToWallet
Event is emitted when fees for fee sharing are assigned for a reserve.
event AssignFeeToWallet(address reserve, address wallet, uint walletFee)
Parameter | Type | Indexed | Description |
---|---|---|---|
| address | NO | reserve's contract address |
| address | NO | wallet address to send fees to |
| uint | NO | amount of fees to be assigned to wallet address |
Event Signature: 0x366bc34352215bf0bd3b527cfd6718605e1f5938777e42bcd8ed92f578368f52
BurnAssignedFees
BurnAssignedFees
Event is emitted when fees are burned.
event BurnAssignedFees(address indexed reserve, address sender, uint quantity)
Parameter | Type | Indexed | Description |
---|---|---|---|
| address | YES | reserve's contract address |
| address | NO | sender's address |
| uint | NO | amount of assigned fees to be burned |
Event Signature: 0x2f8d2d194cbe1816411754a2fc9478a11f0707da481b11cff7c69791eb877ee1
SendWalletFees
SendWalletFees
Event is emitted when fees are sent to a wallet as part of the fee sharing program.
event SendWalletFees(address indexed wallet, address reserve, address sender)
Parameter | Type | Indexed | Description | |
---|---|---|---|---|
| address | YES | reserve's specified wallet address | |
| address | NO | reserve's contract address | |
| address | NO | sender's address |
Event Signature: 0xb3f3e7375c0c0c4f7dd94069a5a4e68667827491318da786c818b8c7a794924e
Last updated