IPairsStorageUtils
Interface for GNSPairsStorage facet (inherits types and also contains functions, events, and custom errors)
initializeGroupLiquidationParams
Initializes liquidation params for all existing groups
Parameters
Name | Type | Description |
---|---|---|
_groupLiquidationParams | liquidation params for each group (index corresponds to group index) |
addPairs
Adds new trading pairs
Parameters
Name | Type | Description |
---|---|---|
_pairs | pairs to add |
updatePairs
Updates trading pairs
Parameters
Name | Type | Description |
---|---|---|
_pairIndices | uint256[] | indices of pairs |
_pairs | new pairs values |
addGroups
Adds new pair groups
Parameters
Name | Type | Description |
---|---|---|
_groups | groups to add |
updateGroups
Updates pair groups
Parameters
Name | Type | Description |
---|---|---|
_ids | uint256[] | indices of groups |
_groups | new groups values |
addFees
Adds new pair fees groups
Parameters
Name | Type | Description |
---|---|---|
_fees | fees to add |
updateFees
Updates pair fees groups
Parameters
Name | Type | Description |
---|---|---|
_ids | uint256[] | indices of fees |
_fees | new fees values |
setPairCustomMaxLeverages
Updates pair custom max leverages (if unset group default is used)
Parameters
Name | Type | Description |
---|---|---|
_indices | uint256[] | indices of pairs |
_values | uint256[] | new custom max leverages |
setGroupLiquidationParams
Updates group liquidation params (will only apply for trades opened after the change)
Parameters
Name | Type | Description |
---|---|---|
_groupIndex | uint256 | index of group |
_params | new liquidation params |
pairJob
Returns data needed by price aggregator when doing a new price request
Parameters
Name | Type | Description |
---|---|---|
_pairIndex | uint256 | index of pair |
Return Values
Name | Type | Description |
---|---|---|
from | string | pair from (eg. BTC) |
to | string | pair to (eg. USD) |
isPairListed
Returns whether a pair is listed
Parameters
Name | Type | Description |
---|---|---|
_from | string | pair from (eg. BTC) |
_to | string | pair to (eg. USD) |
isPairIndexListed
Returns whether a pair index is listed
Parameters
Name | Type | Description |
---|---|---|
_pairIndex | uint256 | index of pair to check |
pairs
Returns a pair's details
Parameters
Name | Type | Description |
---|---|---|
_index | uint256 | index of pair |
pairsCount
Returns number of listed pairs
pairSpreadP
Returns a pair's spread % (1e10 precision)
Parameters
Name | Type | Description |
---|---|---|
_pairIndex | uint256 | index of pair |
pairMinLeverage
Returns a pair's min leverage
Parameters
Name | Type | Description |
---|---|---|
_pairIndex | uint256 | index of pair |
pairOpenFeeP
Returns a pair's open fee % (1e10 precision)
Parameters
Name | Type | Description |
---|---|---|
_pairIndex | uint256 | index of pair |
pairCloseFeeP
Returns a pair's close fee % (1e10 precision)
Parameters
Name | Type | Description |
---|---|---|
_pairIndex | uint256 | index of pair |
pairOracleFeeP
Returns a pair's oracle fee % (1e10 precision)
Parameters
Name | Type | Description |
---|---|---|
_pairIndex | uint256 | index of pair |
pairTriggerOrderFeeP
Returns a pair's trigger order fee % (1e10 precision)
Parameters
Name | Type | Description |
---|---|---|
_pairIndex | uint256 | index of pair |
pairMinPositionSizeUsd
Returns a pair's min leverage position in USD (1e18 precision)
Parameters
Name | Type | Description |
---|---|---|
_pairIndex | uint256 | index of pair |
pairMinFeeUsd
Returns a pair's minimum trading fee in USD (1e18 precision)
Parameters
Name | Type | Description |
---|---|---|
_pairIndex | uint256 | index of pair |
groups
Returns a group details
Parameters
Name | Type | Description |
---|---|---|
_index | uint256 | index of group |
groupsCount
Returns number of listed groups
fees
Returns a fee group details
Parameters
Name | Type | Description |
---|---|---|
_index | uint256 | index of fee group |
feesCount
Returns number of listed fee groups
pairsBackend
Returns a pair's details, group and fee group
Parameters
Name | Type | Description |
---|---|---|
_index | uint256 | index of pair |
pairMaxLeverage
Returns a pair's active max leverage (custom if set, otherwise group default)
Parameters
Name | Type | Description |
---|---|---|
_pairIndex | uint256 | index of pair |
pairCustomMaxLeverage
Returns a pair's custom max leverage (0 if not set)
Parameters
Name | Type | Description |
---|---|---|
_pairIndex | uint256 | index of pair |
getAllPairsRestrictedMaxLeverage
Returns all listed pairs custom max leverages
getGroupLiquidationParams
Returns a group's liquidation params
getPairLiquidationParams
Returns a pair's group liquidation params
PairAdded
Emitted when a new pair is listed
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | index of pair |
from | string | pair from (eg. BTC) |
to | string | pair to (eg. USD) |
PairUpdated
Emitted when a pair is updated
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | index of pair |
PairCustomMaxLeverageUpdated
Emitted when a pair's custom max leverage is updated
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | index of pair |
maxLeverage | uint256 | new max leverage |
GroupAdded
Emitted when a new group is added
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | index of group |
name | string | name of group |
GroupUpdated
Emitted when a group is updated
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | index of group |
FeeAdded
Emitted when a new fee group is added
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | index of fee group |
name | string | name of fee group |
FeeUpdated
Emitted when a fee group is updated
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | index of fee group |
GroupLiquidationParamsUpdated
Emitted when a group liquidation params are updated
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | index of group |
params | struct IPairsStorage.GroupLiquidationParams | new group liquidation params |
PairNotListed
GroupNotListed
FeeNotListed
WrongLeverages
WrongFees
PairAlreadyListed
MaxLiqSpreadPTooHigh
WrongLiqParamsThresholds
WrongLiqParamsLeverages
StartLiqThresholdTooHigh
EndLiqThresholdTooLow
StartLeverageTooLow
EndLeverageTooHigh
Last updated