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
function addGroups(struct IPairsStorage.Group[] _groups) internal
Check IPairsStorageUtils interface for documentation
updateGroups
function updateGroups(uint256[] _ids, struct IPairsStorage.Group[] _groups) internal
Check IPairsStorageUtils interface for documentation
addFees
function addFees(struct IPairsStorage.FeeGroup[] _fees) internal
Check IPairsStorageUtils interface for documentation
updateFees
function updateFees(uint256[] _ids, struct IPairsStorage.FeeGroup[] _fees) internal
Check IPairsStorageUtils interface for documentation
setPairCustomMaxLeverages
function setPairCustomMaxLeverages(uint256[] _indices, uint256[] _values) internal
Check IPairsStorageUtils interface for documentation
setGroupLiquidationParams
function setGroupLiquidationParams(uint256 _groupIndex, struct IPairsStorage.GroupLiquidationParams _params) internal
Check IPairsStorageUtils interface for documentation
setGlobalTradeFeeParams
function setGlobalTradeFeeParams(struct IPairsStorage.GlobalTradeFeeParams _feeParams) internal
Check IPairsStorageUtils interface for documentation
pairJob
function pairJob(uint256 _pairIndex) internal view returns (string, string)
Check IPairsStorageUtils interface for documentation
isPairListed
function isPairListed(string _from, string _to) internal view returns (bool)
Check IPairsStorageUtils interface for documentation
isPairIndexListed
function isPairIndexListed(uint256 _pairIndex) internal view returns (bool)
Check IPairsStorageUtils interface for documentation
pairs
function pairs(uint256 _index) internal view returns (struct IPairsStorage.Pair)
Check IPairsStorageUtils interface for documentation
pairsCount
function pairsCount() internal view returns (uint256)
Check IPairsStorageUtils interface for documentation
pairSpreadP
function pairSpreadP(uint256 _pairIndex) internal view returns (uint256)
Check IPairsStorageUtils interface for documentation
pairMinLeverage
function pairMinLeverage(uint256 _pairIndex) internal view returns (uint256)
Check IPairsStorageUtils interface for documentation
pairTotalPositionSizeFeeP
function pairTotalPositionSizeFeeP(uint256 _pairIndex) internal view returns (uint256)
Check IPairsStorageUtils interface for documentation
pairTotalLiqCollateralFeeP
function pairTotalLiqCollateralFeeP(uint256 _pairIndex) internal view returns (uint256)
Check IPairsStorageUtils interface for documentation
pairOraclePositionSizeFeeP
function pairOraclePositionSizeFeeP(uint256 _pairIndex) internal view returns (uint256)
Check IPairsStorageUtils interface for documentation
pairMinPositionSizeUsd
function pairMinPositionSizeUsd(uint256 _pairIndex) internal view returns (uint256)
Check IPairsStorageUtils interface for documentation
getGlobalTradeFeeParams
function getGlobalTradeFeeParams() internal view returns (struct IPairsStorage.GlobalTradeFeeParams)
Check IPairsStorageUtils interface for documentation
pairMinFeeUsd
function pairMinFeeUsd(uint256 _pairIndex) internal view returns (uint256)
Check IPairsStorageUtils interface for documentation
pairFeeIndex
function pairFeeIndex(uint256 _pairIndex) internal view returns (uint256)
Check IPairsStorageUtils interface for documentation
groups
function groups(uint256 _index) internal view returns (struct IPairsStorage.Group)
Check IPairsStorageUtils interface for documentation
groupsCount
function groupsCount() internal view returns (uint256)
Check IPairsStorageUtils interface for documentation
fees
function fees(uint256 _index) internal view returns (struct IPairsStorage.FeeGroup)
Check IPairsStorageUtils interface for documentation
feesCount
function feesCount() internal view returns (uint256)
Check IPairsStorageUtils interface for documentation
pairMaxLeverage
function pairMaxLeverage(uint256 _pairIndex) internal view returns (uint256)
Check IPairsStorageUtils interface for documentation
pairCustomMaxLeverage
function pairCustomMaxLeverage(uint256 _pairIndex) internal view returns (uint256)
Check IPairsStorageUtils interface for documentation
getAllPairsRestrictedMaxLeverage
function getAllPairsRestrictedMaxLeverage() internal view returns (uint256[])
Check IPairsStorageUtils interface for documentation
getGroupLiquidationParams
function getGroupLiquidationParams(uint256 _groupIndex) internal view returns (struct IPairsStorage.GroupLiquidationParams)
Check IPairsStorageUtils interface for documentation
getPairLiquidationParams
function getPairLiquidationParams(uint256 _pairIndex) internal view returns (struct IPairsStorage.GroupLiquidationParams)
Check IPairsStorageUtils interface for documentation
_getSlot
function _getSlot() internal pure returns (uint256)
Returns storage slot to use when fetching storage relevant to library
_getStorage
function _getStorage() internal pure returns (struct IPairsStorage.PairsStorage s)
Returns storage pointer for storage struct in diamond contract, at defined slot
groupListed
modifier groupListed(uint256 _groupIndex)
Reverts if group is not listed
Parameters
_groupIndex
uint256
group index to check
feeListed
modifier feeListed(uint256 _feeIndex)
Reverts if fee is not listed
Parameters
_feeIndex
uint256
fee index to check
groupOk
modifier groupOk(struct IPairsStorage.Group _group)
Reverts if group is not valid
Parameters
_group
struct IPairsStorage.Group
group to check
feeOk
modifier feeOk(struct IPairsStorage.FeeGroup _fee)
Reverts if fee is not valid
Parameters
_fee
struct IPairsStorage.FeeGroup
fee to check
_addPair
function _addPair(struct IPairsStorage.Pair _pair) internal
Adds a new trading pair
Parameters
_updatePair
function _updatePair(uint256 _pairIndex, struct IPairsStorage.Pair _pair) internal
Updates an existing trading pair
Parameters
_pairIndex
uint256
index of pair to update
_addGroup
function _addGroup(struct IPairsStorage.Group _group) internal
Adds a new pair group
Parameters
_updateGroup
function _updateGroup(uint256 _id, struct IPairsStorage.Group _group) internal
Updates an existing pair group
Parameters
_id
uint256
index of group to update
_addFee
function _addFee(struct IPairsStorage.FeeGroup _fee) internal
Adds a new pair fee group
Parameters
_updateFee
function _updateFee(uint256 _id, struct IPairsStorage.FeeGroup _fee) internal
Updates an existing pair fee group
Parameters
_id
uint256
index of fee to update
Last updated
Was this helpful?