-
Notifications
You must be signed in to change notification settings - Fork 604
/
Copy pathIPerpsV2MarketState.sol
95 lines (59 loc) · 2.86 KB
/
IPerpsV2MarketState.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
85
86
87
88
89
90
91
92
93
94
95
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
import "./IPerpsV2MarketBaseTypes.sol";
// https://docs.synthetix.io/contracts/source/contracts/PerpsV2MarketState
interface IPerpsV2MarketState {
function marketKey() external view returns (bytes32);
function baseAsset() external view returns (bytes32);
function marketSize() external view returns (uint128);
function marketSkew() external view returns (int128);
function fundingLastRecomputed() external view returns (uint32);
function fundingSequence(uint) external view returns (int128);
function fundingRateLastRecomputed() external view returns (int128);
function positions(address) external view returns (IPerpsV2MarketBaseTypes.Position memory);
function delayedOrders(address) external view returns (IPerpsV2MarketBaseTypes.DelayedOrder memory);
function positionFlagger(address) external view returns (address);
function entryDebtCorrection() external view returns (int128);
function nextPositionId() external view returns (uint64);
function fundingSequenceLength() external view returns (uint);
function isFlagged(address) external view returns (bool);
function getPositionAddressesPage(uint, uint) external view returns (address[] memory);
function getPositionAddressesLength() external view returns (uint);
function getDelayedOrderAddressesPage(uint, uint) external view returns (address[] memory);
function getDelayedOrderAddressesLength() external view returns (uint);
function getFlaggedAddressesPage(uint, uint) external view returns (address[] memory);
function getFlaggedAddressesLength() external view returns (uint);
function setMarketKey(bytes32) external;
function setBaseAsset(bytes32) external;
function setMarketSize(uint128) external;
function setEntryDebtCorrection(int128) external;
function setNextPositionId(uint64) external;
function setMarketSkew(int128) external;
function setFundingLastRecomputed(uint32) external;
function setFundingRateLastRecomputed(int128 _fundingRateLastRecomputed) external;
function pushFundingSequence(int128) external;
function updatePosition(
address account,
uint64 id,
uint64 lastFundingIndex,
uint128 margin,
uint128 lastPrice,
int128 size
) external;
function updateDelayedOrder(
address account,
bool isOffchain,
int128 sizeDelta,
uint128 desiredFillPrice,
uint128 targetRoundId,
uint128 commitDeposit,
uint128 keeperDeposit,
uint256 executableAtTime,
uint256 intentionTime,
bytes32 trackingCode
) external;
function deletePosition(address) external;
function deleteDelayedOrder(address) external;
function flag(address account, address flagger) external;
function unflag(address) external;
}