PairsStorageUtils

GNSPairsStorage facet internal library

initializeGroupLiquidationParams

function initializeGroupLiquidationParams(struct IPairsStorage.GroupLiquidationParams[] _groupLiquidationParams) internal

Check IPairsStorageUtils interface for documentation

initializeNewFees

function initializeNewFees(struct IPairsStorage.GlobalTradeFeeParams _tradeFeeParams) internal

Check IPairsStorageUtils interface for documentation

addPairs

function addPairs(struct IPairsStorage.Pair[] _pairs) internal

Check IPairsStorageUtils interface for documentation

updatePairs

function updatePairs(uint256[] _pairIndices, struct IPairsStorage.Pair[] _pairs) internal

Check IPairsStorageUtils interface for documentation

addGroups

Check IPairsStorageUtils interface for documentation

updateGroups

Check IPairsStorageUtils interface for documentation

addFees

Check IPairsStorageUtils interface for documentation

updateFees

Check IPairsStorageUtils interface for documentation

setPairCustomMaxLeverages

Check IPairsStorageUtils interface for documentation

setGroupLiquidationParams

Check IPairsStorageUtils interface for documentation

setGlobalTradeFeeParams

Check IPairsStorageUtils interface for documentation

pairJob

Check IPairsStorageUtils interface for documentation

isPairListed

Check IPairsStorageUtils interface for documentation

isPairIndexListed

Check IPairsStorageUtils interface for documentation

pairs

Check IPairsStorageUtils interface for documentation

pairsCount

Check IPairsStorageUtils interface for documentation

pairSpreadP

Check IPairsStorageUtils interface for documentation

pairMinLeverage

Check IPairsStorageUtils interface for documentation

pairTotalPositionSizeFeeP

Check IPairsStorageUtils interface for documentation

pairTotalLiqCollateralFeeP

Check IPairsStorageUtils interface for documentation

pairOraclePositionSizeFeeP

Check IPairsStorageUtils interface for documentation

pairMinPositionSizeUsd

Check IPairsStorageUtils interface for documentation

getGlobalTradeFeeParams

Check IPairsStorageUtils interface for documentation

pairMinFeeUsd

Check IPairsStorageUtils interface for documentation

pairFeeIndex

Check IPairsStorageUtils interface for documentation

groups

Check IPairsStorageUtils interface for documentation

groupsCount

Check IPairsStorageUtils interface for documentation

fees

Check IPairsStorageUtils interface for documentation

feesCount

Check IPairsStorageUtils interface for documentation

pairMaxLeverage

Check IPairsStorageUtils interface for documentation

pairCustomMaxLeverage

Check IPairsStorageUtils interface for documentation

getAllPairsRestrictedMaxLeverage

Check IPairsStorageUtils interface for documentation

getGroupLiquidationParams

Check IPairsStorageUtils interface for documentation

getPairLiquidationParams

Check IPairsStorageUtils interface for documentation

_getSlot

Returns storage slot to use when fetching storage relevant to library

_getStorage

Returns storage pointer for storage struct in diamond contract, at defined slot

groupListed

Reverts if group is not listed

Parameters

Name
Type
Description

_groupIndex

uint256

group index to check

feeListed

Reverts if fee is not listed

Parameters

Name
Type
Description

_feeIndex

uint256

fee index to check

groupOk

Reverts if group is not valid

Parameters

Name
Type
Description

_group

struct IPairsStorage.Group

group to check

feeOk

Reverts if fee is not valid

Parameters

Name
Type
Description

_fee

struct IPairsStorage.FeeGroup

fee to check

_addPair

Adds a new trading pair

Parameters

Name
Type
Description

_pair

pair to add

_updatePair

Updates an existing trading pair

Parameters

Name
Type
Description

_pairIndex

uint256

index of pair to update

_pair

new pair value

_addGroup

Adds a new pair group

Parameters

Name
Type
Description

_group

group to add

_updateGroup

Updates an existing pair group

Parameters

Name
Type
Description

_id

uint256

index of group to update

_group

new group value

_addFee

Adds a new pair fee group

Parameters

Name
Type
Description

_updateFee

Updates an existing pair fee group

Parameters

Name
Type
Description

_id

uint256

index of fee to update

_fee

new fee value

Last updated

Was this helpful?