Skip to main content
GNSTradingCallbacks facet internal library

tradingActivated

Modifier to only allow trading action when trading is activated (= revert if not activated)

tradingActivatedOrCloseOnly

Modifier to only allow trading action when trading is activated or close only (= revert if paused)

initializeCallbacks

Check ITradingCallbacksUtils interface for documentation

updateVaultClosingFeeP

Check ITradingCallbacksUtils interface for documentation

updateTreasuryAddress

Check ITradingCallbacksUtils interface for documentation

claimPendingGovFees

Check ITradingCallbacksUtils interface for documentation

openTradeMarketCallback

Check ITradingCallbacksUtils interface for documentation

closeTradeMarketCallback

Check ITradingCallbacksUtils interface for documentation

executeTriggerOpenOrderCallback

Check ITradingCallbacksUtils interface for documentation

executeTriggerCloseOrderCallback

Check ITradingCallbacksUtils interface for documentation

updateLeverageCallback

Check ITradingCallbacksUtils interface for documentation

increasePositionSizeMarketCallback

Check ITradingCallbacksUtils interface for documentation

decreasePositionSizeMarketCallback

Check ITradingCallbacksUtils interface for documentation

getVaultClosingFeeP

Check ITradingCallbacksUtils interface for documentation

getPendingGovFeesCollateral

Check ITradingCallbacksUtils interface for documentation

validateTriggerOpenOrderCallback

Check ITradingCallbacksUtils interface for documentation

validateTriggerCloseOrderCallback

Check ITradingCallbacksUtils 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.

_registerTrade

Registers a trade in storage, and handles all fees and rewards

Parameters

Return Values

_unregisterTrade

Unregisters a trade from storage, and handles all fees and rewards

Parameters

Return Values

_openTradePrep

Makes pre-trade checks: price impact, if trade should be cancelled based on parameters like: PnL, leverage, slippage, etc.

Parameters

_getPendingOrder

Returns pending order from storage

Parameters

Return Values

_getCollateralPriceUsd

Returns collateral price in USD

Parameters

Return Values

_getTrade

Returns trade from storage

Parameters

Return Values

_getTradeInfo

Returns trade info from storage

Parameters

Return Values