Skip to main content
Interface for GNSPairsStorage facet (inherits types and also contains functions, events, and custom errors)

initializeGroupLiquidationParams

Initializes liquidation params for all existing groups

Parameters

initializeNewFees

Copies all existing fee groups to new mapping, multiplies existing groups min/max lev by 1e3, initializes new global trade fee params

Parameters

addPairs

Adds new trading pairs

Parameters

updatePairs

Updates trading pairs

Parameters

addGroups

Adds new pair groups

Parameters

updateGroups

Updates pair groups

Parameters

addFees

Adds new pair fees groups

Parameters

updateFees

Updates pair fees groups

Parameters

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

setGroupLiquidationParams

Updates group liquidation params (will only apply for trades opened after the change)

Parameters

setGlobalTradeFeeParams

Updates global trade fee params

Parameters

pairJob

Returns data needed by price aggregator when doing a new price request

Parameters

Return Values

isPairListed

Returns whether a pair is listed

Parameters

isPairIndexListed

Returns whether a pair index is listed

Parameters

pairs

Returns a pair’s details

Parameters

pairsCount

Returns number of listed pairs

pairSpreadP

Returns a pair’s spread % (1e10 precision)

Parameters

pairMinLeverage

Returns a pair’s min leverage (1e3 precision)

Parameters

pairTotalPositionSizeFeeP

Returns a pair’s total position size fee % (1e10 precision)

Parameters

pairTotalLiqCollateralFeeP

Returns a pair’s total liquidation collateral fee % (1e10 precision)

Parameters

pairOraclePositionSizeFeeP

Returns a pair’s oracle position size fee % (1e10 precision)

Parameters

pairMinPositionSizeUsd

Returns a pair’s min position size in USD (1e18 precision)

Parameters

getGlobalTradeFeeParams

Returns global trade fee params

pairMinFeeUsd

Returns a pair’s minimum trading fee in USD (1e18 precision)

Parameters

groups

Returns a group details

Parameters

groupsCount

Returns number of listed groups

fees

Returns a fee group details

Parameters

feesCount

Returns number of listed fee groups

pairMaxLeverage

Returns a pair’s active max leverage; custom if set, otherwise group default (1e3 precision)

Parameters

pairCustomMaxLeverage

Returns a pair’s custom max leverage; 0 if not set (1e3 precision)

Parameters

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

PairAdded

Emitted when a new pair is listed

Parameters

PairUpdated

Emitted when a pair is updated

Parameters

PairCustomMaxLeverageUpdated

Emitted when a pair’s custom max leverage is updated

Parameters

GroupAdded

Emitted when a new group is added

Parameters

GroupUpdated

Emitted when a group is updated

Parameters

FeeAdded

Emitted when a new fee group is added

Parameters

FeeUpdated

Emitted when a fee group is updated

Parameters

GroupLiquidationParamsUpdated

Emitted when a group liquidation params are updated

Parameters

GlobalTradeFeeParamsUpdated

Emitted when global trade fee params are updated

Parameters

PairNotListed

GroupNotListed

FeeNotListed

WrongLeverages

WrongFees

PairAlreadyListed

MaxLiqSpreadPTooHigh

WrongLiqParamsThresholds

WrongLiqParamsLeverages

StartLiqThresholdTooHigh

EndLiqThresholdTooLow

StartLeverageTooLow

EndLeverageTooHigh