-
Notifications
You must be signed in to change notification settings - Fork 601
/
IPerpsV2MarketViews.sol
84 lines (53 loc) · 2.89 KB
/
IPerpsV2MarketViews.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
import "./IPerpsV2MarketBaseTypes.sol";
interface IPerpsV2MarketViews {
/* ---------- Market Details ---------- */
function marketKey() external view returns (bytes32 key);
function baseAsset() external view returns (bytes32 key);
function marketSize() external view returns (uint128 size);
function marketSkew() external view returns (int128 skew);
function fundingLastRecomputed() external view returns (uint32 timestamp);
function fundingRateLastRecomputed() external view returns (int128 fundingRate);
function fundingSequence(uint index) external view returns (int128 netFunding);
function positions(address account) external view returns (IPerpsV2MarketBaseTypes.Position memory);
function delayedOrders(address account) external view returns (IPerpsV2MarketBaseTypes.DelayedOrder memory);
function assetPrice() external view returns (uint price, bool invalid);
function fillPrice(int sizeDelta) external view returns (uint price, bool invalid);
function marketSizes() external view returns (uint long, uint short);
function marketDebt() external view returns (uint debt, bool isInvalid);
function currentFundingRate() external view returns (int fundingRate);
function currentFundingVelocity() external view returns (int fundingVelocity);
function unrecordedFunding() external view returns (int funding, bool invalid);
function fundingSequenceLength() external view returns (uint length);
/* ---------- Position Details ---------- */
function notionalValue(address account) external view returns (int value, bool invalid);
function profitLoss(address account) external view returns (int pnl, bool invalid);
function accruedFunding(address account) external view returns (int funding, bool invalid);
function remainingMargin(address account) external view returns (uint marginRemaining, bool invalid);
function accessibleMargin(address account) external view returns (uint marginAccessible, bool invalid);
function liquidationPrice(address account) external view returns (uint price, bool invalid);
function liquidationFee(address account) external view returns (uint);
function isFlagged(address account) external view returns (bool);
function canLiquidate(address account) external view returns (bool);
function orderFee(int sizeDelta, IPerpsV2MarketBaseTypes.OrderType orderType)
external
view
returns (uint fee, bool invalid);
function postTradeDetails(
int sizeDelta,
uint tradePrice,
IPerpsV2MarketBaseTypes.OrderType orderType,
address sender
)
external
view
returns (
uint margin,
int size,
uint price,
uint liqPrice,
uint fee,
IPerpsV2MarketBaseTypes.Status status
);
}