ConstantsUtils
Internal library for important constants commonly used in many places
P_10
uint256 P_10
MAX_PNL_P
uint256 MAX_PNL_P
SL_LIQ_BUFFER_P
uint256 SL_LIQ_BUFFER_P
LEGACY_LIQ_THRESHOLD_P
uint256 LEGACY_LIQ_THRESHOLD_P
MIN_LIQ_THRESHOLD_P
uint256 MIN_LIQ_THRESHOLD_P
MAX_OPEN_NEGATIVE_PNL_P
uint256 MAX_OPEN_NEGATIVE_PNL_P
MAX_LIQ_SPREAD_P
uint256 MAX_LIQ_SPREAD_P
DEFAULT_MAX_CLOSING_SLIPPAGE_P
uint16 DEFAULT_MAX_CLOSING_SLIPPAGE_P
getMarketOrderTypes
function getMarketOrderTypes() internal pure returns (enum ITradingStorage.PendingOrderType[5])
getPendingOpenOrderType
function getPendingOpenOrderType(enum ITradingStorage.TradeType _tradeType) internal pure returns (enum ITradingStorage.PendingOrderType)
Returns pending order type (market open/limit open/stop open) for a trade type (trade/limit/stop)
Parameters
Name
Type
Description
_tradeType
enum ITradingStorage.TradeType
the trade type
isOrderTypeMarket
function isOrderTypeMarket(enum ITradingStorage.PendingOrderType _orderType) internal pure returns (bool)
Returns true if order type is market
Parameters
Name
Type
Description
_orderType
enum ITradingStorage.PendingOrderType
order type
Was this helpful?