Skip to main content
GNSBorrowingFees facet internal library

setBorrowingPairParams

Check IBorrowingFeesUtils interface for documentation

setBorrowingPairParamsArray

Check IBorrowingFeesUtils interface for documentation

setBorrowingGroupParams

Check IBorrowingFeesUtils interface for documentation

setBorrowingGroupParamsArray

Check IBorrowingFeesUtils interface for documentation

handleTradeBorrowingCallback

Check IBorrowingFeesUtils interface for documentation

resetTradeBorrowingFees

Check IBorrowingFeesUtils interface for documentation

getBorrowingPairPendingAccFees

Check IBorrowingFeesUtils interface for documentation

getBorrowingGroupPendingAccFees

Check IBorrowingFeesUtils interface for documentation

getTradeBorrowingFee

Check IBorrowingFeesUtils interface for documentation

getTradeLiquidationPrice

Check IBorrowingFeesUtils interface for documentation

getPairOisCollateral

Check IBorrowingFeesUtils interface for documentation

getBorrowingPairGroupIndex

Check IBorrowingFeesUtils interface for documentation

getPairOiCollateral

Check IBorrowingFeesUtils interface for documentation

withinMaxBorrowingGroupOi

Check IBorrowingFeesUtils interface for documentation

getBorrowingGroup

Check IBorrowingFeesUtils interface for documentation

getBorrowingGroupOi

Check IBorrowingFeesUtils interface for documentation

getBorrowingPair

Check IBorrowingFeesUtils interface for documentation

getBorrowingPairOi

Check IBorrowingFeesUtils interface for documentation

getBorrowingPairGroups

Check IBorrowingFeesUtils interface for documentation

getAllBorrowingPairs

Check IBorrowingFeesUtils interface for documentation

getBorrowingGroups

Check IBorrowingFeesUtils interface for documentation

getBorrowingInitialAccFees

Check IBorrowingFeesUtils interface for documentation

getPairMaxOi

Check IBorrowingFeesUtils interface for documentation

getPairMaxOiCollateral

Check IBorrowingFeesUtils 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

_getMultiCollatDiamond

Returns current address as multi-collateral diamond interface to call other facets functions.

validCollateralIndex

Reverts if collateral index is not valid

_getBorrowingPairPendingAccFee

Returns pending acc borrowing fee for a pair on one side only

Parameters

Return Values

_getBorrowingGroupPendingAccFee

Returns pending acc borrowing fee for a borrowing group on one side only

Parameters

Return Values

_getBorrowingPendingAccFees

Pure function that returns the new acc borrowing fees and delta between two blocks (for pairs and groups)

Parameters

Return Values

_getTradeLiquidationPrice

Pure function that returns the liquidation price for a trade (1e10 precision)

Parameters

_setBorrowingPairParams

Function to set borrowing pair params

Parameters

_setBorrowingGroupParams

Function to set borrowing group params

Parameters

_updateOi

Function to update a borrowing pair/group open interest

Parameters

Return Values

_updatePairOi

Function to update a borrowing group’s open interest

Parameters

_updateGroupOi

Function to update a borrowing group’s open interest

Parameters

_getBorrowingPairGroupAccFeesDeltas

_Calculates the borrowing group and pair acc fees deltas for a trade between pair group at index i and next one

Parameters

Return Values

_setPairPendingAccFees

Parameters

Return Values

_setGroupPendingAccFees

Parameters

Return Values