diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts index 3ac4f1e980..499e146f14 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts @@ -49,116 +49,117 @@ import * as _52 from "./indexer/events/events"; import * as _53 from "./indexer/indexer_manager/event"; import * as _54 from "./indexer/off_chain_updates/off_chain_updates"; import * as _55 from "./indexer/protocol/v1/clob"; -import * as _56 from "./indexer/protocol/v1/subaccount"; -import * as _57 from "./indexer/redis/redis_order"; -import * as _58 from "./indexer/shared/removal_reason"; -import * as _59 from "./indexer/socks/messages"; -import * as _60 from "./perpetuals/genesis"; -import * as _61 from "./perpetuals/params"; -import * as _62 from "./perpetuals/perpetual"; -import * as _63 from "./perpetuals/query"; -import * as _64 from "./perpetuals/tx"; -import * as _65 from "./prices/genesis"; -import * as _66 from "./prices/market_param"; -import * as _67 from "./prices/market_price"; -import * as _68 from "./prices/query"; -import * as _69 from "./prices/tx"; -import * as _70 from "./ratelimit/capacity"; -import * as _71 from "./ratelimit/genesis"; -import * as _72 from "./ratelimit/limit_params"; -import * as _73 from "./ratelimit/query"; -import * as _74 from "./ratelimit/tx"; -import * as _75 from "./rewards/genesis"; -import * as _76 from "./rewards/params"; -import * as _77 from "./rewards/query"; -import * as _78 from "./rewards/reward_share"; -import * as _79 from "./rewards/tx"; -import * as _80 from "./sending/genesis"; -import * as _81 from "./sending/query"; -import * as _82 from "./sending/transfer"; -import * as _83 from "./sending/tx"; -import * as _84 from "./stats/genesis"; -import * as _85 from "./stats/params"; -import * as _86 from "./stats/query"; -import * as _87 from "./stats/stats"; -import * as _88 from "./stats/tx"; -import * as _89 from "./subaccounts/asset_position"; -import * as _90 from "./subaccounts/genesis"; -import * as _91 from "./subaccounts/perpetual_position"; -import * as _92 from "./subaccounts/query"; -import * as _93 from "./subaccounts/subaccount"; -import * as _94 from "./vault/genesis"; -import * as _95 from "./vault/query"; -import * as _96 from "./vault/tx"; -import * as _97 from "./vault/vault"; -import * as _98 from "./vest/genesis"; -import * as _99 from "./vest/query"; -import * as _100 from "./vest/tx"; -import * as _101 from "./vest/vest_entry"; -import * as _109 from "./assets/query.lcd"; -import * as _110 from "./blocktime/query.lcd"; -import * as _111 from "./bridge/query.lcd"; -import * as _112 from "./clob/query.lcd"; -import * as _113 from "./delaymsg/query.lcd"; -import * as _114 from "./epochs/query.lcd"; -import * as _115 from "./feetiers/query.lcd"; -import * as _116 from "./perpetuals/query.lcd"; -import * as _117 from "./prices/query.lcd"; -import * as _118 from "./ratelimit/query.lcd"; -import * as _119 from "./rewards/query.lcd"; -import * as _120 from "./stats/query.lcd"; -import * as _121 from "./subaccounts/query.lcd"; -import * as _122 from "./vest/query.lcd"; -import * as _123 from "./assets/query.rpc.Query"; -import * as _124 from "./blocktime/query.rpc.Query"; -import * as _125 from "./bridge/query.rpc.Query"; -import * as _126 from "./clob/query.rpc.Query"; -import * as _127 from "./delaymsg/query.rpc.Query"; -import * as _128 from "./epochs/query.rpc.Query"; -import * as _129 from "./feetiers/query.rpc.Query"; -import * as _130 from "./govplus/query.rpc.Query"; -import * as _131 from "./perpetuals/query.rpc.Query"; -import * as _132 from "./prices/query.rpc.Query"; -import * as _133 from "./ratelimit/query.rpc.Query"; -import * as _134 from "./rewards/query.rpc.Query"; -import * as _135 from "./sending/query.rpc.Query"; -import * as _136 from "./stats/query.rpc.Query"; -import * as _137 from "./subaccounts/query.rpc.Query"; -import * as _138 from "./vault/query.rpc.Query"; -import * as _139 from "./vest/query.rpc.Query"; -import * as _140 from "./blocktime/tx.rpc.msg"; -import * as _141 from "./bridge/tx.rpc.msg"; -import * as _142 from "./clob/tx.rpc.msg"; -import * as _143 from "./delaymsg/tx.rpc.msg"; -import * as _144 from "./feetiers/tx.rpc.msg"; -import * as _145 from "./govplus/tx.rpc.msg"; -import * as _146 from "./perpetuals/tx.rpc.msg"; -import * as _147 from "./prices/tx.rpc.msg"; -import * as _148 from "./ratelimit/tx.rpc.msg"; -import * as _149 from "./rewards/tx.rpc.msg"; -import * as _150 from "./sending/tx.rpc.msg"; -import * as _151 from "./stats/tx.rpc.msg"; -import * as _152 from "./vault/tx.rpc.msg"; -import * as _153 from "./vest/tx.rpc.msg"; -import * as _154 from "./lcd"; -import * as _155 from "./rpc.query"; -import * as _156 from "./rpc.tx"; +import * as _56 from "./indexer/protocol/v1/perpetual"; +import * as _57 from "./indexer/protocol/v1/subaccount"; +import * as _58 from "./indexer/redis/redis_order"; +import * as _59 from "./indexer/shared/removal_reason"; +import * as _60 from "./indexer/socks/messages"; +import * as _61 from "./perpetuals/genesis"; +import * as _62 from "./perpetuals/params"; +import * as _63 from "./perpetuals/perpetual"; +import * as _64 from "./perpetuals/query"; +import * as _65 from "./perpetuals/tx"; +import * as _66 from "./prices/genesis"; +import * as _67 from "./prices/market_param"; +import * as _68 from "./prices/market_price"; +import * as _69 from "./prices/query"; +import * as _70 from "./prices/tx"; +import * as _71 from "./ratelimit/capacity"; +import * as _72 from "./ratelimit/genesis"; +import * as _73 from "./ratelimit/limit_params"; +import * as _74 from "./ratelimit/query"; +import * as _75 from "./ratelimit/tx"; +import * as _76 from "./rewards/genesis"; +import * as _77 from "./rewards/params"; +import * as _78 from "./rewards/query"; +import * as _79 from "./rewards/reward_share"; +import * as _80 from "./rewards/tx"; +import * as _81 from "./sending/genesis"; +import * as _82 from "./sending/query"; +import * as _83 from "./sending/transfer"; +import * as _84 from "./sending/tx"; +import * as _85 from "./stats/genesis"; +import * as _86 from "./stats/params"; +import * as _87 from "./stats/query"; +import * as _88 from "./stats/stats"; +import * as _89 from "./stats/tx"; +import * as _90 from "./subaccounts/asset_position"; +import * as _91 from "./subaccounts/genesis"; +import * as _92 from "./subaccounts/perpetual_position"; +import * as _93 from "./subaccounts/query"; +import * as _94 from "./subaccounts/subaccount"; +import * as _95 from "./vault/genesis"; +import * as _96 from "./vault/query"; +import * as _97 from "./vault/tx"; +import * as _98 from "./vault/vault"; +import * as _99 from "./vest/genesis"; +import * as _100 from "./vest/query"; +import * as _101 from "./vest/tx"; +import * as _102 from "./vest/vest_entry"; +import * as _110 from "./assets/query.lcd"; +import * as _111 from "./blocktime/query.lcd"; +import * as _112 from "./bridge/query.lcd"; +import * as _113 from "./clob/query.lcd"; +import * as _114 from "./delaymsg/query.lcd"; +import * as _115 from "./epochs/query.lcd"; +import * as _116 from "./feetiers/query.lcd"; +import * as _117 from "./perpetuals/query.lcd"; +import * as _118 from "./prices/query.lcd"; +import * as _119 from "./ratelimit/query.lcd"; +import * as _120 from "./rewards/query.lcd"; +import * as _121 from "./stats/query.lcd"; +import * as _122 from "./subaccounts/query.lcd"; +import * as _123 from "./vest/query.lcd"; +import * as _124 from "./assets/query.rpc.Query"; +import * as _125 from "./blocktime/query.rpc.Query"; +import * as _126 from "./bridge/query.rpc.Query"; +import * as _127 from "./clob/query.rpc.Query"; +import * as _128 from "./delaymsg/query.rpc.Query"; +import * as _129 from "./epochs/query.rpc.Query"; +import * as _130 from "./feetiers/query.rpc.Query"; +import * as _131 from "./govplus/query.rpc.Query"; +import * as _132 from "./perpetuals/query.rpc.Query"; +import * as _133 from "./prices/query.rpc.Query"; +import * as _134 from "./ratelimit/query.rpc.Query"; +import * as _135 from "./rewards/query.rpc.Query"; +import * as _136 from "./sending/query.rpc.Query"; +import * as _137 from "./stats/query.rpc.Query"; +import * as _138 from "./subaccounts/query.rpc.Query"; +import * as _139 from "./vault/query.rpc.Query"; +import * as _140 from "./vest/query.rpc.Query"; +import * as _141 from "./blocktime/tx.rpc.msg"; +import * as _142 from "./bridge/tx.rpc.msg"; +import * as _143 from "./clob/tx.rpc.msg"; +import * as _144 from "./delaymsg/tx.rpc.msg"; +import * as _145 from "./feetiers/tx.rpc.msg"; +import * as _146 from "./govplus/tx.rpc.msg"; +import * as _147 from "./perpetuals/tx.rpc.msg"; +import * as _148 from "./prices/tx.rpc.msg"; +import * as _149 from "./ratelimit/tx.rpc.msg"; +import * as _150 from "./rewards/tx.rpc.msg"; +import * as _151 from "./sending/tx.rpc.msg"; +import * as _152 from "./stats/tx.rpc.msg"; +import * as _153 from "./vault/tx.rpc.msg"; +import * as _154 from "./vest/tx.rpc.msg"; +import * as _155 from "./lcd"; +import * as _156 from "./rpc.query"; +import * as _157 from "./rpc.tx"; export namespace dydxprotocol { export const assets = { ..._5, ..._6, ..._7, ..._8, - ..._109, - ..._123 + ..._110, + ..._124 }; export const blocktime = { ..._9, ..._10, ..._11, ..._12, ..._13, - ..._110, - ..._124, - ..._140 + ..._111, + ..._125, + ..._141 }; export const bridge = { ..._14, ..._15, @@ -166,9 +167,9 @@ export namespace dydxprotocol { ..._17, ..._18, ..._19, - ..._111, - ..._125, - ..._141 + ..._112, + ..._126, + ..._142 }; export const clob = { ..._20, ..._21, @@ -184,9 +185,9 @@ export namespace dydxprotocol { ..._31, ..._32, ..._33, - ..._112, - ..._126, - ..._142 + ..._113, + ..._127, + ..._143 }; export namespace daemons { export const bridge = { ..._34 @@ -201,29 +202,29 @@ export namespace dydxprotocol { ..._39, ..._40, ..._41, - ..._113, - ..._127, - ..._143 + ..._114, + ..._128, + ..._144 }; export const epochs = { ..._42, ..._43, ..._44, - ..._114, - ..._128 + ..._115, + ..._129 }; export const feetiers = { ..._45, ..._46, ..._47, ..._48, - ..._115, - ..._129, - ..._144 + ..._116, + ..._130, + ..._145 }; export const govplus = { ..._49, ..._50, ..._51, - ..._130, - ..._145 + ..._131, + ..._146 }; export namespace indexer { export const events = { ..._52 @@ -234,93 +235,94 @@ export namespace dydxprotocol { }; export namespace protocol { export const v1 = { ..._55, - ..._56 + ..._56, + ..._57 }; } - export const redis = { ..._57 + export const redis = { ..._58 }; - export const shared = { ..._58 + export const shared = { ..._59 }; - export const socks = { ..._59 + export const socks = { ..._60 }; } - export const perpetuals = { ..._60, - ..._61, + export const perpetuals = { ..._61, ..._62, ..._63, ..._64, - ..._116, - ..._131, - ..._146 + ..._65, + ..._117, + ..._132, + ..._147 }; - export const prices = { ..._65, - ..._66, + export const prices = { ..._66, ..._67, ..._68, ..._69, - ..._117, - ..._132, - ..._147 + ..._70, + ..._118, + ..._133, + ..._148 }; - export const ratelimit = { ..._70, - ..._71, + export const ratelimit = { ..._71, ..._72, ..._73, ..._74, - ..._118, - ..._133, - ..._148 + ..._75, + ..._119, + ..._134, + ..._149 }; - export const rewards = { ..._75, - ..._76, + export const rewards = { ..._76, ..._77, ..._78, ..._79, - ..._119, - ..._134, - ..._149 + ..._80, + ..._120, + ..._135, + ..._150 }; - export const sending = { ..._80, - ..._81, + export const sending = { ..._81, ..._82, ..._83, - ..._135, - ..._150 + ..._84, + ..._136, + ..._151 }; - export const stats = { ..._84, - ..._85, + export const stats = { ..._85, ..._86, ..._87, ..._88, - ..._120, - ..._136, - ..._151 + ..._89, + ..._121, + ..._137, + ..._152 }; - export const subaccounts = { ..._89, - ..._90, + export const subaccounts = { ..._90, ..._91, ..._92, ..._93, - ..._121, - ..._137 + ..._94, + ..._122, + ..._138 }; - export const vault = { ..._94, - ..._95, + export const vault = { ..._95, ..._96, ..._97, - ..._138, - ..._152 + ..._98, + ..._139, + ..._153 }; - export const vest = { ..._98, - ..._99, + export const vest = { ..._99, ..._100, ..._101, - ..._122, - ..._139, - ..._153 + ..._102, + ..._123, + ..._140, + ..._154 }; - export const ClientFactory = { ..._154, - ..._155, - ..._156 + export const ClientFactory = { ..._155, + ..._156, + ..._157 }; } \ No newline at end of file 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 2c6482734d..1f8d38d1fd 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 @@ -1,6 +1,7 @@ import { IndexerSubaccountId, IndexerSubaccountIdSDKType, IndexerPerpetualPosition, IndexerPerpetualPositionSDKType, IndexerAssetPosition, IndexerAssetPositionSDKType } from "../protocol/v1/subaccount"; import { IndexerOrder, IndexerOrderSDKType, IndexerOrderId, IndexerOrderIdSDKType, ClobPairStatus, ClobPairStatusSDKType } from "../protocol/v1/clob"; import { OrderRemovalReason, OrderRemovalReasonSDKType } from "../shared/removal_reason"; +import { PerpetualMarketType, PerpetualMarketTypeSDKType } from "../protocol/v1/perpetual"; import * as _m0 from "protobufjs/minimal"; import { DeepPartial, Long } from "../../../helpers"; /** Type is the type for funding values. */ @@ -845,6 +846,9 @@ export interface PerpetualMarketCreateEventV1 { */ liquidityTier: number; + /** Market type of the perpetual. */ + + marketType: PerpetualMarketType; } /** * PerpetualMarketCreateEventV1 message contains all the information about a @@ -915,6 +919,9 @@ export interface PerpetualMarketCreateEventV1SDKType { */ liquidity_tier: number; + /** Market type of the perpetual. */ + + market_type: PerpetualMarketTypeSDKType; } /** * LiquidityTierUpsertEventV1 message contains all the information to @@ -2528,7 +2535,8 @@ function createBasePerpetualMarketCreateEventV1(): PerpetualMarketCreateEventV1 atomicResolution: 0, subticksPerTick: 0, stepBaseQuantums: Long.UZERO, - liquidityTier: 0 + liquidityTier: 0, + marketType: 0 }; } @@ -2574,6 +2582,10 @@ export const PerpetualMarketCreateEventV1 = { writer.uint32(80).uint32(message.liquidityTier); } + if (message.marketType !== 0) { + writer.uint32(88).int32(message.marketType); + } + return writer; }, @@ -2626,6 +2638,10 @@ export const PerpetualMarketCreateEventV1 = { message.liquidityTier = reader.uint32(); break; + case 11: + message.marketType = (reader.int32() as any); + break; + default: reader.skipType(tag & 7); break; @@ -2647,6 +2663,7 @@ export const PerpetualMarketCreateEventV1 = { message.subticksPerTick = object.subticksPerTick ?? 0; message.stepBaseQuantums = object.stepBaseQuantums !== undefined && object.stepBaseQuantums !== null ? Long.fromValue(object.stepBaseQuantums) : Long.UZERO; message.liquidityTier = object.liquidityTier ?? 0; + message.marketType = object.marketType ?? 0; return message; } diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/protocol/v1/perpetual.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/protocol/v1/perpetual.ts new file mode 100644 index 0000000000..829dced6d8 --- /dev/null +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/protocol/v1/perpetual.ts @@ -0,0 +1,67 @@ +/** + * Market type of perpetual. + * Defined in perpetual. + */ +export enum PerpetualMarketType { + /** PERPETUAL_MARKET_TYPE_UNSPECIFIED - Unspecified market type. */ + PERPETUAL_MARKET_TYPE_UNSPECIFIED = 0, + + /** PERPETUAL_MARKET_TYPE_CROSS - Market type for cross margin perpetual markets. */ + PERPETUAL_MARKET_TYPE_CROSS = 1, + + /** PERPETUAL_MARKET_TYPE_ISOLATED - Market type for isolated margin perpetual markets. */ + PERPETUAL_MARKET_TYPE_ISOLATED = 2, + UNRECOGNIZED = -1, +} +/** + * Market type of perpetual. + * Defined in perpetual. + */ + +export enum PerpetualMarketTypeSDKType { + /** PERPETUAL_MARKET_TYPE_UNSPECIFIED - Unspecified market type. */ + PERPETUAL_MARKET_TYPE_UNSPECIFIED = 0, + + /** PERPETUAL_MARKET_TYPE_CROSS - Market type for cross margin perpetual markets. */ + PERPETUAL_MARKET_TYPE_CROSS = 1, + + /** PERPETUAL_MARKET_TYPE_ISOLATED - Market type for isolated margin perpetual markets. */ + PERPETUAL_MARKET_TYPE_ISOLATED = 2, + UNRECOGNIZED = -1, +} +export function perpetualMarketTypeFromJSON(object: any): PerpetualMarketType { + switch (object) { + case 0: + case "PERPETUAL_MARKET_TYPE_UNSPECIFIED": + return PerpetualMarketType.PERPETUAL_MARKET_TYPE_UNSPECIFIED; + + case 1: + case "PERPETUAL_MARKET_TYPE_CROSS": + return PerpetualMarketType.PERPETUAL_MARKET_TYPE_CROSS; + + case 2: + case "PERPETUAL_MARKET_TYPE_ISOLATED": + return PerpetualMarketType.PERPETUAL_MARKET_TYPE_ISOLATED; + + case -1: + case "UNRECOGNIZED": + default: + return PerpetualMarketType.UNRECOGNIZED; + } +} +export function perpetualMarketTypeToJSON(object: PerpetualMarketType): string { + switch (object) { + case PerpetualMarketType.PERPETUAL_MARKET_TYPE_UNSPECIFIED: + return "PERPETUAL_MARKET_TYPE_UNSPECIFIED"; + + case PerpetualMarketType.PERPETUAL_MARKET_TYPE_CROSS: + return "PERPETUAL_MARKET_TYPE_CROSS"; + + case PerpetualMarketType.PERPETUAL_MARKET_TYPE_ISOLATED: + return "PERPETUAL_MARKET_TYPE_ISOLATED"; + + case PerpetualMarketType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/gogoproto/bundle.ts b/indexer/packages/v4-protos/src/codegen/gogoproto/bundle.ts index 376d487cb4..c3b6b38b3f 100644 --- a/indexer/packages/v4-protos/src/codegen/gogoproto/bundle.ts +++ b/indexer/packages/v4-protos/src/codegen/gogoproto/bundle.ts @@ -1,3 +1,3 @@ -import * as _102 from "./gogo"; -export const gogoproto = { ..._102 +import * as _103 from "./gogo"; +export const gogoproto = { ..._103 }; \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/google/bundle.ts b/indexer/packages/v4-protos/src/codegen/google/bundle.ts index bb317adb1e..8878e6797b 100644 --- a/indexer/packages/v4-protos/src/codegen/google/bundle.ts +++ b/indexer/packages/v4-protos/src/codegen/google/bundle.ts @@ -1,16 +1,16 @@ -import * as _103 from "./api/annotations"; -import * as _104 from "./api/http"; -import * as _105 from "./protobuf/descriptor"; -import * as _106 from "./protobuf/duration"; -import * as _107 from "./protobuf/timestamp"; -import * as _108 from "./protobuf/any"; +import * as _104 from "./api/annotations"; +import * as _105 from "./api/http"; +import * as _106 from "./protobuf/descriptor"; +import * as _107 from "./protobuf/duration"; +import * as _108 from "./protobuf/timestamp"; +import * as _109 from "./protobuf/any"; export namespace google { - export const api = { ..._103, - ..._104 + export const api = { ..._104, + ..._105 }; - export const protobuf = { ..._105, - ..._106, + export const protobuf = { ..._106, ..._107, - ..._108 + ..._108, + ..._109 }; } \ No newline at end of file diff --git a/indexer/services/ender/__tests__/helpers/constants.ts b/indexer/services/ender/__tests__/helpers/constants.ts index beec5c47f8..e058d9dcec 100644 --- a/indexer/services/ender/__tests__/helpers/constants.ts +++ b/indexer/services/ender/__tests__/helpers/constants.ts @@ -24,6 +24,7 @@ import { OrderFillEventV1, OrderRemovalReason, PerpetualMarketCreateEventV1, + PerpetualMarketType, StatefulOrderEventV1, SubaccountMessage, SubaccountUpdateEventV1, @@ -138,6 +139,7 @@ export const defaultPerpetualMarketCreateEvent: PerpetualMarketCreateEventV1 = { subticksPerTick: 100, stepBaseQuantums: Long.fromValue(10, true), liquidityTier: 0, + marketType: PerpetualMarketType.PERPETUAL_MARKET_TYPE_CROSS, }; export const defaultLiquidityTierUpsertEvent: LiquidityTierUpsertEventV1 = { diff --git a/proto/dydxprotocol/indexer/events/events.proto b/proto/dydxprotocol/indexer/events/events.proto index c8d187f915..affeaefea8 100644 --- a/proto/dydxprotocol/indexer/events/events.proto +++ b/proto/dydxprotocol/indexer/events/events.proto @@ -5,6 +5,7 @@ import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "dydxprotocol/indexer/shared/removal_reason.proto"; import "dydxprotocol/indexer/protocol/v1/clob.proto"; +import "dydxprotocol/indexer/protocol/v1/perpetual.proto"; import "dydxprotocol/indexer/protocol/v1/subaccount.proto"; option go_package = "github.com/dydxprotocol/v4-chain/protocol/indexer/events"; @@ -352,6 +353,9 @@ message PerpetualMarketCreateEventV1 { // The liquidity_tier that this perpetual is associated with. // Defined in perpetuals.perpetual uint32 liquidity_tier = 10; + + // Market type of the perpetual. + dydxprotocol.indexer.protocol.v1.PerpetualMarketType market_type = 11; } // LiquidityTierUpsertEventV1 message contains all the information to diff --git a/proto/dydxprotocol/indexer/protocol/v1/perpetual.proto b/proto/dydxprotocol/indexer/protocol/v1/perpetual.proto new file mode 100644 index 0000000000..5becdf8b2f --- /dev/null +++ b/proto/dydxprotocol/indexer/protocol/v1/perpetual.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package dydxprotocol.indexer.protocol.v1; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/indexer/protocol/v1/types"; + +// Market type of perpetual. +// Defined in perpetual. +enum PerpetualMarketType { + // Unspecified market type. + PERPETUAL_MARKET_TYPE_UNSPECIFIED = 0; + // Market type for cross margin perpetual markets. + PERPETUAL_MARKET_TYPE_CROSS = 1; + // Market type for isolated margin perpetual markets. + PERPETUAL_MARKET_TYPE_ISOLATED = 2; +} diff --git a/protocol/indexer/events/events.pb.go b/protocol/indexer/events/events.pb.go index 44d0cccdde..40208d144e 100644 --- a/protocol/indexer/events/events.pb.go +++ b/protocol/indexer/events/events.pb.go @@ -1630,6 +1630,8 @@ type PerpetualMarketCreateEventV1 struct { // The liquidity_tier that this perpetual is associated with. // Defined in perpetuals.perpetual LiquidityTier uint32 `protobuf:"varint,10,opt,name=liquidity_tier,json=liquidityTier,proto3" json:"liquidity_tier,omitempty"` + // Market type of the perpetual. + MarketType types.PerpetualMarketType `protobuf:"varint,11,opt,name=market_type,json=marketType,proto3,enum=dydxprotocol.indexer.protocol.v1.PerpetualMarketType" json:"market_type,omitempty"` } func (m *PerpetualMarketCreateEventV1) Reset() { *m = PerpetualMarketCreateEventV1{} } @@ -1735,6 +1737,13 @@ func (m *PerpetualMarketCreateEventV1) GetLiquidityTier() uint32 { return 0 } +func (m *PerpetualMarketCreateEventV1) GetMarketType() types.PerpetualMarketType { + if m != nil { + return m.MarketType + } + return types.PerpetualMarketType_PERPETUAL_MARKET_TYPE_UNSPECIFIED +} + // LiquidityTierUpsertEventV1 message contains all the information to // create/update a Liquidity Tier on the dYdX chain. type LiquidityTierUpsertEventV1 struct { @@ -2139,138 +2148,140 @@ func init() { } var fileDescriptor_6331dfb59c6fd2bb = []byte{ - // 2091 bytes of a gzipped FileDescriptorProto + // 2122 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x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fc, 0x83, 0xef, 0x8f, 0x9d, 0xab, 0xa2, 0xaf, 0x0b, 0x35, 0x15, - 0x3a, 0x6d, 0xe9, 0x60, 0xca, 0x9a, 0x8f, 0xba, 0x52, 0xf4, 0x29, 0x14, 0xb4, 0x61, 0x27, 0x26, - 0x82, 0x3c, 0x2b, 0xc9, 0xef, 0x4f, 0x40, 0xbe, 0x23, 0x15, 0xba, 0xbc, 0x0b, 0x7e, 0x8f, 0xb8, - 0x87, 0xd8, 0x0f, 0x5d, 0xda, 0xba, 0x28, 0xe7, 0x26, 0x26, 0x3e, 0x94, 0x0a, 0x03, 0xc4, 0x4a, - 0x5c, 0x9d, 0x81, 0x69, 0x39, 0xda, 0x7c, 0x08, 0xe5, 0x51, 0xb3, 0x44, 0x15, 0xb8, 0xa9, 0x42, - 0xf6, 0x9c, 0xf2, 0x53, 0x9b, 0xbc, 0x88, 0xc2, 0x80, 0x04, 0x5c, 0x46, 0x36, 0x67, 0x95, 0x24, - 0xf4, 0x29, 0xe5, 0xa7, 0x7b, 0x1a, 0x30, 0x3f, 0x83, 0x92, 0xe2, 0xaa, 0x62, 0x96, 0x92, 0x20, - 0xc8, 0x45, 0x98, 0xc6, 0x52, 0x6b, 0xce, 0x92, 0xbf, 0xd1, 0x26, 0x2c, 0xf9, 0x34, 0xb0, 0x15, - 0xb9, 0x73, 0x8a, 0x83, 0x76, 0x77, 0xb9, 0x15, 0xac, 0x92, 0x4f, 0x03, 0xe9, 0xcd, 0x8e, 0x44, - 0xea, 0x91, 0x6f, 0x76, 0xe0, 0xe6, 0x90, 0x70, 0xa1, 0x2a, 0xe4, 0x4e, 0x30, 0x23, 0x92, 0x7b, - 0xfe, 0x41, 0x65, 0x82, 0xa8, 0xf4, 0x78, 0x66, 0x49, 0x5d, 0xb4, 0x06, 0xb3, 0xe9, 0xcc, 0x84, - 0xfd, 0x92, 0x95, 0x7e, 0x9b, 0x9f, 0x27, 0x66, 0xfb, 0x82, 0x79, 0x1d, 0x66, 0xcd,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, 0x5a, 0xe4, 0x7d, 0x26, - 0xcc, 0xdf, 0x19, 0xb0, 0x34, 0x6c, 0x20, 0x5a, 0x82, 0xe9, 0xf0, 0x79, 0x40, 0x92, 0x57, 0x42, - 0xf5, 0x81, 0xce, 0x60, 0xc1, 0x25, 0x41, 0xe8, 0x27, 0x17, 0xbf, 0xcc, 0x35, 0xbf, 0xb2, 0xcf, - 0x4b, 0x76, 0x75, 0x87, 0xac, 0x5a, 0x5f, 0xbd, 0xda, 0x30, 0xbe, 0x7e, 0xb5, 0x61, 0xfc, 0xe7, - 0xd5, 0x86, 0xf1, 0x9b, 0xd7, 0x1b, 0x53, 0x5f, 0xbf, 0xde, 0x98, 0xfa, 0xd7, 0xeb, 0x8d, 0xa9, - 0xa7, 0x1f, 0x4d, 0x6e, 0xa8, 0xff, 0xff, 0x2e, 0x27, 0x79, 0x09, 0x7c, 0xef, 0x7f, 0x01, 0x00, - 0x00, 0xff, 0xff, 0xf5, 0xd4, 0x4f, 0x0e, 0x9d, 0x19, 0x00, 0x00, + 0x64, 0xee, 0x88, 0xf2, 0xee, 0x3a, 0xc1, 0x4e, 0x5a, 0x33, 0x4d, 0xaa, 0xa1, 0x79, 0x79, 0xba, + 0x29, 0x5b, 0x06, 0x72, 0x4e, 0x0e, 0x01, 0x12, 0x20, 0xc8, 0x21, 0x87, 0x1c, 0x72, 0xc8, 0x25, + 0x40, 0x0e, 0x01, 0x72, 0xcd, 0x29, 0x97, 0xbd, 0x65, 0x91, 0x4b, 0x82, 0x1c, 0x16, 0x81, 0x7d, + 0xc8, 0xbf, 0x11, 0xf4, 0x63, 0x86, 0xa4, 0xf8, 0x30, 0x6d, 0x69, 0x4f, 0x9c, 0xae, 0xea, 0xfa, + 0x55, 0x75, 0x55, 0x75, 0x57, 0x75, 0x13, 0xee, 0xba, 0x17, 0xee, 0x8b, 0x28, 0x0e, 0x79, 0xe8, + 0x84, 0xde, 0x06, 0x0d, 0x5c, 0xf2, 0x82, 0xc4, 0x1b, 0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x7d, 0x31, 0x4d, 0xee, 0x44, 0xc3, 0xd2, 0x23, 0x54, 0x83, 0xbc, 0xb2, 0xbb, 0x32, + 0x2d, 0x0d, 0xba, 0x37, 0x36, 0x29, 0xfa, 0x02, 0x6f, 0x69, 0x49, 0xb4, 0x0f, 0x73, 0xa9, 0x3d, + 0x95, 0xfc, 0x5b, 0xc3, 0x74, 0x85, 0xcd, 0x7f, 0xe6, 0xa0, 0xf4, 0x38, 0x76, 0x49, 0xbc, 0x47, + 0x3d, 0x2f, 0x89, 0xd6, 0x31, 0x14, 0x7c, 0x7c, 0x46, 0x62, 0x3b, 0x14, 0x9c, 0xf1, 0xc9, 0x3b, + 0xc4, 0x71, 0x12, 0x4f, 0x17, 0x0e, 0x90, 0x40, 0x92, 0x82, 0xf6, 0x60, 0x5a, 0x01, 0x66, 0xdf, + 0x05, 0x70, 0x7f, 0xca, 0x52, 0xe2, 0xe8, 0x0b, 0x28, 0x7b, 0xf4, 0x59, 0x87, 0xba, 0x98, 0xd3, + 0x30, 0xd0, 0x46, 0xaa, 0xe3, 0x6e, 0x63, 0xac, 0x17, 0x1e, 0x75, 0xa5, 0x24, 0xa4, 0x3c, 0xed, + 0x4a, 0xde, 0x25, 0x2a, 0xba, 0x0d, 0x85, 0x16, 0xf5, 0x3c, 0x5b, 0x87, 0x2f, 0x27, 0xc3, 0x07, + 0x82, 0xb4, 0xa5, 0x42, 0x28, 0xab, 0x87, 0xf0, 0x4f, 0x8b, 0x10, 0x19, 0x45, 0x24, 0xaa, 0xc7, + 0x19, 0x89, 0xf7, 0x08, 0x11, 0x4c, 0x9e, 0x32, 0xf3, 0x8a, 0xc9, 0x13, 0xe6, 0xfb, 0x80, 0x78, + 0xc8, 0xb1, 0x67, 0x0b, 0x34, 0xe2, 0xda, 0x52, 0xaa, 0x32, 0x23, 0x35, 0x94, 0x24, 0x67, 0x4f, + 0x32, 0x0e, 0x04, 0x7d, 0x60, 0xb6, 0x84, 0xa9, 0xcc, 0x0e, 0xcc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0xd0, 0xfc, 0x73, 0x06, 0x96, 0x95, 0x7f, + 0xd2, 0x74, 0x19, 0x73, 0x90, 0xe9, 0x4d, 0x9f, 0x1d, 0xbd, 0xe9, 0x73, 0x93, 0x9c, 0x54, 0xc6, + 0x88, 0xad, 0x36, 0xb8, 0x21, 0xa6, 0x87, 0x6c, 0x08, 0x93, 0xc1, 0x52, 0x33, 0xc6, 0x2e, 0x0d, + 0xda, 0x16, 0x79, 0x8e, 0x63, 0x97, 0x75, 0xef, 0x00, 0x37, 0xb8, 0x62, 0xd8, 0xb1, 0xe2, 0xe8, + 0x97, 0xeb, 0xcd, 0xb1, 0xdd, 0x88, 0x7e, 0x9a, 0xea, 0xc3, 0xb4, 0x16, 0x78, 0x9f, 0x0a, 0xf3, + 0xb7, 0x19, 0x58, 0x1c, 0x36, 0x11, 0x2d, 0xc2, 0x74, 0xf8, 0x3c, 0x20, 0xc9, 0xeb, 0xa3, 0x1a, + 0xa0, 0x33, 0x98, 0x77, 0x49, 0x10, 0xfa, 0xc9, 0x85, 0x32, 0x7b, 0xcd, 0xaf, 0xf7, 0x05, 0x89, + 0xae, 0xee, 0xa6, 0x35, 0xeb, 0xcb, 0x57, 0xeb, 0x99, 0xaf, 0x5e, 0xad, 0x67, 0xfe, 0xf3, 0x6a, + 0x3d, 0xf3, 0xab, 0xd7, 0xeb, 0x53, 0x5f, 0xbd, 0x5e, 0x9f, 0xfa, 0xd7, 0xeb, 0xf5, 0xa9, 0xa7, + 0x1f, 0x4d, 0xae, 0xa8, 0xff, 0x1f, 0xa0, 0x93, 0xbc, 0x64, 0x7c, 0xe7, 0x7f, 0x01, 0x00, 0x00, + 0xff, 0xff, 0xd1, 0x69, 0xc7, 0x1d, 0x27, 0x1a, 0x00, 0x00, } func (m *FundingUpdateV1) Marshal() (dAtA []byte, err error) { @@ -3449,6 +3460,11 @@ func (m *PerpetualMarketCreateEventV1) MarshalToSizedBuffer(dAtA []byte) (int, e _ = i var l int _ = l + if m.MarketType != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.MarketType)) + i-- + dAtA[i] = 0x58 + } if m.LiquidityTier != 0 { i = encodeVarintEvents(dAtA, i, uint64(m.LiquidityTier)) i-- @@ -4282,6 +4298,9 @@ func (m *PerpetualMarketCreateEventV1) Size() (n int) { if m.LiquidityTier != 0 { n += 1 + sovEvents(uint64(m.LiquidityTier)) } + if m.MarketType != 0 { + n += 1 + sovEvents(uint64(m.MarketType)) + } return n } @@ -7374,6 +7393,25 @@ func (m *PerpetualMarketCreateEventV1) Unmarshal(dAtA []byte) error { break } } + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MarketType", wireType) + } + m.MarketType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MarketType |= types.PerpetualMarketType(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipEvents(dAtA[iNdEx:]) diff --git a/protocol/indexer/events/perpetual_market_create.go b/protocol/indexer/events/perpetual_market_create.go index 752e3bc15f..a061829764 100644 --- a/protocol/indexer/events/perpetual_market_create.go +++ b/protocol/indexer/events/perpetual_market_create.go @@ -2,7 +2,8 @@ package events import ( v1 "github.com/dydxprotocol/v4-chain/protocol/indexer/protocol/v1" - "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" + clobtypes "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" + perptypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" ) // NewPerpetualMarketCreateEvent creates a PerpetualMarketCreateEvent @@ -12,12 +13,13 @@ func NewPerpetualMarketCreateEvent( clobPairId uint32, ticker string, marketId uint32, - status types.ClobPair_Status, + status clobtypes.ClobPair_Status, quantumConversionExponent int32, atomicResolution int32, subticksPerTick uint32, stepBaseQuantums uint64, liquidityTier uint32, + marketType perptypes.PerpetualMarketType, ) *PerpetualMarketCreateEventV1 { return &PerpetualMarketCreateEventV1{ Id: id, @@ -30,5 +32,6 @@ func NewPerpetualMarketCreateEvent( SubticksPerTick: subticksPerTick, StepBaseQuantums: stepBaseQuantums, LiquidityTier: liquidityTier, + MarketType: v1.ConvertToPerpetualMarketType(marketType), } } diff --git a/protocol/indexer/events/perpetual_market_create_test.go b/protocol/indexer/events/perpetual_market_create_test.go index 75461321f2..2398aa4a9b 100644 --- a/protocol/indexer/events/perpetual_market_create_test.go +++ b/protocol/indexer/events/perpetual_market_create_test.go @@ -5,6 +5,7 @@ import ( v1types "github.com/dydxprotocol/v4-chain/protocol/indexer/protocol/v1/types" clobtypes "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" + perptypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" "github.com/stretchr/testify/require" ) @@ -21,6 +22,7 @@ func TestNewPerpetualMarketCreateEvent_Success(t *testing.T) { 5, 5, 0, + perptypes.PerpetualMarketType_PERPETUAL_MARKET_TYPE_CROSS, ) expectedPerpetualMarketCreateEventProto := &PerpetualMarketCreateEventV1{ Id: 0, @@ -33,6 +35,7 @@ func TestNewPerpetualMarketCreateEvent_Success(t *testing.T) { SubticksPerTick: 5, StepBaseQuantums: 5, LiquidityTier: 0, + MarketType: v1types.PerpetualMarketType_PERPETUAL_MARKET_TYPE_CROSS, } require.Equal(t, expectedPerpetualMarketCreateEventProto, perpetualMarketCreateEvent) } diff --git a/protocol/indexer/protocol/v1/types/perpetual.pb.go b/protocol/indexer/protocol/v1/types/perpetual.pb.go new file mode 100644 index 0000000000..d57c3b4229 --- /dev/null +++ b/protocol/indexer/protocol/v1/types/perpetual.pb.go @@ -0,0 +1,81 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: dydxprotocol/indexer/protocol/v1/perpetual.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Market type of perpetual. +// Defined in perpetual. +type PerpetualMarketType int32 + +const ( + // Unspecified market type. + PerpetualMarketType_PERPETUAL_MARKET_TYPE_UNSPECIFIED PerpetualMarketType = 0 + // Market type for cross margin perpetual markets. + PerpetualMarketType_PERPETUAL_MARKET_TYPE_CROSS PerpetualMarketType = 1 + // Market type for isolated margin perpetual markets. + PerpetualMarketType_PERPETUAL_MARKET_TYPE_ISOLATED PerpetualMarketType = 2 +) + +var PerpetualMarketType_name = map[int32]string{ + 0: "PERPETUAL_MARKET_TYPE_UNSPECIFIED", + 1: "PERPETUAL_MARKET_TYPE_CROSS", + 2: "PERPETUAL_MARKET_TYPE_ISOLATED", +} + +var PerpetualMarketType_value = map[string]int32{ + "PERPETUAL_MARKET_TYPE_UNSPECIFIED": 0, + "PERPETUAL_MARKET_TYPE_CROSS": 1, + "PERPETUAL_MARKET_TYPE_ISOLATED": 2, +} + +func (x PerpetualMarketType) String() string { + return proto.EnumName(PerpetualMarketType_name, int32(x)) +} + +func (PerpetualMarketType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_ebf0c6c8fa38d8c8, []int{0} +} + +func init() { + proto.RegisterEnum("dydxprotocol.indexer.protocol.v1.PerpetualMarketType", PerpetualMarketType_name, PerpetualMarketType_value) +} + +func init() { + proto.RegisterFile("dydxprotocol/indexer/protocol/v1/perpetual.proto", fileDescriptor_ebf0c6c8fa38d8c8) +} + +var fileDescriptor_ebf0c6c8fa38d8c8 = []byte{ + // 227 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x48, 0xa9, 0x4c, 0xa9, + 0x28, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0xce, 0xcf, 0x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b, + 0x93, 0xd8, 0xc0, 0x42, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xba, 0xc4, 0x7a, 0xc4, 0x3f, + 0x01, 0x00, 0x00, +} diff --git a/protocol/indexer/protocol/v1/v1_mappers.go b/protocol/indexer/protocol/v1/v1_mappers.go index bf04b5d1cc..917ed71b89 100644 --- a/protocol/indexer/protocol/v1/v1_mappers.go +++ b/protocol/indexer/protocol/v1/v1_mappers.go @@ -6,6 +6,7 @@ import ( "github.com/dydxprotocol/v4-chain/protocol/dtypes" v1types "github.com/dydxprotocol/v4-chain/protocol/indexer/protocol/v1/types" clobtypes "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" + perptypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" satypes "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/types" ) @@ -188,3 +189,19 @@ func ConvertToClobPairStatus(status clobtypes.ClobPair_Status) v1types.ClobPairS ) } } + +func ConvertToPerpetualMarketType(marketType perptypes.PerpetualMarketType) v1types.PerpetualMarketType { + switch marketType { + case perptypes.PerpetualMarketType_PERPETUAL_MARKET_TYPE_CROSS: + return v1types.PerpetualMarketType_PERPETUAL_MARKET_TYPE_CROSS + case perptypes.PerpetualMarketType_PERPETUAL_MARKET_TYPE_ISOLATED: + return v1types.PerpetualMarketType_PERPETUAL_MARKET_TYPE_ISOLATED + default: + panic( + fmt.Sprintf( + "ConvertToPerpetualMarketType: invalid perpetual market type: %+v", + marketType, + ), + ) + } +} diff --git a/protocol/indexer/protocol/v1/v1_mappers_test.go b/protocol/indexer/protocol/v1/v1_mappers_test.go index e94fd0f885..26e8312b61 100644 --- a/protocol/indexer/protocol/v1/v1_mappers_test.go +++ b/protocol/indexer/protocol/v1/v1_mappers_test.go @@ -9,6 +9,7 @@ import ( v1types "github.com/dydxprotocol/v4-chain/protocol/indexer/protocol/v1/types" "github.com/dydxprotocol/v4-chain/protocol/testutil/constants" clobtypes "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" + perptypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" satypes "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/types" "github.com/stretchr/testify/require" ) @@ -427,3 +428,48 @@ func TestConvertToClobPairStatus(t *testing.T) { }) } } + +func TestConvertToPerpetualMarketType(t *testing.T) { + type convertToPerpetualMarketTypeTestCase struct { + status perptypes.PerpetualMarketType + expectedStatus v1types.PerpetualMarketType + expectedPanic string + } + + tests := make(map[string]convertToPerpetualMarketTypeTestCase) + // Iterate through all the values for PerpetualMarketType to create test cases. + for name, value := range perptypes.PerpetualMarketType_value { + testName := fmt.Sprintf("Converts PerpetualMarketType %s to v1.PerpetualMarketType", name) + testCase := convertToPerpetualMarketTypeTestCase{ + status: perptypes.PerpetualMarketType(value), + expectedStatus: v1types.PerpetualMarketType(perptypes.PerpetualMarketType_value[name]), + } + if value == int32(perptypes.PerpetualMarketType_PERPETUAL_MARKET_TYPE_UNSPECIFIED) { + testCase.expectedPanic = fmt.Sprintf( + "ConvertToPerpetualMarketType: invalid perpetual market type: %+v", + perptypes.PerpetualMarketType_PERPETUAL_MARKET_TYPE_UNSPECIFIED, + ) + } + tests[testName] = testCase + } + + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + if tc.expectedPanic != "" { + require.PanicsWithValue( + t, + tc.expectedPanic, + func() { + v1.ConvertToPerpetualMarketType(tc.status) + }, + ) + } else { + require.Equal( + t, + tc.expectedStatus, + v1.ConvertToPerpetualMarketType(tc.status), + ) + } + }) + } +} diff --git a/protocol/testutil/keeper/clob.go b/protocol/testutil/keeper/clob.go index cad8a0eed7..5f1f7f72a9 100644 --- a/protocol/testutil/keeper/clob.go +++ b/protocol/testutil/keeper/clob.go @@ -287,6 +287,7 @@ func CreateNClobPair( items[i].SubticksPerTick, items[i].StepBaseQuantums, perps[i].Params.LiquidityTier, + perps[i].Params.MarketType, ), ), ).Return() diff --git a/protocol/x/clob/abci_test.go b/protocol/x/clob/abci_test.go index 44d2d9af36..4a10197b3f 100644 --- a/protocol/x/clob/abci_test.go +++ b/protocol/x/clob/abci_test.go @@ -712,6 +712,7 @@ func TestEndBlocker_Success(t *testing.T) { constants.ClobPair_Btc.SubticksPerTick, constants.ClobPair_Btc.StepBaseQuantums, constants.BtcUsd_20PercentInitial_10PercentMaintenance.Params.LiquidityTier, + constants.BtcUsd_20PercentInitial_10PercentMaintenance.Params.MarketType, ), ), ).Once().Return() @@ -744,6 +745,7 @@ func TestEndBlocker_Success(t *testing.T) { constants.ClobPair_Eth.SubticksPerTick, constants.ClobPair_Eth.StepBaseQuantums, constants.EthUsd_20PercentInitial_10PercentMaintenance.Params.LiquidityTier, + constants.BtcUsd_20PercentInitial_10PercentMaintenance.Params.MarketType, ), ), ).Once().Return() diff --git a/protocol/x/clob/genesis_test.go b/protocol/x/clob/genesis_test.go index 928b8276d1..e84d54cd5d 100644 --- a/protocol/x/clob/genesis_test.go +++ b/protocol/x/clob/genesis_test.go @@ -451,6 +451,7 @@ func TestGenesis(t *testing.T) { clobPair.SubticksPerTick, clobPair.StepBaseQuantums, perpetual.Params.LiquidityTier, + perpetual.Params.MarketType, ), ), ).Once().Return() diff --git a/protocol/x/clob/keeper/clob_pair.go b/protocol/x/clob/keeper/clob_pair.go index 8ab56f976e..12a3f6fef1 100644 --- a/protocol/x/clob/keeper/clob_pair.go +++ b/protocol/x/clob/keeper/clob_pair.go @@ -1,10 +1,11 @@ package keeper import ( - storetypes "cosmossdk.io/store/types" "fmt" "sort" + storetypes "cosmossdk.io/store/types" + errorsmod "cosmossdk.io/errors" "cosmossdk.io/store/prefix" @@ -104,6 +105,7 @@ func (k Keeper) CreatePerpetualClobPair( subticksPerTick, stepSizeBaseQuantums.ToUint64(), perpetual.Params.LiquidityTier, + perpetual.Params.MarketType, ), ), ) diff --git a/protocol/x/clob/keeper/clob_pair_test.go b/protocol/x/clob/keeper/clob_pair_test.go index 87c69356b7..4ae6fb3e14 100644 --- a/protocol/x/clob/keeper/clob_pair_test.go +++ b/protocol/x/clob/keeper/clob_pair_test.go @@ -66,6 +66,7 @@ func TestCreatePerpetualClobPair_MultiplePerpetual(t *testing.T) { clobPair.SubticksPerTick, clobPair.StepBaseQuantums, constants.Perpetuals_DefaultGenesisState.Perpetuals[i].Params.LiquidityTier, + constants.Perpetuals_DefaultGenesisState.Perpetuals[i].Params.MarketType, ), ), ).Once().Return() @@ -187,6 +188,7 @@ func TestCreatePerpetualClobPair_FailsWithDuplicateClobPairId(t *testing.T) { clobPair.SubticksPerTick, clobPair.StepBaseQuantums, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.LiquidityTier, + constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.MarketType, ), ), ).Once().Return() @@ -278,6 +280,7 @@ func TestCreatePerpetualClobPair(t *testing.T) { tc.clobPair.SubticksPerTick, tc.clobPair.StepBaseQuantums, perpetual.Params.LiquidityTier, + perpetual.Params.MarketType, ), ), ).Return() @@ -430,6 +433,7 @@ func TestCreateMultipleClobPairs(t *testing.T) { make.clobPair.SubticksPerTick, make.clobPair.StepBaseQuantums, perpetual.Params.LiquidityTier, + perpetual.Params.MarketType, ), ), ).Return() @@ -621,6 +625,7 @@ func TestUpdateClobPair_FinalSettlement(t *testing.T) { clobPair.SubticksPerTick, clobPair.StepBaseQuantums, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.LiquidityTier, + constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.MarketType, ), ), ).Once().Return() @@ -737,6 +742,7 @@ func TestUpdateClobPair(t *testing.T) { clobPair.SubticksPerTick, clobPair.StepBaseQuantums, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.LiquidityTier, + constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.MarketType, ), ), ).Once().Return() @@ -794,6 +800,7 @@ func TestUpdateClobPair(t *testing.T) { clobPair.SubticksPerTick, clobPair.StepBaseQuantums, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.LiquidityTier, + constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.MarketType, ), ), ).Once().Return() @@ -831,6 +838,7 @@ func TestUpdateClobPair(t *testing.T) { clobPair.SubticksPerTick, clobPair.StepBaseQuantums, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.LiquidityTier, + constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.MarketType, ), ), ).Once().Return() diff --git a/protocol/x/clob/keeper/deleveraging_test.go b/protocol/x/clob/keeper/deleveraging_test.go index 1bfeda123a..fa13dd960e 100644 --- a/protocol/x/clob/keeper/deleveraging_test.go +++ b/protocol/x/clob/keeper/deleveraging_test.go @@ -413,6 +413,7 @@ func TestCanDeleverageSubaccount(t *testing.T) { clobPair.SubticksPerTick, clobPair.StepBaseQuantums, perpetuals[i].Params.LiquidityTier, + perpetuals[i].Params.MarketType, ), ), ).Once().Return() @@ -786,6 +787,7 @@ func TestOffsetSubaccountPerpetualPosition(t *testing.T) { clobPair.SubticksPerTick, clobPair.StepBaseQuantums, perps[i].Params.LiquidityTier, + perps[i].Params.MarketType, ), ), ).Once().Return() diff --git a/protocol/x/clob/keeper/get_price_premium_test.go b/protocol/x/clob/keeper/get_price_premium_test.go index 43ca311246..20afc053c5 100644 --- a/protocol/x/clob/keeper/get_price_premium_test.go +++ b/protocol/x/clob/keeper/get_price_premium_test.go @@ -183,6 +183,7 @@ func TestGetPricePremiumForPerpetual(t *testing.T) { tc.args.clobPair.SubticksPerTick, tc.args.clobPair.StepBaseQuantums, perpetual.Params.LiquidityTier, + perpetual.Params.MarketType, ), ), ).Return() diff --git a/protocol/x/clob/keeper/liquidations_test.go b/protocol/x/clob/keeper/liquidations_test.go index ec916312e1..799e922321 100644 --- a/protocol/x/clob/keeper/liquidations_test.go +++ b/protocol/x/clob/keeper/liquidations_test.go @@ -1177,6 +1177,7 @@ func TestPlacePerpetualLiquidation_PreexistingLiquidation(t *testing.T) { constants.ClobPair_Btc.SubticksPerTick, constants.ClobPair_Btc.StepBaseQuantums, constants.BtcUsd_100PercentMarginRequirement.Params.LiquidityTier, + constants.BtcUsd_100PercentMarginRequirement.Params.MarketType, ), ), ).Once().Return() @@ -1206,6 +1207,7 @@ func TestPlacePerpetualLiquidation_PreexistingLiquidation(t *testing.T) { constants.ClobPair_Eth.SubticksPerTick, constants.ClobPair_Eth.StepBaseQuantums, constants.EthUsd_100PercentMarginRequirement.Params.LiquidityTier, + constants.EthUsd_100PercentMarginRequirement.Params.MarketType, ), ), ).Once().Return() @@ -2088,6 +2090,7 @@ func TestPlacePerpetualLiquidation_Deleveraging(t *testing.T) { clobPair.SubticksPerTick, clobPair.StepBaseQuantums, perpetuals[i].Params.LiquidityTier, + perpetuals[i].Params.MarketType, ), ), ).Once().Return() @@ -2205,6 +2208,7 @@ func TestPlacePerpetualLiquidation_SendOffchainMessages(t *testing.T) { constants.ClobPair_Btc.SubticksPerTick, constants.ClobPair_Btc.StepBaseQuantums, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.LiquidityTier, + constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.MarketType, ), ), ).Once().Return() @@ -3730,6 +3734,7 @@ func TestGetLiquidationInsuranceFundDelta(t *testing.T) { constants.ClobPair_Btc.SubticksPerTick, constants.ClobPair_Btc.StepBaseQuantums, tc.perpetuals[0].Params.LiquidityTier, + tc.perpetuals[0].Params.MarketType, ), ), ).Once().Return() @@ -4469,6 +4474,7 @@ func TestGetPerpetualPositionToLiquidate(t *testing.T) { clobPair.SubticksPerTick, clobPair.StepBaseQuantums, tc.perpetuals[perpetualId].Params.LiquidityTier, + tc.perpetuals[perpetualId].Params.MarketType, ), ), ).Once().Return() @@ -5034,6 +5040,7 @@ func TestGetMaxAndMinPositionNotionalLiquidatable(t *testing.T) { constants.ClobPair_Btc.SubticksPerTick, constants.ClobPair_Btc.StepBaseQuantums, constants.BtcUsd_100PercentMarginRequirement.Params.LiquidityTier, + constants.BtcUsd_100PercentMarginRequirement.Params.MarketType, ), ), ).Once().Return() @@ -5188,6 +5195,7 @@ func TestSortLiquidationOrders(t *testing.T) { constants.ClobPair_Btc.SubticksPerTick, constants.ClobPair_Btc.StepBaseQuantums, constants.BtcUsd_100PercentMarginRequirement.Params.LiquidityTier, + constants.BtcUsd_100PercentMarginRequirement.Params.MarketType, ), ), ).Once().Return() diff --git a/protocol/x/clob/keeper/msg_server_create_clob_pair_test.go b/protocol/x/clob/keeper/msg_server_create_clob_pair_test.go index d93cf10f26..bbb64676a1 100644 --- a/protocol/x/clob/keeper/msg_server_create_clob_pair_test.go +++ b/protocol/x/clob/keeper/msg_server_create_clob_pair_test.go @@ -1,9 +1,10 @@ package keeper_test import ( - "github.com/dydxprotocol/v4-chain/protocol/lib" "testing" + "github.com/dydxprotocol/v4-chain/protocol/lib" + indexerevents "github.com/dydxprotocol/v4-chain/protocol/indexer/events" "github.com/dydxprotocol/v4-chain/protocol/indexer/indexer_manager" "github.com/dydxprotocol/v4-chain/protocol/mocks" @@ -62,6 +63,7 @@ func TestCreateClobPair(t *testing.T) { testClobPair1.SubticksPerTick, testClobPair1.StepBaseQuantums, testPerp1.Params.LiquidityTier, + testPerp1.Params.MarketType, ), ), ).Return() diff --git a/protocol/x/clob/keeper/msg_server_place_order_test.go b/protocol/x/clob/keeper/msg_server_place_order_test.go index 48fd1547a1..b65a5326d7 100644 --- a/protocol/x/clob/keeper/msg_server_place_order_test.go +++ b/protocol/x/clob/keeper/msg_server_place_order_test.go @@ -176,6 +176,7 @@ func TestPlaceOrder_Error(t *testing.T) { clobPair.SubticksPerTick, clobPair.StepBaseQuantums, perpetual.Params.LiquidityTier, + perpetual.Params.MarketType, ), ), ).Once().Return() @@ -320,6 +321,7 @@ func TestPlaceOrder_Success(t *testing.T) { clobPair.SubticksPerTick, clobPair.StepBaseQuantums, perpetual.Params.LiquidityTier, + perpetual.Params.MarketType, ), ), ).Once().Return() diff --git a/protocol/x/clob/keeper/orders_test.go b/protocol/x/clob/keeper/orders_test.go index 3bf0795743..dfc374a8c0 100644 --- a/protocol/x/clob/keeper/orders_test.go +++ b/protocol/x/clob/keeper/orders_test.go @@ -1044,6 +1044,7 @@ func TestPlaceOrder_SendOffchainMessages(t *testing.T) { constants.ClobPair_Btc.SubticksPerTick, constants.ClobPair_Btc.StepBaseQuantums, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.LiquidityTier, + constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.MarketType, ), ), ).Once().Return() @@ -1098,6 +1099,7 @@ func TestPerformStatefulOrderValidation_PreExistingStatefulOrder(t *testing.T) { constants.ClobPair_Btc.SubticksPerTick, constants.ClobPair_Btc.StepBaseQuantums, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.LiquidityTier, + constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.MarketType, ), ), ).Once().Return() @@ -1852,6 +1854,7 @@ func TestGetStatePosition_Success(t *testing.T) { cp.SubticksPerTick, cp.StepBaseQuantums, constants.Perpetuals_DefaultGenesisState.Perpetuals[i].Params.LiquidityTier, + constants.Perpetuals_DefaultGenesisState.Perpetuals[i].Params.MarketType, ), ), ).Once().Return() @@ -2065,6 +2068,7 @@ func TestInitStatefulOrders(t *testing.T) { constants.ClobPair_Btc.SubticksPerTick, constants.ClobPair_Btc.StepBaseQuantums, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.LiquidityTier, + constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.MarketType, ), ), ).Once().Return() @@ -2196,6 +2200,7 @@ func TestHydrateUntriggeredConditionalOrdersInMemClob(t *testing.T) { constants.ClobPair_Btc.SubticksPerTick, constants.ClobPair_Btc.StepBaseQuantums, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.LiquidityTier, + constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.MarketType, ), ), ).Once().Return() diff --git a/protocol/x/clob/keeper/process_operations_test.go b/protocol/x/clob/keeper/process_operations_test.go index a631110803..df6af12351 100644 --- a/protocol/x/clob/keeper/process_operations_test.go +++ b/protocol/x/clob/keeper/process_operations_test.go @@ -2261,6 +2261,7 @@ func setupProcessProposerOperationsTestCase( clobPair.SubticksPerTick, clobPair.StepBaseQuantums, tc.perpetuals[perpetualId].Params.LiquidityTier, + tc.perpetuals[perpetualId].Params.MarketType, ), ), ).Once().Return() diff --git a/protocol/x/clob/module_test.go b/protocol/x/clob/module_test.go index df3e7e95f1..f55d74033e 100644 --- a/protocol/x/clob/module_test.go +++ b/protocol/x/clob/module_test.go @@ -305,6 +305,7 @@ func TestAppModule_InitExportGenesis(t *testing.T) { uint32(100), uint64(5), constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.LiquidityTier, + constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.MarketType, ), ), ).Once().Return()