# Events

Throughout execution, the contract emits the following events which might be useful for experienced traders&#x20;

#### Configuration events:

{% code overflow="wrap" %}

```rust
UpdateExchangeInvoker {invoker: ContractAddress, enabled: bool}
BaseTokenUpdate {new_base_token: ContractAddress}
FeeRecipientUpdate {new_fee_recipient: ContractAddress}
RouterComponentUpdate {new_delay:SlowModeDelay, min_amount_to_route:u256, new_punishment_bips:u16}
WithdrawComponentUpdate {new_withdraw_steps: u16, new_delay:SlowModeDelay}
```

{% endcode %}

#### User balance events:

<pre class="language-rust" data-overflow="wrap"><code class="lang-rust">Mint { token:ContractAddress, to:ContractAddress, amount:u256}
Burn { from_:ContractAddress, token:ContractAddress, amount:u256}
Transfer { token: ContractAddress, from_: ContractAddress, to: ContractAddress, amount: u256}
<strong>Deposit { receiver: ContractAddress, token: ContractAddress, funder:ContractAddress, amount: u256}
</strong>
ReqOnChainWithdraw { maker: ContractAddress, withdraw:Withdraw}
Withdrawal {
   maker: ContractAddress, token: ContractAddress, receiver: ContractAddress,
   salt: felt252, amount: u256, gas_price: u256, gas_fee: GasFee, direct: bool }

</code></pre>

#### Trading account signer events:

```rust
NewBinding {trading_account: ContractAddress, signer: ContractAddress}
```

#### Change of trading account nonce events:

```rust
NonceIncrease { maker: ContractAddress, new_nonce: u32}
```

#### Router events:

{% code overflow="wrap" %}

```rust
Deposit { router: ContractAddress, token: ContractAddress, funder: ContractAddress, amount: u256,}
Withdraw { router:ContractAddress, token:ContractAddress, amount:u256, receiver:ContractAddress,}

RouterRegistration {router:ContractAddress, status: u8} //0registered, 1scheduled unregister, 2unregsiter
Binding {router:ContractAddress, signer:ContractAddress, is_added:bool}
RouterMint {token:ContractAddress, router:ContractAddress, amount:u256}
RouterBurn {router:ContractAddress, token:ContractAddress, amount:u256}
```

{% endcode %}

#### Trade events:

{% code overflow="wrap" lineNumbers="true" %}

```rust
Trade { maker:ContractAddress, taker:ContractAddress,
    ticker:(ContractAddress,ContractAddress), 
    amount_base: u256, amount_quote: u256, is_sell_side: bool, is_failed:bool, is_ecosystem_book: bool,
      maker_hash:felt252, taker_hash:felt252,
      maker_source:felt252, taker_source:felt252
 }
FeeReward {recipient:ContractAddress,token:ContractAddress, amount:u256}
RouterPunish { router:ContractAddress, taker:_hashContractAddress, maker_hash:felt252, amount:u256}
```

{% endcode %}

1. To deduce how much was paid in trading fees and gas, the user can filter Transfer events with "to" set to exchange fee recipient.
2. To filter orders by origin collect event from chain and filter by maker\_source and taker \_source
3. maker and taker fields are indexed
