/
liquidations_config.proto
65 lines (53 loc) · 2.51 KB
/
liquidations_config.proto
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
syntax = "proto3";
package dydxprotocol.clob;
import "gogoproto/gogo.proto";
option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/clob/types";
// LiquidationsConfig stores all configurable fields related to liquidations.
message LiquidationsConfig {
// The maximum liquidation fee (in parts-per-million). This fee goes
// 100% to the insurance fund.
uint32 max_liquidation_fee_ppm = 1;
// Limits around how much of a single position can be liquidated
// within a single block.
PositionBlockLimits position_block_limits = 2
[ (gogoproto.nullable) = false ];
// Limits around how many quote quantums from a single subaccount can
// be liquidated within a single block.
SubaccountBlockLimits subaccount_block_limits = 3
[ (gogoproto.nullable) = false ];
// Config about how the fillable-price spread from the oracle price
// increases based on the adjusted bankruptcy rating of the subaccount.
FillablePriceConfig fillable_price_config = 4
[ (gogoproto.nullable) = false ];
}
// PositionBlockLimits stores all configurable fields related to limits
// around how much of a single position can be liquidated within a single block.
message PositionBlockLimits {
// The minimum amount of quantums to liquidate for each message (in
// quote quantums).
// Overridden by the maximum size of the position.
uint64 min_position_notional_liquidated = 1;
// The maximum portion of the position liquidated (in parts-per-
// million). Overridden by min_position_notional_liquidated.
uint32 max_position_portion_liquidated_ppm = 2;
}
// SubaccountBlockLimits stores all configurable fields related to limits
// around how many quote quantums from a single subaccount can
// be liquidated within a single block.
message SubaccountBlockLimits {
// The maximum notional amount that a single subaccount can have
// liquidated (in quote quantums) per block.
uint64 max_notional_liquidated = 1;
// The maximum insurance-fund payout amount for a given subaccount
// per block. I.e. how much it can cover for that subaccount.
uint64 max_quantums_insurance_lost = 2;
}
// FillablePriceConfig stores all configurable fields related to calculating
// the fillable price for liquidating a position.
message FillablePriceConfig {
// The rate at which the Adjusted Bankruptcy Rating increases.
uint32 bankruptcy_adjustment_ppm = 1;
// The maximum value that the liquidation spread can take, as
// a ratio against the position's maintenance margin.
uint32 spread_to_maintenance_margin_ratio_ppm = 2;
}