GNSTradingCallbacks
Facet #8: Callbacks (to execute actions after receiving median price from price aggregator)
constructor
initializeCallbacks
Parameters
Name | Type | Description |
---|---|---|
_vaultClosingFeeP | uint8 | the % of closing fee going to vault |
initializeTreasuryAddress
Initialize the treasury address
Parameters
Name | Type | Description |
---|---|---|
_treasury | address | the treasury address |
updateVaultClosingFeeP
Update the % of closing fee going to vault
Parameters
Name | Type | Description |
---|---|---|
_valueP | uint8 | the % of closing fee going to vault |
updateTreasuryAddress
Updates the treasury address
Parameters
Name | Type | Description |
---|---|---|
_treasury | address | the new treasury address |
claimPendingGovFees
Claim the pending gov fees for all collaterals
openTradeMarketCallback
Executes a pending open trade market order
Parameters
Name | Type | Description |
---|---|---|
_a | the price aggregator answer (order id, price, etc.) |
closeTradeMarketCallback
Executes a pending close trade market order
Parameters
Name | Type | Description |
---|---|---|
_a | the price aggregator answer (order id, price, etc.) |
executeTriggerOpenOrderCallback
Executes a pending open trigger order (for limit/stop orders)
Parameters
Name | Type | Description |
---|---|---|
_a | the price aggregator answer (order id, price, etc.) |
executeTriggerCloseOrderCallback
Executes a pending close trigger order (for tp/sl/liq orders)
Parameters
Name | Type | Description |
---|---|---|
_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
Name | Type | Description |
---|---|---|
_a | the price aggregator answer (order id, price, etc.) |
increasePositionSizeMarketCallback
Executes a pending increase position size market order
Parameters
Name | Type | Description |
---|---|---|
_a | the price aggregator answer (order id, price, etc.) |
decreasePositionSizeMarketCallback
Executes a pending decrease position size market order
Parameters
Name | Type | Description |
---|---|---|
_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
Name | Type | Description |
---|---|---|
_tradeId | the id of the trade | |
_orderType | enum ITradingStorage.PendingOrderType | the pending order type |
_open | uint64 | the |
_high | uint64 | the |
_low | uint64 | the |
validateTriggerCloseOrderCallback
Makes close trigger (SL/TP/LIQ) checks like slippage and price impact and returns cancellation reason if any
Parameters
Name | Type | Description |
---|---|---|
_tradeId | the id of the trade | |
_orderType | enum ITradingStorage.PendingOrderType | the pending order type |
_open | uint64 | the |
_high | uint64 | the |
_low | uint64 | the |
Last updated