# IPairsStorage

*Contains the types for the GNSPairsStorage facet*

## PairsStorage

```solidity
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

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

## Group

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

## GlobalTradeFeeParams

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

## FeeGroup

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

## TradeFees

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

## GroupLiquidationParams

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

## FeedCalculation

```solidity
enum FeedCalculation {
  DEFAULT,
  INVERT,
  COMBINE
}
```

## Feed

@custom:deprecated

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

## Fee

@custom:deprecated

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gains.trade/developer/technical-reference/contracts/interfaces/types/ipairsstorage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
