Events

/// @title Events emitted by the exchange.
/// @notice Contains all events emitted by the exchange.
interface IExchangeEvents {
    /// @notice Emitted when a position of a trader is changed
    ///         This can either happen at the trader's request
    ///         or through a liquidation.
    /// @param trader The address of the trader whose position is changing.
    /// @param tradeFee The amount of trade fee being charged in stable token.
    /// @param traderPayout The amount of stable tokens being paid to the trader.
    /// @param previousAsset The amount of asset tokens the position had before the position change occured.
    /// @param previousStable The amount of stable tokens the position had before the position change occured.
    /// @param newAsset The amount of asset tokens the position has after the position has change occured.
    /// @param newStable The amount of stable tokens the position has after the position has change occured.
    event PositionChanged(
        address indexed trader,
        uint256 tradeFee,
        uint256 traderPayout,
        int256 previousAsset,
        int256 previousStable,
        int256 newAsset,
        int256 newStable
    );

    /// @notice Emitted when a position gets liquidated
    /// @param liquidator The address of the liquidator that initiated the liquidation request.
    /// @param trader The address of the trader whos position is getting liquidated.
    /// @param liquidatorPayout The amount of stable tokens that the liquidator got paid for the liquidation
    event Liquidate(address indexed liquidator, address indexed trader, uint256 liquidatorPayout);

    /// @notice Emitted when a call to the trader incentives fails.
    ///         Note: This event should not be fired in regular operations, however
    ///         to ensure that the exchange would function even if the incentives are broken
    ///         the exchange does not revert if the incentives revert.
    ///         This event is used in monitoring to see issues with the incentives and potentially
    ///         upgrade and fix.
    /// @param trader The trader that failed to update for the incentives call.
    /// @param incentivesTradeSize The calculated size of the incentives update.
    event IncentivesExchangeCallFailed(address indexed trader, uint256 incentivesTradeSize);

    /// @notice Emitted when liquidity is added by a liquidity provider
    /// @param router The router address that handled payment
    /// @param provider The provider's address
    /// @param assetAmount The amount of asset tokens the liquidity provider provided
    /// @param stableAmount The amount of stable tokens the liquidity provider provided
    /// @param liquidityTokenAmount The amount of liquidity tokens that were issued
    /// @param liquidityTokenSupply The new total supply of liquidity tokens
    event LiquidityAdded(
        address indexed router,
        address indexed provider,
        uint256 assetAmount,
        uint256 stableAmount,
        uint256 liquidityTokenAmount,
        uint256 liquidityTokenSupply
    );

    /// @notice Emitted when liquidity is removed by a liquidity provider
    /// @param provider The provider's address
    /// @param assetAmount The amount of asset tokens the liquidity provider received
    /// @param stableAmount The amount of stable tokens the liquidity provider received
    /// @param liquidityTokenAmount The amount of liquidity tokens that were burnt
    /// @param liquidityTokenSupply The new total supply of liquidity tokens
    event LiquidityRemoved(
        address indexed provider,
        uint256 assetAmount,
        uint256 stableAmount,
        uint256 liquidityTokenAmount,
        uint256 liquidityTokenSupply
    );

    /// @notice Emitted when a ALDTranche is being updated
    ///         Traders can get their trancheId and shareClass from IExchange.getPosition
    ///         If this event is emitted a trader's position with a matching tranceId and shareClass
    ///         will have changed
    /// @param trancheId The tranchId being updated
    /// @param shareClass The share class being updated
    event TrancheAutoDeleveraged(uint8 indexed trancheId, uint64 indexed shareClass);
}

Last updated