JavTradingProcessing
General Description
The JavTradingProcessing contract used for manages various trading-related functions, primarily focused on processing and handling market orders, trigger orders, and associated fees. It includes functionality to initialize trading processing, manage the vault's closing fees, and claim pending governance fees related to collateral. Additionally, the contract allows users to open and close market orders, as well as execute trigger-based open and close orders. It provides important getter functions to retrieve current system states, such as the vault closing fee percentage and pending governance fees for specific collaterals.
Core Functionalities
initializeTradingProcessing
initializeTradingProcessing
Initializes the trading processing system with a specified parameter.
Parameters:
_valueP
: A parameter to initialize the trading system (value type depends on the context, but expected to be a percentage).
Access Control: Public.
updateVaultClosingFeeP
updateVaultClosingFeeP
Updates the percentage of the closing fee that will be sent to the vault.
Parameters:
_valueP
: The percentage of the closing fee going to the vault.
Access Control: Public.
claimPendingGovFees
claimPendingGovFees
Claims the pending governance fees for all collaterals.
Access Control: Public.
Getter Functions
getVaultClosingFeeP
getVaultClosingFeeP
Retrieves the current vault closing fee percentage.
Returns:
uint8
– The percentage of the closing fee going to the vault.Access Control: Public.
getPendingGovFeesCollateral
getPendingGovFeesCollateral
Retrieves the current pending governance fees for a specified collateral index.
Parameters:
_collateralIndex
: The index of the collateral for which pending fees are being retrieved.
Returns:
uint256
– The pending governance fees for the specified collateral (collateral precision).Access Control: Public.
Market Order Management
openTradeMarketOrder
openTradeMarketOrder
Opens a market order based on the specified pending order data.
Parameters:
_pendingOrder
: A structure containing the details of the pending order to be processed.
Access Control: Public.
closeTradeMarketOrder
closeTradeMarketOrder
Closes a market order based on the specified pending order data.
Parameters:
_pendingOrder
: A structure containing the details of the pending order to be closed.
Access Control: Public.
executeTriggerOpenOrder
executeTriggerOpenOrder
Executes a trigger to open an order based on the specified pending order data.
Parameters:
_pendingOrder
: A structure containing the details of the trigger open order.
Access Control: Public.
executeTriggerCloseOrder
executeTriggerCloseOrder
Executes a trigger to close an order based on the specified pending order data.
Parameters:
_pendingOrder
: A structure containing the details of the trigger close order.
Access Control: Public.
Last updated