Gains Network
  • 📚Home
  • Gains Network
    • 🔎Overview
    • 🍏GNS Token
    • 📔Contract Addresses
      • Apechain Mainnet
      • Arbitrum Mainnet
      • Base Mainnet
      • Polygon Mainnet
  • gTrade (Leveraged Trading)
    • 🔎Overview
    • 🎛️Setting up to trade
      • 🟣Polygon Network Setup
      • 🔵Arbitrum Network Setup
    • 🏦Opening / Closing trades
    • 💲Trade Collaterals
      • Spotlight: WETH
    • 📖Asset classes
      • 🪙Cryptocurrencies
      • 💵Forex
      • 🛢️Commodities
    • 🎫Fees & Spread
    • 📰Pair List
    • 🧒How to use Practice Mode
    • ⚡One-Click Trading (1CT)
    • 🌌gTrade Solana
    • 📺Video tutorials
  • Loyalty Programs
    • Prime Trader
    • gTrade Credits
  • Community
    • gTrade Guardians
    • Governance forum
  • Reward Pools
    • 💚GNS Staking
    • 👛gToken Vaults
      • 👷Staker Functions
      • ❔Staker FAQ
      • ⏳Upgrades, updates, and timelocks
    • 🔼Active Pools & Incentives
  • Help
    • ❓FAQ
    • ⏳Chain congestion
  • Bridges
    • 🪐Arbitrum <-> Polygon Bridge
    • 🪐ERC20 Bridge (Polygon)
    • 🪐NFT Bridge (Polygon)
  • Developer
    • Integrators
      • Trading Contracts
      • Backend
      • Price Feed
      • Guides
        • v9 migration
        • Calculating borrowing fees
        • Calculating liquidation price
    • Technical Reference
      • Contracts
        • Changelogs
          • v9.2.1 Update
          • v9.1 Update
          • v9.1.1 Update
          • v9 Update
        • Core
          • Abstract
            • GNSAddressStore
            • GNSDiamondCut
            • GNSDiamondLoupe
            • GNSDiamondStorage
          • Facets
            • GNSBorrowingFees
            • GNSOtc
            • GNSPriceAggregator
            • GNSTradingInteractions
            • GNSTriggerRewards
            • GNSFeeTiers
            • GNSPairsStorage
            • GNSPriceImpact
            • GNSReferrals
            • GNSTradingCallbacks
            • GNSTradingStorage
          • GNSMultiCollatDiamond
          • GNSStaking
          • GToken
          • GTokenOpenPnlFeed
        • Interfaces
          • Libraries
            • IBorrowingFeesUtils
            • IOtcUtils
            • IPriceAggregatorUtils
            • ITriggerRewardsUtils
            • IFeeTiersUtils
            • IPairsStorageUtils
            • IPriceImpactUtils
            • IReferralsUtils
            • ITradingCallbacksUtils
            • ITradingCommonUtils
            • ITradingInteractionsUtils
            • ITradingStorageUtils
            • IUpdateLeverageUtils
            • IUpdatePositionSizeUtils
          • Types
            • IAddressStore
            • IBorrowingFees
            • IDiamondStorage
            • IOtc
            • IPriceAggregator
            • ITradingStorage
            • ITradingInteractions
            • ITriggerRewards
            • ITypes
            • IUpdateLeverage
            • IPairsStorage
            • IFeeTiers
            • IPriceImpact
            • IReferrals
            • ITradingCallbacks
            • IUpdatePositionSize
          • IChainlinkFeed
          • IArbSys
          • IChainlinkOracle
          • IERC20
          • IERC721
          • IERC721Design
          • IGeneralErrors
          • IGNSAddressStore
          • IGNSDiamond
          • IGNSDiamondCut
          • IGNSMultiCollatDiamond
          • IGNSDiamondLoupe
          • IGNSStaking
          • IGToken
          • IGTokenLockedDepositNft
          • IGTokenOpenPnlFeed
          • IGTokenLockedDepositNftDesign
          • ILiquidityPool
          • IRateProvider
          • IOwnable
        • Libraries
          • updateLeverage
            • UpdateLeverageLifecycles
          • updatePositionSize
            • IncreasePositionSizeUtils
            • DecreasePositionSizeUtils
            • UpdatePositionSizeLifecycles
          • AddressStoreUtils
          • ChainlinkClientUtils
          • ChainUtils
          • ConstantsUtils
          • CollateralUtils
          • DiamondUtils
          • LiquidityPoolUtils
          • OtcUtils
          • PackingUtils
          • StorageUtils
          • TriggerRewardsUtils
          • ArrayGetters
          • BorrowingFeesUtils
          • FeeTiersUtils
          • PriceAggregatorUtils
          • PriceImpactUtils
          • ReferralsUtils
          • TradingCallbacksUtils
          • PairsStorageUtils
          • TradingCommonUtils
          • TradingStorageUtils
          • TradingInteractionsUtils
        • Misc
          • EpochBasedTokenClaim
          • GNSCompensationHandler
          • GTokenRateProvider
          • GTokenLockedDepositNftDesign
          • ManagerTimelock
          • OwnerTimelock
          • VotingDelegator
        • Tokens
          • GainsNetworkToken
          • GTokenLockedDepositNft
      • Backend
        • Backend Types
      • SDK
        • Client Types
  • Archived
    • 🖼️gFARM2 NFTs
Powered by GitBook
On this page
  • PairsStorage
  • Pair
  • Group
  • GlobalTradeFeeParams
  • FeeGroup
  • TradeFees
  • GroupLiquidationParams
  • FeedCalculation
  • Feed
  • Fee

Was this helpful?

  1. Developer
  2. Technical Reference
  3. Contracts
  4. Interfaces
  5. Types

IPairsStorage

Contains the types for the GNSPairsStorage facet

PairsStorage

struct PairsStorage {
  mapping(uint256 => struct IPairsStorage.Pair) pairs;
  mapping(uint256 => struct IPairsStorage.Group) groups;
  mapping(uint256 => struct IPairsStorage.Fee) fees;
  mapping(string => mapping(string => bool)) isPairListed;
  mapping(uint256 => uint256) pairCustomMaxLeverage;
  uint256 currentOrderId;
  uint256 pairsCount;
  uint256 groupsCount;
  uint256 feesCount;
  mapping(uint256 => struct IPairsStorage.GroupLiquidationParams) groupLiquidationParams;
  mapping(uint256 => struct IPairsStorage.FeeGroup) feeGroups;
  struct IPairsStorage.GlobalTradeFeeParams globalTradeFeeParams;
  uint256[38] __gap;
}

Pair

struct Pair {
  string from;
  string to;
  struct IPairsStorage.Feed feed;
  uint256 spreadP;
  uint256 groupIndex;
  uint256 feeIndex;
}

Group

struct Group {
  string name;
  bytes32 job;
  uint256 minLeverage;
  uint256 maxLeverage;
}

GlobalTradeFeeParams

struct GlobalTradeFeeParams {
  uint24 referralFeeP;
  uint24 govFeeP;
  uint24 triggerOrderFeeP;
  uint24 gnsOtcFeeP;
  uint24 gTokenFeeP;
  uint136 __placeholder;
}

FeeGroup

struct FeeGroup {
  uint40 totalPositionSizeFeeP;
  uint40 totalLiqCollateralFeeP;
  uint40 oraclePositionSizeFeeP;
  uint32 minPositionSizeUsd;
  uint104 __placeholder;
}

TradeFees

struct TradeFees {
  uint256 totalFeeCollateral;
  uint256 referralFeeCollateral;
  uint256 govFeeCollateral;
  uint256 triggerOrderFeeCollateral;
  uint256 gnsOtcFeeCollateral;
  uint256 gTokenFeeCollateral;
}

GroupLiquidationParams

struct GroupLiquidationParams {
  uint40 maxLiqSpreadP;
  uint40 startLiqThresholdP;
  uint40 endLiqThresholdP;
  uint24 startLeverage;
  uint24 endLeverage;
}

FeedCalculation

enum FeedCalculation {
  DEFAULT,
  INVERT,
  COMBINE
}

Feed

@custom:deprecated

struct Feed {
  address feed1;
  address feed2;
  enum IPairsStorage.FeedCalculation feedCalculation;
  uint256 maxDeviationP;
}

Fee

@custom:deprecated

struct Fee {
  string name;
  uint256 openFeeP;
  uint256 closeFeeP;
  uint256 oracleFeeP;
  uint256 triggerOrderFeeP;
  uint256 minPositionSizeUsd;
}
PreviousIUpdateLeverageNextIFeeTiers

Was this helpful?