> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gains.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# IUpdateLeverageUtils

*Interface for leverage updates*

## LeverageUpdateInitiated

```solidity theme={null}
event LeverageUpdateInitiated(struct ITradingStorage.Id orderId, address trader, uint256 pairIndex, uint256 index, bool isIncrease, uint256 newLeverage)
```

### Parameters

| Name        | Type                      | Description                                  |
| ----------- | ------------------------- | -------------------------------------------- |
| orderId     | struct ITradingStorage.Id | request order id                             |
| trader      | address                   | address of trader                            |
| pairIndex   | uint256                   | index of pair                                |
| index       | uint256                   | index of trade                               |
| isIncrease  | bool                      | true if increase leverage, false if decrease |
| newLeverage | uint256                   | new leverage value (1e3)                     |

## LeverageUpdateExecuted

```solidity theme={null}
event LeverageUpdateExecuted(struct ITradingStorage.Id orderId, bool isIncrease, enum ITradingCallbacks.CancelReason cancelReason, uint8 collateralIndex, address trader, uint256 pairIndex, uint256 index, uint256 oraclePrice, uint256 collateralDelta, struct IUpdateLeverage.UpdateLeverageValues values)
```

### Parameters

| Name            | Type                                        | Description                                                                 |
| --------------- | ------------------------------------------- | --------------------------------------------------------------------------- |
| orderId         | struct ITradingStorage.Id                   | request order id                                                            |
| isIncrease      | bool                                        | true if leverage increased, false if decreased                              |
| cancelReason    | enum ITradingCallbacks.CancelReason         | cancel reason (executed if none)                                            |
| collateralIndex | uint8                                       | collateral index                                                            |
| trader          | address                                     | address of trader                                                           |
| pairIndex       | uint256                                     | index of pair                                                               |
| index           | uint256                                     | index of trade                                                              |
| oraclePrice     | uint256                                     | current oracle price (1e10)                                                 |
| collateralDelta | uint256                                     | collateral delta (collateral precision)                                     |
| values          | struct IUpdateLeverage.UpdateLeverageValues | useful values (new collateral, new leverage, liq price, gov fee collateral) |
