initializeCallbacks
Parameters
| Name | Type | Description |
|---|---|---|
| _vaultClosingFeeP | uint8 | the % of closing fee going to vault |
initializeTreasuryAddress
Parameters
| Name | Type | Description |
|---|---|---|
| _treasury | address | the treasury address |
updateVaultClosingFeeP
Parameters
| Name | Type | Description |
|---|---|---|
| _valueP | uint8 | the % of closing fee going to vault |
updateTreasuryAddress
Parameters
| Name | Type | Description |
|---|---|---|
| _treasury | address | the new treasury address |
claimPendingGovFees
openTradeMarketCallback
Parameters
| Name | Type | Description |
|---|---|---|
| _a | ITradingCallbacks.AggregatorAnswer | the price aggregator answer (order id, price, etc.) |
closeTradeMarketCallback
Parameters
| Name | Type | Description |
|---|---|---|
| _a | ITradingCallbacks.AggregatorAnswer | the price aggregator answer (order id, price, etc.) |
executeTriggerOpenOrderCallback
Parameters
| Name | Type | Description |
|---|---|---|
| _a | ITradingCallbacks.AggregatorAnswer | the price aggregator answer (order id, price, etc.) |
executeTriggerCloseOrderCallback
Parameters
| Name | Type | Description |
|---|---|---|
| _a | ITradingCallbacks.AggregatorAnswer | the price aggregator answer (order id, price, etc.) |
updateLeverageCallback
Parameters
| Name | Type | Description |
|---|---|---|
| _a | ITradingCallbacks.AggregatorAnswer | the price aggregator answer (order id, price, etc.) |
increasePositionSizeMarketCallback
Parameters
| Name | Type | Description |
|---|---|---|
| _a | ITradingCallbacks.AggregatorAnswer | the price aggregator answer (order id, price, etc.) |
decreasePositionSizeMarketCallback
Parameters
| Name | Type | Description |
|---|---|---|
| _a | ITradingCallbacks.AggregatorAnswer | the price aggregator answer (order id, price, etc.) |
getVaultClosingFeeP
getPendingGovFeesCollateral
validateTriggerOpenOrderCallback
Parameters
| Name | Type | Description |
|---|---|---|
| _tradeId | ITradingStorage.Id | 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
Parameters
| Name | Type | Description |
|---|---|---|
| _tradeId | ITradingStorage.Id | 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 |
VaultClosingFeePUpdated
Parameters
| Name | Type | Description |
|---|---|---|
| valueP | uint8 | the % of closing fee going to vault |
PendingGovFeesClaimed
Parameters
| Name | Type | Description |
|---|---|---|
| collateralIndex | uint8 | the collateral index |
| amountCollateral | uint256 | the amount of fees claimed (collateral precision) |
MarketExecuted
Parameters
| Name | Type | Description |
|---|---|---|
| orderId | struct ITradingStorage.Id | the id of the corresponding pending market order |
| user | address | trade user |
| index | uint32 | trade index |
| t | struct ITradingStorage.Trade | the trade object |
| open | bool | true for a market open order, false for a market close order |
| oraclePrice | uint256 | the oracle price without spread/impact (1e10 precision) |
| marketPrice | uint256 | the price at which the trade was executed (1e10 precision) |
| liqPrice | uint256 | trade liquidation price (1e10 precision) |
| priceImpactP | uint256 | the price impact in percentage (1e10 precision) |
| percentProfit | int256 | the profit in percentage (1e10 precision) |
| amountSentToTrader | uint256 | the final amount of collateral sent to the trader |
| collateralPriceUsd | uint256 | the price of the collateral in USD (1e8 precision) |
LimitExecuted
Parameters
| Name | Type | Description |
|---|---|---|
| orderId | struct ITradingStorage.Id | the id of the corresponding pending trigger order |
| user | address | trade user |
| index | uint32 | trade index |
| limitIndex | uint32 | limit index |
| t | struct ITradingStorage.Trade | the trade object |
| triggerCaller | address | the address that triggered the limit order |
| orderType | enum ITradingStorage.PendingOrderType | the type of the pending order |
| oraclePrice | uint256 | the oracle price without spread/impact (1e10 precision) |
| marketPrice | uint256 | the price at which the trade was executed (1e10 precision) |
| liqPrice | uint256 | trade liquidation price (1e10 precision) |
| priceImpactP | uint256 | the price impact in percentage (1e10 precision) |
| percentProfit | int256 | the profit in percentage (1e10 precision) |
| amountSentToTrader | uint256 | the final amount of collateral sent to the trader |
| collateralPriceUsd | uint256 | the price of the collateral in USD (1e8 precision) |
| exactExecution | bool | true if guaranteed execution was used |
MarketOpenCanceled
Parameters
| Name | Type | Description |
|---|---|---|
| orderId | struct ITradingStorage.Id | order id of the pending market open order |
| trader | address | address of the trader |
| pairIndex | uint256 | index of the trading pair |
| cancelReason | enum ITradingCallbacks.CancelReason | reason for the cancellation |
MarketCloseCanceled
Parameters
| Name | Type | Description |
|---|---|---|
| orderId | struct ITradingStorage.Id | order id of the pending market close order |
| trader | address | address of the trader |
| pairIndex | uint256 | index of the trading pair |
| index | uint256 | index of the trade for trader |
| cancelReason | enum ITradingCallbacks.CancelReason | reason for the cancellation |
TriggerOrderCanceled
Parameters
| Name | Type | Description |
|---|---|---|
| orderId | struct ITradingStorage.Id | order id of the pending trigger order |
| triggerCaller | address | address of the trigger caller |
| orderType | enum ITradingStorage.PendingOrderType | type of the pending trigger order |
| cancelReason | enum ITradingCallbacks.CancelReason | reason for the cancellation |
BorrowingFeeCharged
Parameters
| Name | Type | Description |
|---|---|---|
| trader | address | address of the trader |
| index | uint32 | index of the trade |
| collateralIndex | uint8 | index of the collateral |
| amountCollateral | uint256 | amount charged (collateral precision) |
