PerpsV2MarketBase¶
Description¶
Source: contracts/PerpsV2MarketBase.sol
Structs¶
TradeParams
¶
Field | Type | Description |
---|---|---|
sizeDelta |
int256 |
TBA |
oraclePrice |
uint256 |
TBA |
fillPrice |
uint256 |
TBA |
desiredFillPrice |
uint256 |
TBA |
takerFee |
uint256 |
TBA |
makerFee |
uint256 |
TBA |
trackingCode |
bytes32 |
TBA |
Variables¶
marketState
¶
Type: contract IPerpsV2MarketState
Constructor¶
constructor
¶
Details
Signature
constructor(address _marketState, address _owner, address _resolver)
Visibility
public
State Mutability
``
Views¶
resolverAddressesRequired
¶
Details
Signature
resolverAddressesRequired() view returns (bytes32[] addresses)
Visibility
public
State Mutability
view
Internal Functions¶
_abs
¶
Details
Signature
_abs(int256 x) pure returns (uint256)
Visibility
internal
State Mutability
pure
_accessibleMargin
¶
Details
Signature
_accessibleMargin(struct IPerpsV2MarketBaseTypes.Position position, uint256 price) view returns (uint256)
Visibility
internal
State Mutability
view
_accruedFunding
¶
Details
Signature
_accruedFunding(struct IPerpsV2MarketBaseTypes.Position position, uint256 price) view returns (int256 funding)
Visibility
internal
State Mutability
view
_assetPrice
¶
Details
Signature
_assetPrice() view returns (uint256 price, bool invalid)
Visibility
internal
State Mutability
view
_baseAsset
¶
Details
Signature
_baseAsset() view returns (bytes32)
Visibility
internal
State Mutability
view
_canLiquidate
¶
Details
Signature
_canLiquidate(struct IPerpsV2MarketBaseTypes.Position position, uint256 price) view returns (bool)
Visibility
internal
State Mutability
view
_currentFundingRate
¶
Details
Signature
_currentFundingRate() view returns (int256)
Visibility
internal
State Mutability
view
_currentFundingVelocity
¶
Details
Signature
_currentFundingVelocity() view returns (int256)
Visibility
internal
State Mutability
view
_currentLeverage
¶
Details
Signature
_currentLeverage(struct IPerpsV2MarketBaseTypes.Position position, uint256 price, uint256 remainingMargin_) pure returns (int256 leverage)
Visibility
internal
State Mutability
pure
_dynamicFeeRate
¶
Details
Signature
_dynamicFeeRate() view returns (uint256 feeRate, bool tooVolatile)
Visibility
internal
State Mutability
view
_exchangeRates
¶
Details
Signature
_exchangeRates() view returns (contract IExchangeRates)
Visibility
internal
State Mutability
view
_exchanger
¶
Details
Signature
_exchanger() view returns (contract IExchanger)
Visibility
internal
State Mutability
view
_fillPrice
¶
Details
Signature
_fillPrice(int256 size, uint256 price) view returns (uint256)
Visibility
internal
State Mutability
view
_isError
¶
Details
Signature
_isError(enum IPerpsV2MarketBaseTypes.Status status) pure returns (bool)
Visibility
internal
State Mutability
pure
_latestFundingIndex
¶
Details
Signature
_latestFundingIndex() view returns (uint256)
Visibility
internal
State Mutability
view
_liquidationFee
¶
Details
Signature
_liquidationFee(int256 positionSize, uint256 price) view returns (uint256 lFee)
Visibility
internal
State Mutability
view
_liquidationMargin
¶
Details
Signature
_liquidationMargin(int256 positionSize, uint256 price) view returns (uint256 lMargin)
Visibility
internal
State Mutability
view
_liquidationPremium
¶
Details
Signature
_liquidationPremium(int256 positionSize, uint256 currentPrice) view returns (uint256)
Visibility
internal
State Mutability
view
_manager
¶
Details
Signature
_manager() view returns (contract IFuturesMarketManagerInternal)
Visibility
internal
State Mutability
view
_marginPlusProfitFunding
¶
Details
Signature
_marginPlusProfitFunding(struct IPerpsV2MarketBaseTypes.Position position, uint256 price) view returns (int256)
Visibility
internal
State Mutability
view
_marketKey
¶
Details
Signature
_marketKey() view returns (bytes32)
Visibility
internal
State Mutability
view
_max
¶
Details
Signature
_max(int256 x, int256 y) pure returns (int256)
Visibility
internal
State Mutability
pure
_min
¶
Details
Signature
_min(int256 x, int256 y) pure returns (int256)
Visibility
internal
State Mutability
pure
_netFundingPerUnit
¶
Details
Signature
_netFundingPerUnit(uint256 startIndex, uint256 price) view returns (int256)
Visibility
internal
State Mutability
view
_nextFundingEntry
¶
Details
Signature
_nextFundingEntry(uint256 price) view returns (int256)
Visibility
internal
State Mutability
view
_notionalValue
¶
Details
Signature
_notionalValue(int256 positionSize, uint256 price) pure returns (int256 value)
Visibility
internal
State Mutability
pure
_orderFee
¶
Details
Signature
_orderFee(struct PerpsV2MarketBase.TradeParams params, uint256 dynamicFeeRate) view returns (uint256 fee)
Visibility
internal
State Mutability
view
_orderSizeTooLarge
¶
Details
Signature
_orderSizeTooLarge(uint256 maxSize, int256 oldSize, int256 newSize) view returns (bool)
Visibility
internal
State Mutability
view
_postTradeDetails
¶
Details
Signature
_postTradeDetails(struct IPerpsV2MarketBaseTypes.Position oldPos, struct PerpsV2MarketBase.TradeParams params) view returns (struct IPerpsV2MarketBaseTypes.Position newPosition, uint256 fee, enum IPerpsV2MarketBaseTypes.Status tradeStatus)
Visibility
internal
State Mutability
view
_profitLoss
¶
Details
Signature
_profitLoss(struct IPerpsV2MarketBaseTypes.Position position, uint256 price) pure returns (int256 pnl)
Visibility
internal
State Mutability
pure
_proportionalElapsed
¶
Details
Signature
_proportionalElapsed() view returns (int256)
Visibility
internal
State Mutability
view
_proportionalSkew
¶
Details
Signature
_proportionalSkew() view returns (int256)
Visibility
internal
State Mutability
view
_recomputeMarginWithDelta
¶
Details
Signature
_recomputeMarginWithDelta(struct IPerpsV2MarketBaseTypes.Position position, uint256 price, int256 marginDelta) view returns (uint256 margin, enum IPerpsV2MarketBaseTypes.Status statusCode)
Visibility
internal
State Mutability
view
_remainingLiquidatableMargin
¶
Details
Signature
_remainingLiquidatableMargin(struct IPerpsV2MarketBaseTypes.Position position, uint256 price) view returns (uint256)
Visibility
internal
State Mutability
view
_remainingMargin
¶
Details
Signature
_remainingMargin(struct IPerpsV2MarketBaseTypes.Position position, uint256 price) view returns (uint256)
Visibility
internal
State Mutability
view
_revertIfError
¶
Details
Signature
_revertIfError(bool isError, enum IPerpsV2MarketBaseTypes.Status status) view
Visibility
internal
State Mutability
view
_sameSide
¶
Details
Signature
_sameSide(int256 a, int256 b) pure returns (bool)
Visibility
internal
State Mutability
pure
_settings
¶
Details
Signature
_settings() view returns (address)
Visibility
internal
State Mutability
view
_signedAbs
¶
Details
Signature
_signedAbs(int256 x) pure returns (int256)
Visibility
internal
State Mutability
pure
_systemStatus
¶
Details
Signature
_systemStatus() view returns (contract ISystemStatus)
Visibility
internal
State Mutability
view
_unrecordedFunding
¶
Details
Signature
_unrecordedFunding(uint256 price) view returns (int256)
Visibility
internal
State Mutability
view