GNSTradingCallbacks
Facet #8: Callbacks (to execute actions after receiving median price from price aggregator)
constructor
initializeCallbacks
Parameters
_vaultClosingFeeP
uint8
the % of closing fee going to vault
initializeTreasuryAddress
Initialize the treasury address
Parameters
_treasury
address
the treasury address
updateVaultClosingFeeP
Update the % of closing fee going to vault
Parameters
_valueP
uint8
the % of closing fee going to vault
updateTreasuryAddress
Updates the treasury address
Parameters
_treasury
address
the new treasury address
claimPendingGovFees
Claim the pending gov fees for all collaterals
openTradeMarketCallback
Executes a pending open trade market order
Parameters
_a
the price aggregator answer (order id, price, etc.)
closeTradeMarketCallback
Executes a pending close trade market order
Parameters
_a
the price aggregator answer (order id, price, etc.)
executeTriggerOpenOrderCallback
Executes a pending open trigger order (for limit/stop orders)
Parameters
_a
the price aggregator answer (order id, price, etc.)
executeTriggerCloseOrderCallback
Executes a pending close trigger order (for tp/sl/liq orders)
Parameters
_a
the price aggregator answer (order id, price, etc.)
getVaultClosingFeeP
Returns the current vaultClosingFeeP value (%)
getPendingGovFeesCollateral
Returns the current pending gov fees for a collateral index (collateral precision)
updateLeverageCallback
Executes a pending update leverage order
Parameters
_a
the price aggregator answer (order id, price, etc.)
increasePositionSizeMarketCallback
Executes a pending increase position size market order
Parameters
_a
the price aggregator answer (order id, price, etc.)
decreasePositionSizeMarketCallback
Executes a pending decrease position size market order
Parameters
_a
the price aggregator answer (order id, price, etc.)
validateTriggerOpenOrderCallback
Makes open trigger (STOP/LIMIT) checks like slippage, price impact, missed targets and returns cancellation reason if any
Parameters
_tradeId
the id of the trade
_orderType
enum ITradingStorage.PendingOrderType
the pending order type
_open
uint64
the open
value from an aggregator answer
_high
uint64
the high
value from an aggregator answer
_low
uint64
the low
value from an aggregator answer
validateTriggerCloseOrderCallback
Makes close trigger (SL/TP/LIQ) checks like slippage and price impact and returns cancellation reason if any
Parameters
_tradeId
the id of the trade
_orderType
enum ITradingStorage.PendingOrderType
the pending order type
_open
uint64
the open
value from an aggregator answer
_high
uint64
the high
value from an aggregator answer
_low
uint64
the low
value from an aggregator answer
Last updated