diff --git a/indexer/packages/postgres/README.md b/indexer/packages/postgres/README.md index c4ddb219014..a8febac17f9 100644 --- a/indexer/packages/postgres/README.md +++ b/indexer/packages/postgres/README.md @@ -7,6 +7,8 @@ Add a knex migration by running `pnpm run migrate:make ` Run the migration with `pnpm run migrate` +In `__tests__/db/migrations.test.ts`, test cases may be expected to fail (and hence should be commented out) if a model is modified due to the latest migration. + In order to migrate in dev and staging, you must redeploy and run bazooka. TODO(CORE-512): Add info/resources around bazooka. [Doc](https://www.notion.so/dydx/Engineering-Runbook-15064661da9643188ce33e341b68e7bb#cb2283d80ef14a51924f3bd1a538fd82). diff --git a/indexer/packages/postgres/__tests__/db/migrations.test.ts b/indexer/packages/postgres/__tests__/db/migrations.test.ts index e41d4054168..ec68e8d44ac 100644 --- a/indexer/packages/postgres/__tests__/db/migrations.test.ts +++ b/indexer/packages/postgres/__tests__/db/migrations.test.ts @@ -10,8 +10,6 @@ import { } from '../helpers/constants'; import { seedData } from '../helpers/mock-generators'; -// NOTE: If a model is modified for a migration then these -// tests must be skipped until the following migration describe('Test new migration', () => { beforeEach(async () => { await migrate(); @@ -25,21 +23,36 @@ describe('Test new migration', () => { await teardown(); }); - it('test adding most recent migration', async () => { + it('test UP and DOWN for most recent migration without seed data', async () => { + // remove latest migration + await multiDown(1); + + // re-add latest migration + await knexPrimary.migrate.latest({ loadExtensions: ['.js'] }); + + // re-remove latest migration + await multiDown(1); + }); + + // NOTE: If a model is modified for a migration then these + // tests must be skipped until the following migration + it.skip('[Will fail if a model is modified for migration - see README] test adding most recent migration', async () => { // remove latest migration await multiDown(1); // add data to verify you can roll up and then later roll down await seedData(); - // readd latest migration + // re-add latest migration await knexPrimary.migrate.latest({ loadExtensions: ['.js'] }); // re-remove latest migration await multiDown(1); }); - it('test adding most recent migration with rows that fail index that should only be applied going forward', async () => { + // NOTE: If a model is modified for a migration then these + // tests must be skipped until the following migration + it.skip('[Will fail if a model is modified for migration - see README] test adding most recent migration with rows that fail index that should only be applied going forward', async () => { // remove latest migration await multiDown(1); @@ -47,7 +60,7 @@ describe('Test new migration', () => { await seedData(); await OrderTable.create(defaultOrder); - // readd latest migration + // re-add latest migration await knexPrimary.migrate.latest({ loadExtensions: ['.js'] }); // re-remove latest migration diff --git a/indexer/packages/postgres/__tests__/helpers/constants.ts b/indexer/packages/postgres/__tests__/helpers/constants.ts index aeaedeae3c9..7f9ff7102ee 100644 --- a/indexer/packages/postgres/__tests__/helpers/constants.ts +++ b/indexer/packages/postgres/__tests__/helpers/constants.ts @@ -285,6 +285,7 @@ export const defaultPerpetualMarket: PerpetualMarketCreateObject = { liquidityTierId: 0, marketType: PerpetualMarketType.CROSS, baseOpenInterest: '100000', + defaultFundingRate1H: '0', }; export const defaultPerpetualMarket2: PerpetualMarketCreateObject = { id: '1', @@ -304,6 +305,7 @@ export const defaultPerpetualMarket2: PerpetualMarketCreateObject = { liquidityTierId: 0, marketType: PerpetualMarketType.CROSS, baseOpenInterest: '100000', + defaultFundingRate1H: '0', }; export const defaultPerpetualMarket3: PerpetualMarketCreateObject = { id: '2', @@ -323,6 +325,7 @@ export const defaultPerpetualMarket3: PerpetualMarketCreateObject = { liquidityTierId: 0, marketType: PerpetualMarketType.CROSS, baseOpenInterest: '100000', + defaultFundingRate1H: '0', }; export const isolatedPerpetualMarket: PerpetualMarketCreateObject = { @@ -343,6 +346,7 @@ export const isolatedPerpetualMarket: PerpetualMarketCreateObject = { liquidityTierId: 0, marketType: PerpetualMarketType.ISOLATED, baseOpenInterest: '100000', + defaultFundingRate1H: '0.0001', }; export const isolatedPerpetualMarket2: PerpetualMarketCreateObject = { @@ -363,6 +367,7 @@ export const isolatedPerpetualMarket2: PerpetualMarketCreateObject = { liquidityTierId: 0, marketType: PerpetualMarketType.ISOLATED, baseOpenInterest: '100000', + defaultFundingRate1H: '0.0001', }; // ============== Orders ============== diff --git a/indexer/packages/postgres/src/db/migrations/migration_files/20250107145033_default_1hr_funding_for_perp.ts b/indexer/packages/postgres/src/db/migrations/migration_files/20250107145033_default_1hr_funding_for_perp.ts new file mode 100644 index 00000000000..466bcba80c0 --- /dev/null +++ b/indexer/packages/postgres/src/db/migrations/migration_files/20250107145033_default_1hr_funding_for_perp.ts @@ -0,0 +1,13 @@ +import * as Knex from 'knex'; + +export async function up(knex: Knex): Promise { + await knex.schema.alterTable('perpetual_markets', (table) => { + table.decimal('defaultFundingRate1H', null).defaultTo(0); + }); +} + +export async function down(knex: Knex): Promise { + await knex.schema.alterTable('perpetual_markets', (table) => { + table.dropColumn('defaultFundingRate1H'); + }); +} diff --git a/indexer/packages/postgres/src/models/perpetual-market-model.ts b/indexer/packages/postgres/src/models/perpetual-market-model.ts index 401cbdc39b7..22f5cab066a 100644 --- a/indexer/packages/postgres/src/models/perpetual-market-model.ts +++ b/indexer/packages/postgres/src/models/perpetual-market-model.ts @@ -86,6 +86,7 @@ export default class PerpetualMarketModel extends Model { liquidityTierId: { type: 'integer' }, marketType: { type: 'string' }, baseOpenInterest: { type: 'string', pattern: NumericPattern }, + defaultFundingRate1H: { type: 'string', pattern: NumericPattern }, }, }; } @@ -115,6 +116,7 @@ export default class PerpetualMarketModel extends Model { liquidityTierId: 'integer', marketType: 'string', baseOpenInterest: 'string', + defaultFundingRate1H: 'string', }; } @@ -151,4 +153,6 @@ export default class PerpetualMarketModel extends Model { marketType!: PerpetualMarketType; baseOpenInterest!: string; + + defaultFundingRate1H!: string; } diff --git a/indexer/packages/postgres/src/types/db-model-types.ts b/indexer/packages/postgres/src/types/db-model-types.ts index 9557be8edee..b3b3d208b29 100644 --- a/indexer/packages/postgres/src/types/db-model-types.ts +++ b/indexer/packages/postgres/src/types/db-model-types.ts @@ -95,6 +95,7 @@ export interface PerpetualMarketFromDatabase { liquidityTierId: number, marketType: PerpetualMarketType, baseOpenInterest: string, + defaultFundingRate1H: string, } export interface FillFromDatabase { diff --git a/indexer/packages/postgres/src/types/perpetual-market-types.ts b/indexer/packages/postgres/src/types/perpetual-market-types.ts index 47d4ce2dd74..9f75a625d09 100644 --- a/indexer/packages/postgres/src/types/perpetual-market-types.ts +++ b/indexer/packages/postgres/src/types/perpetual-market-types.ts @@ -18,6 +18,7 @@ export interface PerpetualMarketCreateObject { liquidityTierId: number, marketType: PerpetualMarketType, baseOpenInterest: string, + defaultFundingRate1H: string, } export interface PerpetualMarketUpdateObject { @@ -54,6 +55,7 @@ export enum PerpetualMarketColumns { subticksPerTick = 'subticksPerTick', stepBaseQuantums = 'stepBaseQuantums', liquidityTierId = 'liquidityTierId', + defaultFundingRate1H = 'defaultFundingRate1H', } export enum PerpetualMarketStatus { diff --git a/indexer/packages/postgres/src/types/websocket-message-types.ts b/indexer/packages/postgres/src/types/websocket-message-types.ts index 4f5f812250b..eb2e907099b 100644 --- a/indexer/packages/postgres/src/types/websocket-message-types.ts +++ b/indexer/packages/postgres/src/types/websocket-message-types.ts @@ -217,6 +217,7 @@ export interface TradingPerpetualMarketMessage { openInterestLowerCap?: string, openInterestUpperCap?: string, baseOpenInterest?: string, + defaultFundingRate1H?: string, // Fields that are likely to change priceChange24H?: string, 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 460f1d790da..4f9676790eb 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 @@ -1028,6 +1028,12 @@ export interface PerpetualMarketCreateEventV2 { /** Market type of the perpetual. */ marketType: PerpetualMarketType; + /** + * Since: v8.x + * Default 8hr funding rate in parts-per-million. + */ + + defaultFunding8hrPpm: number; } /** * PerpetualMarketCreateEventV2 message contains all the information about a @@ -1101,6 +1107,12 @@ export interface PerpetualMarketCreateEventV2SDKType { /** Market type of the perpetual. */ market_type: PerpetualMarketTypeSDKType; + /** + * Since: v8.x + * Default 8hr funding rate in parts-per-million. + */ + + default_funding8hr_ppm: number; } /** * LiquidityTierUpsertEventV1 message contains all the information to @@ -1373,6 +1385,12 @@ export interface UpdatePerpetualEventV2 { /** Market type of the perpetual. */ marketType: PerpetualMarketType; + /** + * Since: v8.x + * Default 8hr funding rate in parts-per-million. + */ + + defaultFunding8hrPpm: number; } /** * UpdatePerpetualEventV2 message contains all the information about an update @@ -1415,6 +1433,12 @@ export interface UpdatePerpetualEventV2SDKType { /** Market type of the perpetual. */ market_type: PerpetualMarketTypeSDKType; + /** + * Since: v8.x + * Default 8hr funding rate in parts-per-million. + */ + + default_funding8hr_ppm: number; } /** * TradingRewardsEventV1 is communicates all trading rewards for all accounts @@ -3189,7 +3213,8 @@ function createBasePerpetualMarketCreateEventV2(): PerpetualMarketCreateEventV2 subticksPerTick: 0, stepBaseQuantums: Long.UZERO, liquidityTier: 0, - marketType: 0 + marketType: 0, + defaultFunding8hrPpm: 0 }; } @@ -3239,6 +3264,10 @@ export const PerpetualMarketCreateEventV2 = { writer.uint32(88).int32(message.marketType); } + if (message.defaultFunding8hrPpm !== 0) { + writer.uint32(96).int32(message.defaultFunding8hrPpm); + } + return writer; }, @@ -3295,6 +3324,10 @@ export const PerpetualMarketCreateEventV2 = { message.marketType = (reader.int32() as any); break; + case 12: + message.defaultFunding8hrPpm = reader.int32(); + break; + default: reader.skipType(tag & 7); break; @@ -3317,6 +3350,7 @@ export const PerpetualMarketCreateEventV2 = { message.stepBaseQuantums = object.stepBaseQuantums !== undefined && object.stepBaseQuantums !== null ? Long.fromValue(object.stepBaseQuantums) : Long.UZERO; message.liquidityTier = object.liquidityTier ?? 0; message.marketType = object.marketType ?? 0; + message.defaultFunding8hrPpm = object.defaultFunding8hrPpm ?? 0; return message; } @@ -3584,7 +3618,8 @@ function createBaseUpdatePerpetualEventV2(): UpdatePerpetualEventV2 { marketId: 0, atomicResolution: 0, liquidityTier: 0, - marketType: 0 + marketType: 0, + defaultFunding8hrPpm: 0 }; } @@ -3614,6 +3649,10 @@ export const UpdatePerpetualEventV2 = { writer.uint32(48).int32(message.marketType); } + if (message.defaultFunding8hrPpm !== 0) { + writer.uint32(56).int32(message.defaultFunding8hrPpm); + } + return writer; }, @@ -3650,6 +3689,10 @@ export const UpdatePerpetualEventV2 = { message.marketType = (reader.int32() as any); break; + case 7: + message.defaultFunding8hrPpm = reader.int32(); + break; + default: reader.skipType(tag & 7); break; @@ -3667,6 +3710,7 @@ export const UpdatePerpetualEventV2 = { message.atomicResolution = object.atomicResolution ?? 0; message.liquidityTier = object.liquidityTier ?? 0; message.marketType = object.marketType ?? 0; + message.defaultFunding8hrPpm = object.defaultFunding8hrPpm ?? 0; return message; } diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/perpetual.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/perpetual.ts index 720980b76d3..edef9ef967c 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/perpetual.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/perpetual.ts @@ -115,7 +115,7 @@ export interface PerpetualParams { atomicResolution: number; /** - * The default funding payment if there is no price premium. In + * The default (8hr) funding payment if there is no price premium. In * parts-per-million. */ @@ -154,7 +154,7 @@ export interface PerpetualParamsSDKType { atomic_resolution: number; /** - * The default funding payment if there is no price premium. In + * The default (8hr) funding payment if there is no price premium. In * parts-per-million. */ diff --git a/indexer/services/comlink/__tests__/lib/request-helpers/request-transformer.test.ts b/indexer/services/comlink/__tests__/lib/request-helpers/request-transformer.test.ts index 553861281e0..2f45bfd6937 100644 --- a/indexer/services/comlink/__tests__/lib/request-helpers/request-transformer.test.ts +++ b/indexer/services/comlink/__tests__/lib/request-helpers/request-transformer.test.ts @@ -81,6 +81,7 @@ describe('request-transformer', () => { openInterestLowerCap: liquidityTier.openInterestLowerCap, openInterestUpperCap: liquidityTier.openInterestUpperCap, baseOpenInterest: perpetualMarket.baseOpenInterest, + defaultFundingRate1H: perpetualMarket.defaultFundingRate1H, }, ); }); diff --git a/indexer/services/comlink/public/api-documentation.md b/indexer/services/comlink/public/api-documentation.md index 8a3518a8693..88e187ee9fb 100644 --- a/indexer/services/comlink/public/api-documentation.md +++ b/indexer/services/comlink/public/api-documentation.md @@ -2506,7 +2506,8 @@ fetch(`${baseURL}/perpetualMarkets`, "marketType": "CROSS", "openInterestLowerCap": "string", "openInterestUpperCap": "string", - "baseOpenInterest": "string" + "baseOpenInterest": "string", + "defaultFundingRate1H": "string" }, "property2": { "clobPairId": "string", @@ -2529,7 +2530,8 @@ fetch(`${baseURL}/perpetualMarkets`, "marketType": "CROSS", "openInterestLowerCap": "string", "openInterestUpperCap": "string", - "baseOpenInterest": "string" + "baseOpenInterest": "string", + "defaultFundingRate1H": "string" } } } @@ -5387,7 +5389,8 @@ or "marketType": "CROSS", "openInterestLowerCap": "string", "openInterestUpperCap": "string", - "baseOpenInterest": "string" + "baseOpenInterest": "string", + "defaultFundingRate1H": "string" } ``` @@ -5417,6 +5420,7 @@ or |openInterestLowerCap|string|false|none|none| |openInterestUpperCap|string|false|none|none| |baseOpenInterest|string|true|none|none| +|defaultFundingRate1H|string|true|none|none| ## PerpetualMarketResponse @@ -5449,7 +5453,8 @@ or "marketType": "CROSS", "openInterestLowerCap": "string", "openInterestUpperCap": "string", - "baseOpenInterest": "string" + "baseOpenInterest": "string", + "defaultFundingRate1H": "string" }, "property2": { "clobPairId": "string", @@ -5472,7 +5477,8 @@ or "marketType": "CROSS", "openInterestLowerCap": "string", "openInterestUpperCap": "string", - "baseOpenInterest": "string" + "baseOpenInterest": "string", + "defaultFundingRate1H": "string" } } } diff --git a/indexer/services/comlink/public/swagger.json b/indexer/services/comlink/public/swagger.json index 0737485b430..8f0b42b3bed 100644 --- a/indexer/services/comlink/public/swagger.json +++ b/indexer/services/comlink/public/swagger.json @@ -1138,6 +1138,9 @@ }, "baseOpenInterest": { "type": "string" + }, + "defaultFundingRate1H": { + "type": "string" } }, "required": [ @@ -1159,7 +1162,8 @@ "stepBaseQuantums", "subticksPerTick", "marketType", - "baseOpenInterest" + "baseOpenInterest", + "defaultFundingRate1H" ], "type": "object", "additionalProperties": false diff --git a/indexer/services/comlink/src/request-helpers/request-transformer.ts b/indexer/services/comlink/src/request-helpers/request-transformer.ts index 17f741bce50..7c566ca8e58 100644 --- a/indexer/services/comlink/src/request-helpers/request-transformer.ts +++ b/indexer/services/comlink/src/request-helpers/request-transformer.ts @@ -389,6 +389,7 @@ export function perpetualMarketToResponseObject( openInterestLowerCap: liquidityTier.openInterestLowerCap, openInterestUpperCap: liquidityTier.openInterestUpperCap, baseOpenInterest: perpetualMarket.baseOpenInterest, + defaultFundingRate1H: perpetualMarket.defaultFundingRate1H, }; } diff --git a/indexer/services/comlink/src/types.ts b/indexer/services/comlink/src/types.ts index 30e540d4b04..e8d5ed56648 100644 --- a/indexer/services/comlink/src/types.ts +++ b/indexer/services/comlink/src/types.ts @@ -352,6 +352,7 @@ export interface PerpetualMarketResponseObject { openInterestLowerCap?: string, openInterestUpperCap?: string, baseOpenInterest: string, + defaultFundingRate1H: string, } /* ------- ORDERBOOK TYPES ------- */ diff --git a/indexer/services/ender/__tests__/helpers/constants.ts b/indexer/services/ender/__tests__/helpers/constants.ts index c871f589bad..5795fe5c329 100644 --- a/indexer/services/ender/__tests__/helpers/constants.ts +++ b/indexer/services/ender/__tests__/helpers/constants.ts @@ -158,6 +158,7 @@ export const defaultPerpetualMarketCreateEventV2: PerpetualMarketCreateEventV2 = stepBaseQuantums: Long.fromValue(10, true), liquidityTier: 0, marketType: PerpetualMarketType.PERPETUAL_MARKET_TYPE_ISOLATED, + defaultFunding8hrPpm: 100, }; export const defaultLiquidityTierUpsertEventV2: LiquidityTierUpsertEventV2 = { @@ -207,6 +208,7 @@ export const defaultUpdatePerpetualEventV2: UpdatePerpetualEventV2 = { atomicResolution: -8, liquidityTier: 1, marketType: PerpetualMarketType.PERPETUAL_MARKET_TYPE_CROSS, + defaultFunding8hrPpm: 100, }; export const defaultUpdateClobPairEvent: UpdateClobPairEventV1 = { diff --git a/indexer/services/ender/__tests__/helpers/notification-functions.test.ts b/indexer/services/ender/__tests__/helpers/notification-functions.test.ts index 23cc5553231..bd9cfb27501 100644 --- a/indexer/services/ender/__tests__/helpers/notification-functions.test.ts +++ b/indexer/services/ender/__tests__/helpers/notification-functions.test.ts @@ -51,6 +51,7 @@ const mockMarket: PerpetualMarketFromDatabase = { liquidityTierId: 1, marketType: PerpetualMarketType.ISOLATED, baseOpenInterest: '0', + defaultFundingRate1H: '0', }; describe('notification functions', () => { diff --git a/indexer/services/ender/src/helpers/kafka-helper.ts b/indexer/services/ender/src/helpers/kafka-helper.ts index db88bdac28b..24ae7eaa84d 100644 --- a/indexer/services/ender/src/helpers/kafka-helper.ts +++ b/indexer/services/ender/src/helpers/kafka-helper.ts @@ -347,6 +347,7 @@ export function generatePerpetualMarketMessage( nextFundingRate: perpetualMarket.nextFundingRate, openInterest: perpetualMarket.openInterest, baseOpenInterest: perpetualMarket.baseOpenInterest, + defaultFundingRate1H: perpetualMarket.defaultFundingRate1H, }; }) .value(); diff --git a/indexer/services/ender/src/scripts/handlers/dydx_perpetual_market_v2_handler.sql b/indexer/services/ender/src/scripts/handlers/dydx_perpetual_market_v2_handler.sql index df7fbaf7c61..e0c0c9c2961 100644 --- a/indexer/services/ender/src/scripts/handlers/dydx_perpetual_market_v2_handler.sql +++ b/indexer/services/ender/src/scripts/handlers/dydx_perpetual_market_v2_handler.sql @@ -9,6 +9,8 @@ CREATE OR REPLACE FUNCTION dydx_perpetual_market_v2_handler(event_data jsonb) RE (Note that no text should exist before the function declaration to ensure that exception line numbers are correct.) */ DECLARE + PPM_EXPONENT constant numeric = -6; + FUNDING_RATE_FROM_PROTOCOL_IN_HOURS constant numeric = 8; perpetual_market_record perpetual_markets%ROWTYPE; BEGIN perpetual_market_record."id" = (event_data->'id')::bigint; @@ -28,6 +30,16 @@ BEGIN perpetual_market_record."liquidityTierId" = (event_data->'liquidityTier')::integer; perpetual_market_record."marketType" = dydx_protocol_market_type_to_perpetual_market_type(event_data->'marketType'); perpetual_market_record."baseOpenInterest" = 0; + perpetual_market_record."defaultFundingRate1H" = + /* For backwards compatibility, handle the case where defaultFundingPpm is not present */ + CASE + /* Convert defaultFundingPpm from parts-per-million to a rate */ + WHEN (event_data->>'defaultFunding8hrPpm') IS NOT NULL THEN dydx_trim_scale( + power(10, PPM_EXPONENT) / + FUNDING_RATE_FROM_PROTOCOL_IN_HOURS * + (event_data->'defaultFunding8hrPpm')::numeric) + ELSE 0.0 + END; INSERT INTO perpetual_markets VALUES (perpetual_market_record.*) RETURNING * INTO perpetual_market_record; diff --git a/indexer/services/ender/src/scripts/handlers/dydx_update_perpetual_v2_handler.sql b/indexer/services/ender/src/scripts/handlers/dydx_update_perpetual_v2_handler.sql index 202ac39572e..efe4088713c 100644 --- a/indexer/services/ender/src/scripts/handlers/dydx_update_perpetual_v2_handler.sql +++ b/indexer/services/ender/src/scripts/handlers/dydx_update_perpetual_v2_handler.sql @@ -9,6 +9,8 @@ CREATE OR REPLACE FUNCTION dydx_update_perpetual_v2_handler(event_data jsonb) RE (Note that no text should exist before the function declaration to ensure that exception line numbers are correct.) */ DECLARE + PPM_EXPONENT constant numeric = -6; + FUNDING_RATE_FROM_PROTOCOL_IN_HOURS constant numeric = 8; perpetual_market_id bigint; perpetual_market_record perpetual_markets%ROWTYPE; BEGIN @@ -18,14 +20,24 @@ BEGIN perpetual_market_record."atomicResolution" = (event_data->'atomicResolution')::integer; perpetual_market_record."liquidityTierId" = (event_data->'liquidityTier')::integer; perpetual_market_record."marketType" = dydx_protocol_market_type_to_perpetual_market_type(event_data->'marketType'); - + perpetual_market_record."defaultFundingRate1H" = + /* For backwards compatibility, handle the case where defaultFundingPpm is not present */ + CASE + /* Convert defaultFundingPpm from parts-per-million to a rate */ + WHEN (event_data->>'defaultFunding8hrPpm') IS NOT NULL THEN dydx_trim_scale( + power(10, PPM_EXPONENT) / + FUNDING_RATE_FROM_PROTOCOL_IN_HOURS * + (event_data->'defaultFunding8hrPpm')::numeric) + ELSE 0.0 + END; UPDATE perpetual_markets SET "ticker" = perpetual_market_record."ticker", "marketId" = perpetual_market_record."marketId", "atomicResolution" = perpetual_market_record."atomicResolution", "liquidityTierId" = perpetual_market_record."liquidityTierId", - "marketType" = perpetual_market_record."marketType" + "marketType" = perpetual_market_record."marketType", + "defaultFundingRate1H" = perpetual_market_record."defaultFundingRate1H" WHERE "id" = perpetual_market_id RETURNING * INTO perpetual_market_record; diff --git a/indexer/services/roundtable/__tests__/helpers/pnl-ticks-helper.test.ts b/indexer/services/roundtable/__tests__/helpers/pnl-ticks-helper.test.ts index e962c0f0771..2352158f4bf 100644 --- a/indexer/services/roundtable/__tests__/helpers/pnl-ticks-helper.test.ts +++ b/indexer/services/roundtable/__tests__/helpers/pnl-ticks-helper.test.ts @@ -382,6 +382,7 @@ describe('pnl-ticks-helper', () => { liquidityTierId: 0, marketType: PerpetualMarketType.ISOLATED, baseOpenInterest: '100000', + defaultFundingRate1H: '0.0001', }); await perpetualMarketRefresher.updatePerpetualMarkets(); const positions2: PerpetualPositionFromDatabase[] = [ diff --git a/indexer/services/roundtable/src/lib/athena-ddl-tables/perpetual_markets.ts b/indexer/services/roundtable/src/lib/athena-ddl-tables/perpetual_markets.ts index 46cbd618c78..c27a1138dc0 100644 --- a/indexer/services/roundtable/src/lib/athena-ddl-tables/perpetual_markets.ts +++ b/indexer/services/roundtable/src/lib/athena-ddl-tables/perpetual_markets.ts @@ -22,7 +22,8 @@ const RAW_TABLE_COLUMNS: string = ` \`stepBaseQuantums\` int, \`liquidityTierId\` int, \`marketType\` string, - \`baseOpenInterest\` string + \`baseOpenInterest\` string, + \`defaultFundingRate1H\` string `; const TABLE_COLUMNS: string = ` "id", @@ -41,7 +42,8 @@ const TABLE_COLUMNS: string = ` "stepBaseQuantums", "liquidityTierId", "marketType", - ${castToDouble('baseOpenInterest')} + ${castToDouble('baseOpenInterest')}, + ${castToDouble('defaultFundingRate1H')} `; export function generateRawTable(tablePrefix: string, rdsExportIdentifier: string): string { diff --git a/indexer/services/roundtable/src/tasks/market-updater.ts b/indexer/services/roundtable/src/tasks/market-updater.ts index 306fc80c346..ab6d2ea30ec 100644 --- a/indexer/services/roundtable/src/tasks/market-updater.ts +++ b/indexer/services/roundtable/src/tasks/market-updater.ts @@ -70,6 +70,7 @@ export default async function runTask(): Promise { // TODO(DEC-1149 Add support for pulling information from candles FillTable.get24HourInformation(clobPairIds), PerpetualPositionTable.getOpenInterestLong(perpetualMarketIds), + // TODO(CT-1340): Need to add default funding rate to this value. NextFundingCache.getNextFunding(redisClient, tickers), ]); diff --git a/proto/dydxprotocol/indexer/events/events.proto b/proto/dydxprotocol/indexer/events/events.proto index 3568673e7d2..2367b87103d 100644 --- a/proto/dydxprotocol/indexer/events/events.proto +++ b/proto/dydxprotocol/indexer/events/events.proto @@ -423,6 +423,10 @@ message PerpetualMarketCreateEventV2 { // Market type of the perpetual. dydxprotocol.indexer.protocol.v1.PerpetualMarketType market_type = 11; + + // Since: v8.x + // Default 8hr funding rate in parts-per-million. + int32 default_funding8hr_ppm = 12; } // LiquidityTierUpsertEventV1 message contains all the information to @@ -542,6 +546,10 @@ message UpdatePerpetualEventV2 { // Market type of the perpetual. dydxprotocol.indexer.protocol.v1.PerpetualMarketType market_type = 6; + + // Since: v8.x + // Default 8hr funding rate in parts-per-million. + int32 default_funding8hr_ppm = 7; } // TradingRewardsEventV1 is communicates all trading rewards for all accounts diff --git a/proto/dydxprotocol/perpetuals/perpetual.proto b/proto/dydxprotocol/perpetuals/perpetual.proto index cb5132ea0f3..eb7775b9153 100644 --- a/proto/dydxprotocol/perpetuals/perpetual.proto +++ b/proto/dydxprotocol/perpetuals/perpetual.proto @@ -55,7 +55,7 @@ message PerpetualParams { // a position size of one full coin. sint32 atomic_resolution = 4; - // The default funding payment if there is no price premium. In + // The default (8hr) funding payment if there is no price premium. In // parts-per-million. sint32 default_funding_ppm = 5; diff --git a/protocol/indexer/events/events.pb.go b/protocol/indexer/events/events.pb.go index c7a34d5daba..cd955b16676 100644 --- a/protocol/indexer/events/events.pb.go +++ b/protocol/indexer/events/events.pb.go @@ -1861,6 +1861,9 @@ type PerpetualMarketCreateEventV2 struct { 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"` + // Since: v8.x + // Default 8hr funding rate in parts-per-million. + DefaultFunding8HrPpm int32 `protobuf:"varint,12,opt,name=default_funding8hr_ppm,json=defaultFunding8hrPpm,proto3" json:"default_funding8hr_ppm,omitempty"` } func (m *PerpetualMarketCreateEventV2) Reset() { *m = PerpetualMarketCreateEventV2{} } @@ -1973,6 +1976,13 @@ func (m *PerpetualMarketCreateEventV2) GetMarketType() types.PerpetualMarketType return types.PerpetualMarketType_PERPETUAL_MARKET_TYPE_UNSPECIFIED } +func (m *PerpetualMarketCreateEventV2) GetDefaultFunding8HrPpm() int32 { + if m != nil { + return m.DefaultFunding8HrPpm + } + return 0 +} + // LiquidityTierUpsertEventV1 message contains all the information to // create/update a Liquidity Tier on the dYdX chain. type LiquidityTierUpsertEventV1 struct { @@ -2272,6 +2282,9 @@ type UpdatePerpetualEventV2 struct { LiquidityTier uint32 `protobuf:"varint,5,opt,name=liquidity_tier,json=liquidityTier,proto3" json:"liquidity_tier,omitempty"` // Market type of the perpetual. MarketType types.PerpetualMarketType `protobuf:"varint,6,opt,name=market_type,json=marketType,proto3,enum=dydxprotocol.indexer.protocol.v1.PerpetualMarketType" json:"market_type,omitempty"` + // Since: v8.x + // Default 8hr funding rate in parts-per-million. + DefaultFunding8HrPpm int32 `protobuf:"varint,7,opt,name=default_funding8hr_ppm,json=defaultFunding8hrPpm,proto3" json:"default_funding8hr_ppm,omitempty"` } func (m *UpdatePerpetualEventV2) Reset() { *m = UpdatePerpetualEventV2{} } @@ -2349,6 +2362,13 @@ func (m *UpdatePerpetualEventV2) GetMarketType() types.PerpetualMarketType { return types.PerpetualMarketType_PERPETUAL_MARKET_TYPE_UNSPECIFIED } +func (m *UpdatePerpetualEventV2) GetDefaultFunding8HrPpm() int32 { + if m != nil { + return m.DefaultFunding8HrPpm + } + return 0 +} + // TradingRewardsEventV1 is communicates all trading rewards for all accounts // that receive trade rewards in the block. type TradingRewardsEventV1 struct { @@ -2815,161 +2835,163 @@ func init() { } var fileDescriptor_6331dfb59c6fd2bb = []byte{ - // 2458 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5a, 0xcd, 0x6f, 0x23, 0x49, - 0x15, 0x4f, 0xdb, 0x8e, 0xe3, 0x3c, 0xc7, 0x19, 0xbb, 0xe2, 0x64, 0x9c, 0x04, 0x32, 0x43, 0x4b, - 0x48, 0xa3, 0xd9, 0x19, 0x67, 0x12, 0x76, 0x57, 0xab, 0x3d, 0x20, 0xe2, 0x7c, 0x6c, 0x1c, 0x25, - 0x19, 0x6f, 0xe7, 0x63, 0x77, 0x07, 0xb4, 0x4d, 0xa5, 0xbb, 0xec, 0x94, 0xd2, 0x5f, 0xd3, 0xdd, - 0xce, 0x4c, 0x06, 0x71, 0x43, 0x2c, 0x48, 0x48, 0x20, 0x21, 0x0e, 0x1c, 0x90, 0xb8, 0x70, 0x59, - 0x89, 0x03, 0x12, 0x70, 0xe3, 0x80, 0xb8, 0xec, 0x8d, 0x11, 0x27, 0x04, 0xd2, 0x0a, 0xcd, 0x1c, - 0xf8, 0x37, 0x50, 0x7d, 0x74, 0xfb, 0xdb, 0xf1, 0x4c, 0xb2, 0xd2, 0x0a, 0xed, 0x29, 0xae, 0xf7, - 0xea, 0xfd, 0xde, 0xab, 0xf7, 0x5e, 0x55, 0xbd, 0x7a, 0x1d, 0xb8, 0x63, 0x5e, 0x98, 0x4f, 0x3d, - 0xdf, 0x0d, 0x5d, 0xc3, 0xb5, 0x96,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 0xfe, 0x58, 0x81, 0x92, 0x46, 0x1a, 0x34, 0x08, 0x89, 0xbf, 0x16, 0x75, 0xac, - 0xa3, 0x2c, 0x5c, 0x85, 0x09, 0x9f, 0xd4, 0x89, 0x4f, 0x44, 0x03, 0x6a, 0xc8, 0x87, 0x29, 0x2d, - 0x9a, 0x88, 0xde, 0x86, 0xc9, 0xb8, 0xf3, 0x7d, 0xd9, 0xe7, 0x2c, 0xad, 0x35, 0x55, 0xfd, 0x83, - 0x02, 0x48, 0x84, 0xf3, 0x18, 0x37, 0xad, 0xb0, 0xcd, 0x84, 0xe8, 0xdb, 0xd8, 0xa5, 0x26, 0xc8, - 0x89, 0x23, 0x54, 0x96, 0x9b, 0xf1, 0xad, 0x99, 0xe4, 0x07, 0xdc, 0xfd, 0xcb, 0x0f, 0x38, 0x6e, - 0x55, 0xe7, 0x95, 0x59, 0xd1, 0x3e, 0x7b, 0xb1, 0xa4, 0x3c, 0x7f, 0xb1, 0xa4, 0xfc, 0xe7, 0xc5, - 0x92, 0xf2, 0x8b, 0x97, 0x4b, 0x63, 0xcf, 0x5f, 0x2e, 0x8d, 0xfd, 0xf3, 0xe5, 0xd2, 0xd8, 0xa3, - 0x77, 0x46, 0xcf, 0xfe, 0xce, 0xff, 0x37, 0x39, 0x49, 0x73, 0xc6, 0xb7, 0xfe, 0x17, 0x00, 0x00, - 0xff, 0xff, 0x24, 0x83, 0xff, 0xe5, 0x95, 0x22, 0x00, 0x00, + // 2488 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x3a, 0xcd, 0x6f, 0x23, 0x59, + 0xf1, 0x69, 0xdb, 0xb1, 0x9d, 0x72, 0x9c, 0xb1, 0x5f, 0x9c, 0x8c, 0x93, 0xfc, 0x7e, 0x99, 0xa1, + 0x25, 0xa4, 0xd1, 0x7e, 0x38, 0x93, 0xb0, 0xbb, 0x5a, 0xed, 0x01, 0x11, 0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0xd0, 0x36, 0x4c, 0x0a, 0x86, 0x89, 0x97, + 0x61, 0xb8, 0x33, 0xa1, 0x09, 0x72, 0xf4, 0x09, 0x14, 0x2d, 0xfa, 0xa8, 0x45, 0x4d, 0x1c, 0x52, + 0xd7, 0x91, 0x4a, 0x8a, 0x74, 0xb7, 0x32, 0xd2, 0x0a, 0x7b, 0x6d, 0x2a, 0xce, 0x92, 0x67, 0xbb, + 0x82, 0xd5, 0x03, 0x45, 0x77, 0x20, 0xd7, 0xa0, 0x96, 0xa5, 0x4b, 0xf7, 0x25, 0xb9, 0xfb, 0x80, + 0x81, 0xd6, 0x85, 0x0b, 0x79, 0xf5, 0x60, 0xf6, 0x69, 0x10, 0xc2, 0xbd, 0x88, 0x58, 0xf5, 0x38, + 0x27, 0xfe, 0x36, 0x21, 0x0c, 0x19, 0xc6, 0xc8, 0xb4, 0x40, 0x86, 0x11, 0xf2, 0x0d, 0x40, 0xa1, + 0x1b, 0x62, 0x4b, 0x67, 0xdc, 0x88, 0xa9, 0x73, 0xaa, 0x72, 0x86, 0x4b, 0x28, 0x70, 0xcc, 0x36, + 0x47, 0xec, 0x33, 0x78, 0xdf, 0x6e, 0xce, 0xa6, 0x9c, 0xed, 0xdb, 0x7d, 0xc4, 0x77, 0x57, 0x60, + 0x16, 0x37, 0x1a, 0xd4, 0xa2, 0x38, 0x24, 0xba, 0x4f, 0x2e, 0x74, 0xde, 0xba, 0x95, 0xa7, 0x44, + 0x0e, 0x8e, 0x51, 0x1a, 0xb9, 0x38, 0x64, 0x88, 0x6a, 0x1e, 0x72, 0x61, 0xdb, 0xcb, 0xea, 0x8f, + 0x93, 0x30, 0xbb, 0x49, 0x2c, 0x72, 0x41, 0x7c, 0xdc, 0xec, 0xe8, 0x1f, 0xbe, 0x0d, 0x10, 0x59, + 0x88, 0x5c, 0xef, 0xc2, 0x46, 0x21, 0xd1, 0x66, 0xc7, 0x98, 0xbb, 0x8d, 0x46, 0x40, 0xc2, 0x90, + 0x3a, 0xc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x2a, 0xc8, 0x8d, 0x63, + 0x74, 0xb1, 0x5b, 0x71, 0xad, 0x4d, 0xf2, 0xb4, 0xf8, 0xe6, 0xd5, 0x69, 0x91, 0x6b, 0xd5, 0x5d, + 0x68, 0xab, 0xda, 0x17, 0xcf, 0x96, 0x95, 0xa7, 0xcf, 0x96, 0x95, 0x7f, 0x3d, 0x5b, 0x56, 0x7e, + 0xfa, 0x7c, 0x79, 0xe2, 0xe9, 0xf3, 0xe5, 0x89, 0xbf, 0x3f, 0x5f, 0x9e, 0x78, 0xf8, 0xee, 0xf8, + 0xd1, 0xdf, 0xfd, 0xbf, 0x2d, 0xa7, 0x69, 0x8e, 0xf8, 0xc6, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, + 0x9c, 0xd2, 0x12, 0xd0, 0x01, 0x23, 0x00, 0x00, } func (m *FundingUpdateV1) Marshal() (dAtA []byte, err error) { @@ -4296,6 +4318,11 @@ func (m *PerpetualMarketCreateEventV2) MarshalToSizedBuffer(dAtA []byte) (int, e _ = i var l int _ = l + if m.DefaultFunding8HrPpm != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.DefaultFunding8HrPpm)) + i-- + dAtA[i] = 0x60 + } if m.MarketType != 0 { i = encodeVarintEvents(dAtA, i, uint64(m.MarketType)) i-- @@ -4524,6 +4551,11 @@ func (m *UpdatePerpetualEventV2) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l + if m.DefaultFunding8HrPpm != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.DefaultFunding8HrPpm)) + i-- + dAtA[i] = 0x38 + } if m.MarketType != 0 { i = encodeVarintEvents(dAtA, i, uint64(m.MarketType)) i-- @@ -5476,6 +5508,9 @@ func (m *PerpetualMarketCreateEventV2) Size() (n int) { if m.MarketType != 0 { n += 1 + sovEvents(uint64(m.MarketType)) } + if m.DefaultFunding8HrPpm != 0 { + n += 1 + sovEvents(uint64(m.DefaultFunding8HrPpm)) + } return n } @@ -5578,6 +5613,9 @@ func (m *UpdatePerpetualEventV2) Size() (n int) { if m.MarketType != 0 { n += 1 + sovEvents(uint64(m.MarketType)) } + if m.DefaultFunding8HrPpm != 0 { + n += 1 + sovEvents(uint64(m.DefaultFunding8HrPpm)) + } return n } @@ -9144,6 +9182,25 @@ func (m *PerpetualMarketCreateEventV2) Unmarshal(dAtA []byte) error { break } } + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultFunding8HrPpm", wireType) + } + m.DefaultFunding8HrPpm = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DefaultFunding8HrPpm |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipEvents(dAtA[iNdEx:]) @@ -9788,6 +9845,25 @@ func (m *UpdatePerpetualEventV2) Unmarshal(dAtA []byte) error { break } } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultFunding8HrPpm", wireType) + } + m.DefaultFunding8HrPpm = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DefaultFunding8HrPpm |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipEvents(dAtA[iNdEx:]) diff --git a/protocol/indexer/events/perpetual.go b/protocol/indexer/events/perpetual.go index c6a5db40a2f..c77a2f3a5b3 100644 --- a/protocol/indexer/events/perpetual.go +++ b/protocol/indexer/events/perpetual.go @@ -14,13 +14,15 @@ func NewUpdatePerpetualEvent( atomicResolution int32, liquidityTier uint32, marketType perptypes.PerpetualMarketType, + defaultFundingPpm int32, ) *UpdatePerpetualEventV2 { return &UpdatePerpetualEventV2{ - Id: id, - Ticker: ticker, - MarketId: marketId, - AtomicResolution: atomicResolution, - LiquidityTier: liquidityTier, - MarketType: v1.ConvertToPerpetualMarketType(marketType), + Id: id, + Ticker: ticker, + MarketId: marketId, + AtomicResolution: atomicResolution, + LiquidityTier: liquidityTier, + MarketType: v1.ConvertToPerpetualMarketType(marketType), + DefaultFunding8HrPpm: defaultFundingPpm, } } diff --git a/protocol/indexer/events/perpetual_market_create.go b/protocol/indexer/events/perpetual_market_create.go index 6e0314da4e7..27ee550767e 100644 --- a/protocol/indexer/events/perpetual_market_create.go +++ b/protocol/indexer/events/perpetual_market_create.go @@ -20,6 +20,7 @@ func NewPerpetualMarketCreateEvent( stepBaseQuantums uint64, liquidityTier uint32, marketType perptypes.PerpetualMarketType, + defaultFundingPpm int32, ) *PerpetualMarketCreateEventV2 { return &PerpetualMarketCreateEventV2{ Id: id, @@ -33,5 +34,6 @@ func NewPerpetualMarketCreateEvent( StepBaseQuantums: stepBaseQuantums, LiquidityTier: liquidityTier, MarketType: v1.ConvertToPerpetualMarketType(marketType), + DefaultFunding8HrPpm: defaultFundingPpm, } } diff --git a/protocol/indexer/events/perpetual_market_create_test.go b/protocol/indexer/events/perpetual_market_create_test.go index 7a8e1e15ac9..5b7c215f69f 100644 --- a/protocol/indexer/events/perpetual_market_create_test.go +++ b/protocol/indexer/events/perpetual_market_create_test.go @@ -23,6 +23,7 @@ func TestNewPerpetualMarketCreateEvent_Success(t *testing.T) { 5, 0, perptypes.PerpetualMarketType_PERPETUAL_MARKET_TYPE_CROSS, + 100, ) expectedPerpetualMarketCreateEventProto := &PerpetualMarketCreateEventV2{ Id: 0, @@ -36,6 +37,7 @@ func TestNewPerpetualMarketCreateEvent_Success(t *testing.T) { StepBaseQuantums: 5, LiquidityTier: 0, MarketType: v1types.PerpetualMarketType_PERPETUAL_MARKET_TYPE_CROSS, + DefaultFunding8HrPpm: 100, } require.Equal(t, expectedPerpetualMarketCreateEventProto, perpetualMarketCreateEvent) } diff --git a/protocol/indexer/events/perpetual_test.go b/protocol/indexer/events/perpetual_test.go index 2c9a7cb300c..2c7de5966de 100644 --- a/protocol/indexer/events/perpetual_test.go +++ b/protocol/indexer/events/perpetual_test.go @@ -17,6 +17,7 @@ func TestNewUpdatePerpetualEvent_Success(t *testing.T) { -8, 2, perptypes.PerpetualMarketType_PERPETUAL_MARKET_TYPE_CROSS, + 0, ) expectedUpdatePerpetualEventProto := &UpdatePerpetualEventV2{ Id: 5, diff --git a/protocol/testutil/keeper/clob.go b/protocol/testutil/keeper/clob.go index 661d901d623..78bac5c9943 100644 --- a/protocol/testutil/keeper/clob.go +++ b/protocol/testutil/keeper/clob.go @@ -348,6 +348,7 @@ func CreateNClobPair( items[i].StepBaseQuantums, perps[i].Params.LiquidityTier, perps[i].Params.MarketType, + perps[i].Params.DefaultFundingPpm, ), ), ).Return() diff --git a/protocol/x/clob/abci_test.go b/protocol/x/clob/abci_test.go index 2fdbf5e8e40..0f49eed986e 100644 --- a/protocol/x/clob/abci_test.go +++ b/protocol/x/clob/abci_test.go @@ -527,6 +527,7 @@ func TestEndBlocker_Success(t *testing.T) { constants.ClobPair_Btc.StepBaseQuantums, constants.BtcUsd_20PercentInitial_10PercentMaintenance.Params.LiquidityTier, constants.BtcUsd_20PercentInitial_10PercentMaintenance.Params.MarketType, + constants.BtcUsd_20PercentInitial_10PercentMaintenance.Params.DefaultFundingPpm, ), ), ).Once().Return() @@ -559,7 +560,8 @@ 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, + constants.EthUsd_20PercentInitial_10PercentMaintenance.Params.MarketType, + constants.EthUsd_20PercentInitial_10PercentMaintenance.Params.DefaultFundingPpm, ), ), ).Once().Return() diff --git a/protocol/x/clob/genesis_test.go b/protocol/x/clob/genesis_test.go index 7ba45b34dd2..02d770f5a48 100644 --- a/protocol/x/clob/genesis_test.go +++ b/protocol/x/clob/genesis_test.go @@ -453,6 +453,7 @@ func TestGenesis(t *testing.T) { clobPair.StepBaseQuantums, perpetual.Params.LiquidityTier, perpetual.Params.MarketType, + perpetual.Params.DefaultFundingPpm, ), ), ).Once().Return() diff --git a/protocol/x/clob/keeper/clob_pair.go b/protocol/x/clob/keeper/clob_pair.go index cc1cd449d62..d8209e7483c 100644 --- a/protocol/x/clob/keeper/clob_pair.go +++ b/protocol/x/clob/keeper/clob_pair.go @@ -161,6 +161,7 @@ func (k Keeper) createPerpetualClobPair( clobPair.StepBaseQuantums, perpetual.Params.LiquidityTier, perpetual.Params.MarketType, + perpetual.Params.DefaultFundingPpm, ), ), ) diff --git a/protocol/x/clob/keeper/clob_pair_test.go b/protocol/x/clob/keeper/clob_pair_test.go index cff3f32be57..8f8955f4433 100644 --- a/protocol/x/clob/keeper/clob_pair_test.go +++ b/protocol/x/clob/keeper/clob_pair_test.go @@ -67,6 +67,7 @@ func TestCreatePerpetualClobPairAndMemStructs_MultiplePerpetual(t *testing.T) { clobPair.StepBaseQuantums, constants.Perpetuals_DefaultGenesisState.Perpetuals[i].Params.LiquidityTier, constants.Perpetuals_DefaultGenesisState.Perpetuals[i].Params.MarketType, + constants.Perpetuals_DefaultGenesisState.Perpetuals[i].Params.DefaultFundingPpm, ), ), ).Once().Return() @@ -190,6 +191,7 @@ func TestCreatePerpetualClobPairAndMemStructs_FailsWithDuplicateClobPairId(t *te clobPair.StepBaseQuantums, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.LiquidityTier, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.MarketType, + constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.DefaultFundingPpm, ), ), ).Once().Return() @@ -283,6 +285,7 @@ func TestCreatePerpetualClobPairAndMemStructs(t *testing.T) { tc.clobPair.StepBaseQuantums, perpetual.Params.LiquidityTier, perpetual.Params.MarketType, + perpetual.Params.DefaultFundingPpm, ), ), ).Return() @@ -437,6 +440,7 @@ func TestCreateMultipleClobPairs(t *testing.T) { make.clobPair.StepBaseQuantums, perpetual.Params.LiquidityTier, perpetual.Params.MarketType, + perpetual.Params.DefaultFundingPpm, ), ), ).Return() @@ -631,6 +635,7 @@ func TestUpdateClobPair_FinalSettlement(t *testing.T) { clobPair.StepBaseQuantums, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.LiquidityTier, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.MarketType, + constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.DefaultFundingPpm, ), ), ).Once().Return() @@ -740,6 +745,7 @@ func TestUpdateClobPair(t *testing.T) { clobPair.StepBaseQuantums, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.LiquidityTier, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.MarketType, + constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.DefaultFundingPpm, ), ), ).Once().Return() @@ -798,6 +804,7 @@ func TestUpdateClobPair(t *testing.T) { clobPair.StepBaseQuantums, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.LiquidityTier, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.MarketType, + constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.DefaultFundingPpm, ), ), ).Once().Return() @@ -836,6 +843,7 @@ func TestUpdateClobPair(t *testing.T) { clobPair.StepBaseQuantums, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.LiquidityTier, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.MarketType, + constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.DefaultFundingPpm, ), ), ).Once().Return() diff --git a/protocol/x/clob/keeper/deleveraging_test.go b/protocol/x/clob/keeper/deleveraging_test.go index f36f7300618..4f2e8b50512 100644 --- a/protocol/x/clob/keeper/deleveraging_test.go +++ b/protocol/x/clob/keeper/deleveraging_test.go @@ -285,6 +285,7 @@ func TestCanDeleverageSubaccount(t *testing.T) { clobPair.StepBaseQuantums, perpetuals[i].Params.LiquidityTier, perpetuals[i].Params.MarketType, + perpetuals[i].Params.DefaultFundingPpm, ), ), ).Once().Return() @@ -682,6 +683,7 @@ func TestOffsetSubaccountPerpetualPosition(t *testing.T) { clobPair.StepBaseQuantums, perps[i].Params.LiquidityTier, perps[i].Params.MarketType, + perps[i].Params.DefaultFundingPpm, ), ), ).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 f75e1c8c150..b3653d58f2a 100644 --- a/protocol/x/clob/keeper/get_price_premium_test.go +++ b/protocol/x/clob/keeper/get_price_premium_test.go @@ -185,6 +185,7 @@ func TestGetPricePremiumForPerpetual(t *testing.T) { tc.args.clobPair.StepBaseQuantums, perpetual.Params.LiquidityTier, perpetual.Params.MarketType, + perpetual.Params.DefaultFundingPpm, ), ), ).Return() diff --git a/protocol/x/clob/keeper/liquidations_test.go b/protocol/x/clob/keeper/liquidations_test.go index 2b21a212810..3c44e3d6d7a 100644 --- a/protocol/x/clob/keeper/liquidations_test.go +++ b/protocol/x/clob/keeper/liquidations_test.go @@ -1250,6 +1250,7 @@ func TestPlacePerpetualLiquidation_PreexistingLiquidation(t *testing.T) { constants.ClobPair_Btc.StepBaseQuantums, constants.BtcUsd_100PercentMarginRequirement.Params.LiquidityTier, constants.BtcUsd_100PercentMarginRequirement.Params.MarketType, + constants.BtcUsd_100PercentMarginRequirement.Params.DefaultFundingPpm, ), ), ).Once().Return() @@ -1280,6 +1281,7 @@ func TestPlacePerpetualLiquidation_PreexistingLiquidation(t *testing.T) { constants.ClobPair_Eth.StepBaseQuantums, constants.EthUsd_100PercentMarginRequirement.Params.LiquidityTier, constants.EthUsd_100PercentMarginRequirement.Params.MarketType, + constants.EthUsd_100PercentMarginRequirement.Params.DefaultFundingPpm, ), ), ).Once().Return() @@ -2190,6 +2192,7 @@ func TestPlacePerpetualLiquidation_Deleveraging(t *testing.T) { clobPair.StepBaseQuantums, perpetuals[i].Params.LiquidityTier, perpetuals[i].Params.MarketType, + perpetuals[i].Params.DefaultFundingPpm, ), ), ).Once().Return() @@ -2310,6 +2313,7 @@ func TestPlacePerpetualLiquidation_SendOffchainMessages(t *testing.T) { constants.ClobPair_Btc.StepBaseQuantums, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.LiquidityTier, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.MarketType, + constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.DefaultFundingPpm, ), ), ).Once().Return() @@ -3849,6 +3853,7 @@ func TestGetLiquidationInsuranceFundDelta(t *testing.T) { constants.ClobPair_Btc.StepBaseQuantums, tc.perpetuals[0].Params.LiquidityTier, tc.perpetuals[0].Params.MarketType, + tc.perpetuals[0].Params.DefaultFundingPpm, ), ), ).Once().Return() @@ -4597,6 +4602,7 @@ func TestGetPerpetualPositionToLiquidate(t *testing.T) { clobPair.StepBaseQuantums, tc.perpetuals[perpetualId].Params.LiquidityTier, tc.perpetuals[perpetualId].Params.MarketType, + tc.perpetuals[perpetualId].Params.DefaultFundingPpm, ), ), ).Once().Return() @@ -5178,6 +5184,7 @@ func TestGetMaxAndMinPositionNotionalLiquidatable(t *testing.T) { constants.ClobPair_Btc.StepBaseQuantums, constants.BtcUsd_100PercentMarginRequirement.Params.LiquidityTier, constants.BtcUsd_100PercentMarginRequirement.Params.MarketType, + constants.BtcUsd_100PercentMarginRequirement.Params.DefaultFundingPpm, ), ), ).Once().Return() @@ -5333,6 +5340,7 @@ func TestSortLiquidationOrders(t *testing.T) { constants.ClobPair_Btc.StepBaseQuantums, constants.BtcUsd_100PercentMarginRequirement.Params.LiquidityTier, constants.BtcUsd_100PercentMarginRequirement.Params.MarketType, + constants.BtcUsd_100PercentMarginRequirement.Params.DefaultFundingPpm, ), ), ).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 bbb64676a16..6f924424a10 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 @@ -64,6 +64,7 @@ func TestCreateClobPair(t *testing.T) { testClobPair1.StepBaseQuantums, testPerp1.Params.LiquidityTier, testPerp1.Params.MarketType, + testPerp1.Params.DefaultFundingPpm, ), ), ).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 f7f0785c417..05193ad0083 100644 --- a/protocol/x/clob/keeper/msg_server_place_order_test.go +++ b/protocol/x/clob/keeper/msg_server_place_order_test.go @@ -183,6 +183,7 @@ func TestPlaceOrder_Error(t *testing.T) { clobPair.StepBaseQuantums, perpetual.Params.LiquidityTier, perpetual.Params.MarketType, + perpetual.Params.DefaultFundingPpm, ), ), ).Once().Return() @@ -334,6 +335,7 @@ func TestPlaceOrder_Success(t *testing.T) { clobPair.StepBaseQuantums, perpetual.Params.LiquidityTier, perpetual.Params.MarketType, + perpetual.Params.DefaultFundingPpm, ), ), ).Once().Return() diff --git a/protocol/x/clob/keeper/orders_test.go b/protocol/x/clob/keeper/orders_test.go index 09d20259180..35d0f72591c 100644 --- a/protocol/x/clob/keeper/orders_test.go +++ b/protocol/x/clob/keeper/orders_test.go @@ -979,6 +979,7 @@ func TestPlaceOrder_SendOffchainMessages(t *testing.T) { constants.ClobPair_Btc.StepBaseQuantums, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.LiquidityTier, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.MarketType, + constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.DefaultFundingPpm, ), ), ).Once().Return() @@ -1036,6 +1037,7 @@ func TestPerformStatefulOrderValidation_PreExistingStatefulOrder(t *testing.T) { constants.ClobPair_Btc.StepBaseQuantums, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.LiquidityTier, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.MarketType, + constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.DefaultFundingPpm, ), ), ).Once().Return() @@ -1793,6 +1795,7 @@ func TestGetStatePosition_Success(t *testing.T) { cp.StepBaseQuantums, constants.Perpetuals_DefaultGenesisState.Perpetuals[i].Params.LiquidityTier, constants.Perpetuals_DefaultGenesisState.Perpetuals[i].Params.MarketType, + constants.Perpetuals_DefaultGenesisState.Perpetuals[i].Params.DefaultFundingPpm, ), ), ).Once().Return() @@ -2011,6 +2014,7 @@ func TestInitStatefulOrders(t *testing.T) { constants.ClobPair_Btc.StepBaseQuantums, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.LiquidityTier, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.MarketType, + constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.DefaultFundingPpm, ), ), ).Once().Return() diff --git a/protocol/x/clob/keeper/process_operations_test.go b/protocol/x/clob/keeper/process_operations_test.go index 7ea9f4cca4a..8664f008004 100644 --- a/protocol/x/clob/keeper/process_operations_test.go +++ b/protocol/x/clob/keeper/process_operations_test.go @@ -2456,6 +2456,7 @@ func setupProcessProposerOperationsTestCase( clobPair.StepBaseQuantums, tc.perpetuals[perpetualId].Params.LiquidityTier, tc.perpetuals[perpetualId].Params.MarketType, + tc.perpetuals[perpetualId].Params.DefaultFundingPpm, ), ), ).Once().Return() diff --git a/protocol/x/clob/module_test.go b/protocol/x/clob/module_test.go index ce1793e1cbc..5373670a481 100644 --- a/protocol/x/clob/module_test.go +++ b/protocol/x/clob/module_test.go @@ -310,6 +310,7 @@ func TestAppModule_InitExportGenesis(t *testing.T) { uint64(5), constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.LiquidityTier, constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.MarketType, + constants.Perpetuals_DefaultGenesisState.Perpetuals[0].Params.DefaultFundingPpm, ), ), ).Once().Return() diff --git a/protocol/x/listing/keeper/listing.go b/protocol/x/listing/keeper/listing.go index 7518ea346f8..68ca344e7f6 100644 --- a/protocol/x/listing/keeper/listing.go +++ b/protocol/x/listing/keeper/listing.go @@ -203,6 +203,7 @@ func (k Keeper) UpgradeIsolatedPerpetualToCross( perpetual.Params.AtomicResolution, perpetual.Params.LiquidityTier, perpetual.Params.MarketType, + perpetual.Params.DefaultFundingPpm, ), ), ) diff --git a/protocol/x/perpetuals/keeper/perpetual.go b/protocol/x/perpetuals/keeper/perpetual.go index 5f3cf9716a1..a434a3bf5f2 100644 --- a/protocol/x/perpetuals/keeper/perpetual.go +++ b/protocol/x/perpetuals/keeper/perpetual.go @@ -173,6 +173,7 @@ func (k Keeper) ModifyPerpetual( perpetual.Params.AtomicResolution, perpetual.Params.LiquidityTier, perpetual.Params.MarketType, + perpetual.Params.DefaultFundingPpm, ), ), ) diff --git a/protocol/x/perpetuals/keeper/perpetual_test.go b/protocol/x/perpetuals/keeper/perpetual_test.go index a0e99f2c8df..851e5e0cbdb 100644 --- a/protocol/x/perpetuals/keeper/perpetual_test.go +++ b/protocol/x/perpetuals/keeper/perpetual_test.go @@ -62,12 +62,13 @@ func TestModifyPerpetual_Success(t *testing.T) { // Record the indexer event expected to emit from above `ModifyPerpetual`. expectedIndexerEvents[i] = &indexerevents.UpdatePerpetualEventV2{ - Id: item.Params.Id, - Ticker: ticker, - MarketId: marketId, - AtomicResolution: item.Params.AtomicResolution, - LiquidityTier: liquidityTier, - MarketType: v1.ConvertToPerpetualMarketType(item.Params.MarketType), + Id: item.Params.Id, + Ticker: ticker, + MarketId: marketId, + AtomicResolution: item.Params.AtomicResolution, + LiquidityTier: liquidityTier, + MarketType: v1.ConvertToPerpetualMarketType(item.Params.MarketType), + DefaultFunding8HrPpm: defaultFundingPpm, } // Verify updatedp perpetual in store. diff --git a/protocol/x/perpetuals/types/perpetual.pb.go b/protocol/x/perpetuals/types/perpetual.pb.go index 23257127447..4ccfeccb248 100644 --- a/protocol/x/perpetuals/types/perpetual.pb.go +++ b/protocol/x/perpetuals/types/perpetual.pb.go @@ -122,7 +122,7 @@ type PerpetualParams struct { // then a `PerpetualPosition` with `size = 1e8` is equivalent to // a position size of one full coin. AtomicResolution int32 `protobuf:"zigzag32,4,opt,name=atomic_resolution,json=atomicResolution,proto3" json:"atomic_resolution,omitempty"` - // The default funding payment if there is no price premium. In + // The default (8hr) funding payment if there is no price premium. In // parts-per-million. DefaultFundingPpm int32 `protobuf:"zigzag32,5,opt,name=default_funding_ppm,json=defaultFundingPpm,proto3" json:"default_funding_ppm,omitempty"` // The liquidity_tier that this perpetual is associated with.