forked from dydxprotocol/v4-chain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
103 lines (99 loc) · 2.22 KB
/
types.go
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
96
97
98
99
100
101
102
103
package types
import (
"math/big"
pricestypes "github.com/StreamFinance-Protocol/stream-chain/protocol/x/prices/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)
// GetPricePremiumParams includes the parameters used by
// `ClobKeeper.GetPricePremiumForPerpetual` and
// `MemClob.GetPricePremium` to get the price premium.
type GetPricePremiumParams struct {
IndexPrice pricestypes.MarketPrice
BaseAtomicResolution int32
QuoteAtomicResolution int32
ImpactNotionalQuoteQuantums *big.Int
MaxAbsPremiumVotePpm *big.Int
}
// Interface used by ABCI calls to access the perpetuals keeper.
type PerpetualsKeeper interface {
MaybeProcessNewFundingTickEpoch(ctx sdk.Context)
MaybeProcessNewFundingSampleEpoch(ctx sdk.Context)
AddPremiumVotes(ctx sdk.Context, votes []FundingPremium) error
GetNetNotional(
ctx sdk.Context,
id uint32,
bigQuantums *big.Int,
) (
bigNetNotionalQuoteQuantums *big.Int,
err error,
)
GetNotionalInBaseQuantums(
ctx sdk.Context,
id uint32,
bigQuoteQuantums *big.Int,
) (
bigBaseQuantums *big.Int,
err error,
)
GetNetCollateral(
ctx sdk.Context,
id uint32,
bigQuantums *big.Int,
) (
bigNetCollateralQuoteQuantums *big.Int,
err error,
)
GetMarginRequirements(
ctx sdk.Context,
id uint32,
bigQuantums *big.Int,
) (
bigInitialMarginQuoteQuantums *big.Int,
bigMaintenanceMarginQuoteQuantums *big.Int,
err error,
)
GetAddPremiumVotes(
ctx sdk.Context,
) (
msgAddPremiumVotes *MsgAddPremiumVotes,
)
PerformStatefulPremiumVotesValidation(
ctx sdk.Context,
msg *MsgAddPremiumVotes,
) (
err error,
)
HasAuthority(authority string) bool
CreatePerpetual(
ctx sdk.Context,
id uint32,
ticker string,
marketId uint32,
atomicResolution int32,
defaultFundingPpm int32,
liquidityTier uint32,
) (Perpetual, error)
ModifyPerpetual(
ctx sdk.Context,
id uint32,
ticker string,
marketId uint32,
defaultFundingPpm int32,
liquidityTier uint32,
) (Perpetual, error)
SetLiquidityTier(
ctx sdk.Context,
id uint32,
name string,
initialMarginPpm uint32,
maintenanceFractionPpm uint32,
impactNotional uint64,
) (
liquidityTier LiquidityTier,
err error,
)
SetParams(
ctx sdk.Context,
params Params,
) error
}