diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/matches.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/matches.ts index cddbd1873d..462654af4e 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/matches.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/matches.ts @@ -131,7 +131,8 @@ export interface MatchPerpetualDeleveraging { /** * Flag denoting whether the deleveraging operation was for the purpose * of final settlement. Final settlement matches are at the oracle price, - * whereas deleveraging normally happens at the bankruptcy price.bool + * whereas deleveraging happens at the bankruptcy price of the deleveraged + * subaccount. */ isFinalSettlement: boolean; @@ -153,7 +154,8 @@ export interface MatchPerpetualDeleveragingSDKType { /** * Flag denoting whether the deleveraging operation was for the purpose * of final settlement. Final settlement matches are at the oracle price, - * whereas deleveraging normally happens at the bankruptcy price.bool + * whereas deleveraging happens at the bankruptcy price of the deleveraged + * subaccount. */ is_final_settlement: boolean; diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/events/events.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/events/events.ts index dd483e2b64..4665d3fbc6 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/events/events.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/events/events.ts @@ -465,7 +465,7 @@ export interface DeleveragingEventV1 { */ fillAmount: Long; - /** Bankruptcy price of liquidated subaccount, in USDC quote quantums. */ + /** Fill price of deleveraging event, in USDC quote quantums. */ price: Long; /** `true` if liquidating a short position, `false` otherwise. */ @@ -474,6 +474,8 @@ export interface DeleveragingEventV1 { /** * `true` if the deleveraging event is for final settlement, indicating * the match occurred at the oracle price rather than bankruptcy price. + * When this flag is `false`, the fill price is the bankruptcy price + * of the liquidated subaccount. */ isFinalSettlement: boolean; @@ -499,7 +501,7 @@ export interface DeleveragingEventV1SDKType { */ fill_amount: Long; - /** Bankruptcy price of liquidated subaccount, in USDC quote quantums. */ + /** Fill price of deleveraging event, in USDC quote quantums. */ price: Long; /** `true` if liquidating a short position, `false` otherwise. */ @@ -508,6 +510,8 @@ export interface DeleveragingEventV1SDKType { /** * `true` if the deleveraging event is for final settlement, indicating * the match occurred at the oracle price rather than bankruptcy price. + * When this flag is `false`, the fill price is the bankruptcy price + * of the liquidated subaccount. */ is_final_settlement: boolean; diff --git a/proto/dydxprotocol/clob/matches.proto b/proto/dydxprotocol/clob/matches.proto index 41238aed9f..8b7b299f61 100644 --- a/proto/dydxprotocol/clob/matches.proto +++ b/proto/dydxprotocol/clob/matches.proto @@ -78,6 +78,7 @@ message MatchPerpetualDeleveraging { // Flag denoting whether the deleveraging operation was for the purpose // of final settlement. Final settlement matches are at the oracle price, - // whereas deleveraging normally happens at the bankruptcy price.bool + // whereas deleveraging happens at the bankruptcy price of the deleveraged + // subaccount. bool is_final_settlement = 4; } diff --git a/proto/dydxprotocol/indexer/events/events.proto b/proto/dydxprotocol/indexer/events/events.proto index be10d37f52..be1d96dd84 100644 --- a/proto/dydxprotocol/indexer/events/events.proto +++ b/proto/dydxprotocol/indexer/events/events.proto @@ -180,12 +180,14 @@ message DeleveragingEventV1 { // The amount filled between the liquidated and offsetting position, in // base quantums. uint64 fill_amount = 4; - // Bankruptcy price of liquidated subaccount, in USDC quote quantums. + // Fill price of deleveraging event, in USDC quote quantums. uint64 price = 5; // `true` if liquidating a short position, `false` otherwise. bool is_buy = 6; // `true` if the deleveraging event is for final settlement, indicating // the match occurred at the oracle price rather than bankruptcy price. + // When this flag is `false`, the fill price is the bankruptcy price + // of the liquidated subaccount. bool is_final_settlement = 7; } diff --git a/protocol/indexer/events/events.pb.go b/protocol/indexer/events/events.pb.go index d7da829c66..0ddbfd4bca 100644 --- a/protocol/indexer/events/events.pb.go +++ b/protocol/indexer/events/events.pb.go @@ -856,12 +856,14 @@ type DeleveragingEventV1 struct { // The amount filled between the liquidated and offsetting position, in // base quantums. FillAmount uint64 `protobuf:"varint,4,opt,name=fill_amount,json=fillAmount,proto3" json:"fill_amount,omitempty"` - // Bankruptcy price of liquidated subaccount, in USDC quote quantums. + // Fill price of deleveraging event, in USDC quote quantums. Price uint64 `protobuf:"varint,5,opt,name=price,proto3" json:"price,omitempty"` // `true` if liquidating a short position, `false` otherwise. IsBuy bool `protobuf:"varint,6,opt,name=is_buy,json=isBuy,proto3" json:"is_buy,omitempty"` // `true` if the deleveraging event is for final settlement, indicating // the match occurred at the oracle price rather than bankruptcy price. + // When this flag is `false`, the fill price is the bankruptcy price + // of the liquidated subaccount. IsFinalSettlement bool `protobuf:"varint,7,opt,name=is_final_settlement,json=isFinalSettlement,proto3" json:"is_final_settlement,omitempty"` } diff --git a/protocol/x/clob/types/matches.pb.go b/protocol/x/clob/types/matches.pb.go index 37d8335d89..7eb76a91c3 100644 --- a/protocol/x/clob/types/matches.pb.go +++ b/protocol/x/clob/types/matches.pb.go @@ -341,7 +341,8 @@ type MatchPerpetualDeleveraging struct { Fills []MatchPerpetualDeleveraging_Fill `protobuf:"bytes,3,rep,name=fills,proto3" json:"fills"` // Flag denoting whether the deleveraging operation was for the purpose // of final settlement. Final settlement matches are at the oracle price, - // whereas deleveraging normally happens at the bankruptcy price.bool + // whereas deleveraging happens at the bankruptcy price of the deleveraged + // subaccount. IsFinalSettlement bool `protobuf:"varint,4,opt,name=is_final_settlement,json=isFinalSettlement,proto3" json:"is_final_settlement,omitempty"` }