event TokensTraded()

This function fires an event after a token is successfully swapped

event TokensTraded()

Every trade on Bancor will emit this event with information on the trade itself.

event TokensTraded(
        bytes32 contextId,
        Token indexed pool,
        Token indexed sourceToken,
        Token indexed targetToken,
        uint256 sourceAmount,
        uint256 targetAmount,
        uint256 bntAmount,
        uint256 targetFeeAmount,
        uint256 bntFeeAmount,
        address trader
    );

Trades on the Bancor Network are represented by a single-hop in all cases. TokensTraded event tracks the key information. The sourceAmount is provided by the trader in exchange for the targetAmount (which already has the targetTokenFee subtracted from it).

Behind the scenes, the bntAmount is the BNT volume that facilitates the trade and has the bntFee subtracted from it.

Last updated