Events
1
/// @title Events emitted by the exchange.
2
/// @notice Contains all events emitted by the exchange.
3
interface IExchangeEvents {
4
/// @notice Emitted when a position of a trader is changed
5
/// This can either happen at the trader's request
6
/// or through a liquidation.
7
/// @param trader The address of the trader whose position is changing.
8
/// @param tradeFee The amount of trade fee being charged in stable token.
9
/// @param traderPayout The amount of stable tokens being paid to the trader.
10
/// @param previousAsset The amount of asset tokens the position had before the position change occured.
11
/// @param previousStable The amount of stable tokens the position had before the position change occured.
12
/// @param newAsset The amount of asset tokens the position has after the position has change occured.
13
/// @param newStable The amount of stable tokens the position has after the position has change occured.
14
event PositionChanged(
15
address indexed trader,
16
uint256 tradeFee,
17
uint256 traderPayout,
18
int256 previousAsset,
19
int256 previousStable,
20
int256 newAsset,
21
int256 newStable
22
);
23
24
/// @notice Emitted when a position gets liquidated
25
/// @param liquidator The address of the liquidator that initiated the liquidation request.
26
/// @param trader The address of the trader whos position is getting liquidated.
27
/// @param liquidatorPayout The amount of stable tokens that the liquidator got paid for the liquidation
28
event Liquidate(address indexed liquidator, address indexed trader, uint256 liquidatorPayout);
29
30
/// @notice Emitted when a call to the trader incentives fails.
31
/// Note: This event should not be fired in regular operations, however
32
/// to ensure that the exchange would function even if the incentives are broken
33
/// the exchange does not revert if the incentives revert.
34
/// This event is used in monitoring to see issues with the incentives and potentially
35
/// upgrade and fix.
36
/// @param trader The trader that failed to update for the incentives call.
37
/// @param incentivesTradeSize The calculated size of the incentives update.
38
event IncentivesExchangeCallFailed(address indexed trader, uint256 incentivesTradeSize);
39
40
/// @notice Emitted when liquidity is added by a liquidity provider
41
/// @param router The router address that handled payment
42
/// @param provider The provider's address
43
/// @param assetAmount The amount of asset tokens the liquidity provider provided
44
/// @param stableAmount The amount of stable tokens the liquidity provider provided
45
/// @param liquidityTokenAmount The amount of liquidity tokens that were issued
46
/// @param liquidityTokenSupply The new total supply of liquidity tokens
47
event LiquidityAdded(
48
address indexed router,
49
address indexed provider,
50
uint256 assetAmount,
51
uint256 stableAmount,
52
uint256 liquidityTokenAmount,
53
uint256 liquidityTokenSupply
54
);
55
56
/// @notice Emitted when liquidity is removed by a liquidity provider
57
/// @param provider The provider's address
58
/// @param assetAmount The amount of asset tokens the liquidity provider received
59
/// @param stableAmount The amount of stable tokens the liquidity provider received
60
/// @param liquidityTokenAmount The amount of liquidity tokens that were burnt
61
/// @param liquidityTokenSupply The new total supply of liquidity tokens
62
event LiquidityRemoved(
63
address indexed provider,
64
uint256 assetAmount,
65
uint256 stableAmount,
66
uint256 liquidityTokenAmount,
67
uint256 liquidityTokenSupply
68
);
69
70
/// @notice Emitted when a ALDTranche is being updated
71
/// Traders can get their trancheId and shareClass from IExchange.getPosition
72
/// If this event is emitted a trader's position with a matching tranceId and shareClass
73
/// will have changed
74
/// @param trancheId The tranchId being updated
75
/// @param shareClass The share class being updated
76
event TrancheAutoDeleveraged(uint8 indexed trancheId, uint64 indexed shareClass);
77
}
Copied!
Last modified 1mo ago
Copy link