# IUpdatePositionSize

_Interface for position size updates types_

## DecreasePositionSizeInput

_Request decrease position input values_

```solidity
struct DecreasePositionSizeInput {
  address user;
  uint32 index;
  uint120 collateralDelta;
  uint24 leverageDelta;
  uint64 expectedPrice;
}
```

## IncreasePositionSizeInput

_Request increase position input values_

```solidity
struct IncreasePositionSizeInput {
  address user;
  uint32 index;
  uint120 collateralDelta;
  uint24 leverageDelta;
  uint64 expectedPrice;
  uint16 maxSlippageP;
}
```

## DecreasePositionSizeValues

_Useful values for decrease position size callback_

```solidity
struct DecreasePositionSizeValues {
  uint256 positionSizeCollateralDelta;
  uint256 existingPositionSizeCollateral;
  uint256 existingLiqPrice;
  uint256 priceAfterImpact;
  int256 existingPnlCollateral;
  uint256 borrowingFeeCollateral;
  uint256 closingFeeCollateral;
  int256 availableCollateralInDiamond;
  int256 collateralSentToTrader;
  uint120 newCollateralAmount;
  uint24 newLeverage;
}
```

## IncreasePositionSizeValues

_Useful values for increase position size callback_

```solidity
struct IncreasePositionSizeValues {
  uint256 positionSizeCollateralDelta;
  uint256 existingPositionSizeCollateral;
  uint256 newPositionSizeCollateral;
  uint256 newCollateralAmount;
  uint256 newLeverage;
  uint256 priceAfterImpact;
  int256 existingPnlCollateral;
  uint256 newOpenPrice;
  uint256 borrowingFeeCollateral;
  uint256 openingFeesCollateral;
  uint256 existingLiqPrice;
  uint256 newLiqPrice;
}
```
