Skip to content

PerpsV2MarketViews

Description

Source: contracts/PerpsV2MarketViews.sol

Constructor

constructor

Source

Details

Signature

constructor(address _marketState, address _owner, address _resolver)

Visibility

public

State Mutability

``

Views

accessibleMargin

Source

Details

Signature

accessibleMargin(address account) view returns (uint256 marginAccessible, bool invalid)

Visibility

external

State Mutability

view

accruedFunding

Source

Details

Signature

accruedFunding(address account) view returns (int256 funding, bool invalid)

Visibility

external

State Mutability

view

assetPrice

Source

Details

Signature

assetPrice() view returns (uint256 price, bool invalid)

Visibility

external

State Mutability

view

baseAsset

Source

Details

Signature

baseAsset() view returns (bytes32 key)

Visibility

external

State Mutability

view

canLiquidate

Source

Details

Signature

canLiquidate(address account) view returns (bool)

Visibility

external

State Mutability

view

currentFundingRate

Source

Details

Signature

currentFundingRate() view returns (int256)

Visibility

external

State Mutability

view

currentFundingVelocity

Source

Details

Signature

currentFundingVelocity() view returns (int256)

Visibility

external

State Mutability

view

fillPrice

Source

Details

Signature

fillPrice(int256 sizeDelta) view returns (uint256 price, bool invalid)

Visibility

external

State Mutability

view

fundingLastRecomputed

Source

Details

Signature

fundingLastRecomputed() view returns (uint32)

Visibility

external

State Mutability

view

fundingSequence

Source

Details

Signature

fundingSequence(uint256 index) view returns (int128)

Visibility

external

State Mutability

view

fundingSequenceLength

Source

Details

Signature

fundingSequenceLength() view returns (uint256)

Visibility

external

State Mutability

view

liquidationFee

Source

Details

Signature

liquidationFee(address account) view returns (uint256)

Visibility

external

State Mutability

view

liquidationPrice

Source

Details

Signature

liquidationPrice(address account) view returns (uint256 price, bool invalid)

Visibility

external

State Mutability

view

marketDebt

Source

Details

Signature

marketDebt() view returns (uint256 debt, bool invalid)

Visibility

external

State Mutability

view

marketKey

Source

Details

Signature

marketKey() view returns (bytes32 key)

Visibility

external

State Mutability

view

marketSize

Source

Details

Signature

marketSize() view returns (uint128)

Visibility

external

State Mutability

view

marketSizes

Source

Details

Signature

marketSizes() view returns (uint256 long, uint256 short)

Visibility

external

State Mutability

view

marketSkew

Source

Details

Signature

marketSkew() view returns (int128)

Visibility

external

State Mutability

view

notionalValue

Source

Details

Signature

notionalValue(address account) view returns (int256 value, bool invalid)

Visibility

external

State Mutability

view

orderFee

Source

Details

Signature

orderFee(int256 sizeDelta, enum IPerpsV2MarketBaseTypes.OrderType orderType) view returns (uint256 fee, bool invalid)

Visibility

external

State Mutability

view

positions

Source

Details

Signature

positions(address account) view returns (struct IPerpsV2MarketBaseTypes.Position)

Visibility

external

State Mutability

view

postTradeDetails

Source

Details

Signature

postTradeDetails(int256 sizeDelta, uint256 tradePrice, enum IPerpsV2MarketBaseTypes.OrderType orderType, address sender) view returns (uint256 margin, int256 size, uint256 price, uint256 liqPrice, uint256 fee, enum IPerpsV2MarketBaseTypes.Status status)

Visibility

external

State Mutability

view

profitLoss

Source

Details

Signature

profitLoss(address account) view returns (int256 pnl, bool invalid)

Visibility

external

State Mutability

view

remainingMargin

Source

Details

Signature

remainingMargin(address account) view returns (uint256 marginRemaining, bool invalid)

Visibility

external

State Mutability

view

unrecordedFunding

Source

Details

Signature

unrecordedFunding() view returns (int256 funding, bool invalid)

Visibility

external

State Mutability

view

Internal Functions

_approxLiquidationPrice

Source

Details

Signature

_approxLiquidationPrice(struct IPerpsV2MarketBaseTypes.Position position, uint256 currentPrice) view returns (uint256)

Visibility

internal

State Mutability

view

_makerTakeFeeByOrderType

Source

Details

Signature

_makerTakeFeeByOrderType(enum IPerpsV2MarketBaseTypes.OrderType orderType) view returns (uint256 makerFee, uint256 takerFee, bool invalid)

Visibility

internal

State Mutability

view

_marketDebt

Source

Details

Signature

_marketDebt(uint256 price) view returns (uint256)

Visibility

internal

State Mutability

view

_simulationTradePrice

Source

Details

Signature

_simulationTradePrice(uint256 tradePrice) view returns (uint256, bool)

Visibility

internal

State Mutability

view