IPriceImpact

Contains the types for the GNSPriceImpact facet

PriceImpactStorage

struct PriceImpactStorage {
  struct IPriceImpact.OiWindowsSettings oiWindowsSettings;
  mapping(uint48 => mapping(uint256 => mapping(uint256 => struct IPriceImpact.PairOi))) windows;
  mapping(uint256 => struct IPriceImpact.PairDepth) pairDepths;
  mapping(address => mapping(uint32 => struct IPriceImpact.TradePriceImpactInfo)) tradePriceImpactInfos;
  mapping(uint256 => struct IPriceImpact.PairFactors) pairFactors;
  uint40 negPnlCumulVolMultiplier;
  uint216 __placeholder;
  mapping(address => bool) protectionCloseFactorWhitelist;
  uint256[43] __gap;
}

OiWindowsSettings

struct OiWindowsSettings {
  uint48 startTs;
  uint48 windowsDuration;
  uint48 windowsCount;
}

PairOi

struct PairOi {
  uint128 oiLongUsd;
  uint128 oiShortUsd;
}

OiWindowUpdate

struct OiWindowUpdate {
  address trader;
  uint32 index;
  uint48 windowsDuration;
  uint256 pairIndex;
  uint256 windowId;
  bool long;
  bool open;
  bool isPnlPositive;
  uint128 openInterestUsd;
}

PairDepth

struct PairDepth {
  uint128 onePercentDepthAboveUsd;
  uint128 onePercentDepthBelowUsd;
}

PairFactors

struct PairFactors {
  uint40 protectionCloseFactor;
  uint32 protectionCloseFactorBlocks;
  uint40 cumulativeFactor;
  bool exemptOnOpen;
  bool exemptAfterProtectionCloseFactor;
  uint128 __placeholder;
}

TradePriceImpactInfo

struct TradePriceImpactInfo {
  uint128 lastWindowOiUsd;
  uint128 __placeholder;
}