ITradingCallbacks

Contains the types for the GNSTradingCallbacks facet

TradingCallbacksStorage

struct TradingCallbacksStorage {
  uint8 vaultClosingFeeP;
  uint248 __placeholder;
  mapping(uint8 => uint256) pendingGovFees;
  uint256[48] __gap;
}

CancelReason

enum CancelReason {
  NONE,
  PAUSED,
  MARKET_CLOSED,
  SLIPPAGE,
  TP_REACHED,
  SL_REACHED,
  EXPOSURE_LIMITS,
  PRICE_IMPACT,
  MAX_LEVERAGE,
  NO_TRADE,
  WRONG_TRADE,
  NOT_HIT
}

AggregatorAnswer

struct AggregatorAnswer {
  struct ITradingStorage.Id orderId;
  uint256 spreadP;
  uint64 price;
  uint64 open;
  uint64 high;
  uint64 low;
}

Values

struct Values {
  uint256 positionSizeCollateral;
  uint256 gnsPriceCollateral;
  int256 profitP;
  uint256 executionPrice;
  uint256 liqPrice;
  uint256 amountSentToTrader;
  uint256 reward1;
  uint256 reward2;
  uint256 reward3;
  uint128 collateralPrecisionDelta;
  uint256 collateralPriceUsd;
  bool exactExecution;
}

IncreasePositionSizeValues

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;
}

DecreasePositionSizeValues

struct DecreasePositionSizeValues {
    uint256 positionSizeCollateralDelta;
    uint256 existingPositionSizeCollateral;
    uint256 existingLiqPrice;
    int256 existingPnlCollateral;
    uint256 borrowingFeeCollateral;
    uint256 vaultFeeCollateral;
    uint256 gnsStakingFeeCollateral;
    int256 availableCollateralInDiamond;
    int256 collateralSentToTrader;
    uint120 newCollateralAmount;
    uint24 newLeverage;
}

Last updated