GNSPairsStorage
Facet #1: Pairs storage
constructor
initializeGroupLiquidationParams
Initializes liquidation params for all existing groups
Parameters
_groupLiquidationParams
liquidation params for each group (index corresponds to group index)
initializeNewFees
Copies all existing fee groups to new mapping, multiplies existing groups min/max lev by 1e3, initializes new global trade fee params
Parameters
_tradeFeeParams
global trade fee params
addPairs
Adds new trading pairs
Parameters
_pairs
pairs to add
updatePairs
Updates trading pairs
Parameters
_pairIndices
uint256[]
indices of pairs
_pairs
new pairs values
addGroups
Adds new pair groups
Parameters
_groups
groups to add
updateGroups
Updates pair groups
Parameters
_ids
uint256[]
indices of groups
_groups
new groups values
addFees
Adds new pair fees groups
Parameters
_fees
fees to add
updateFees
Updates pair fees groups
Parameters
_ids
uint256[]
indices of fees
_fees
new fees values
setGroupLiquidationParams
Updates group liquidation params (will only apply for trades opened after the change)
Parameters
_groupIndex
uint256
index of group
_params
new liquidation params
setGlobalTradeFeeParams
Updates global trade fee params
Parameters
_feeParams
new fee params
setPairCustomMaxLeverages
Updates pair custom max leverages (if unset group default is used); useful to delist a pair if new value is below the pair's group minLeverage
Parameters
_indices
uint256[]
indices of pairs
_values
uint256[]
new custom max leverages (1e3 precision)
pairJob
Returns data needed by price aggregator when doing a new price request
Parameters
_pairIndex
uint256
index of pair
Return Values
[0]
string
[1]
string
isPairListed
Returns whether a pair is listed
Parameters
_from
string
pair from (eg. BTC)
_to
string
pair to (eg. USD)
isPairIndexListed
Returns whether a pair index is listed
Parameters
_pairIndex
uint256
index of pair to check
pairs
Returns a pair's details
Parameters
_index
uint256
index of pair
pairsCount
Returns number of listed pairs
pairSpreadP
Returns a pair's spread % (1e10 precision)
Parameters
_pairIndex
uint256
index of pair
pairMinLeverage
Returns a pair's min leverage (1e3 precision)
Parameters
_pairIndex
uint256
index of pair
pairTotalPositionSizeFeeP
Returns a pair's total position size fee % (1e10 precision)
Parameters
_pairIndex
uint256
index of pair
pairTotalLiqCollateralFeeP
Returns a pair's total liquidation collateral fee % (1e10 precision)
Parameters
_pairIndex
uint256
index of pair
pairOraclePositionSizeFeeP
Returns a pair's oracle position size fee % (1e10 precision)
Parameters
_pairIndex
uint256
index of pair
pairMinPositionSizeUsd
Returns a pair's min position size in USD (1e18 precision)
Parameters
_pairIndex
uint256
index of pair
getGlobalTradeFeeParams
Returns global trade fee params
pairMinFeeUsd
Returns a pair's minimum trading fee in USD (1e18 precision)
Parameters
_pairIndex
uint256
index of pair
groups
Returns a group details
Parameters
_index
uint256
index of group
groupsCount
Returns number of listed groups
fees
Returns a fee group details
Parameters
_index
uint256
index of fee group
feesCount
Returns number of listed fee groups
pairMaxLeverage
Returns a pair's active max leverage; custom if set, otherwise group default (1e3 precision)
Parameters
_pairIndex
uint256
index of pair
pairCustomMaxLeverage
Returns a pair's custom max leverage; 0 if not set (1e3 precision)
Parameters
_pairIndex
uint256
index of pair
getAllPairsRestrictedMaxLeverage
Returns all listed pairs custom max leverages (1e3 precision)
getGroupLiquidationParams
Returns a group's liquidation params
getPairLiquidationParams
Returns a pair's group liquidation params
Last updated