diff --git a/indexer/packages/postgres/__tests__/helpers/constants.ts b/indexer/packages/postgres/__tests__/helpers/constants.ts index b9c5361743..8dad14e10c 100644 --- a/indexer/packages/postgres/__tests__/helpers/constants.ts +++ b/indexer/packages/postgres/__tests__/helpers/constants.ts @@ -355,7 +355,7 @@ export const defaultFill: FillCreateObject = { subaccountId: defaultSubaccountId, side: OrderSide.BUY, liquidity: Liquidity.TAKER, - type: FillType.MARKET, + type: FillType.LIMIT, clobPairId: '1', orderId: defaultOrderId, size: '10', diff --git a/indexer/packages/postgres/src/db/migrations/migration_files/20231110103241_remove_market_fills_type.ts b/indexer/packages/postgres/src/db/migrations/migration_files/20231110103241_remove_market_fills_type.ts new file mode 100644 index 0000000000..8275ba90a9 --- /dev/null +++ b/indexer/packages/postgres/src/db/migrations/migration_files/20231110103241_remove_market_fills_type.ts @@ -0,0 +1,19 @@ +import * as Knex from 'knex'; + +import { formatAlterTableEnumSql } from '../helpers'; + +export async function up(knex: Knex): Promise { + return knex.raw(formatAlterTableEnumSql( + 'fills', + 'type', + ['LIMIT', 'LIQUIDATED', 'LIQUIDATION', 'DELEVERAGED', 'OFFSETTING'], + )); +} + +export async function down(knex: Knex): Promise { + return knex.raw(formatAlterTableEnumSql( + 'fills', + 'type', + ['MARKET', 'LIMIT', 'LIQUIDATED', 'LIQUIDATION', 'DELEVERAGED', 'OFFSETTING'], + )); +} diff --git a/indexer/packages/postgres/src/types/fill-types.ts b/indexer/packages/postgres/src/types/fill-types.ts index a46aa2781d..9055c8e09d 100644 --- a/indexer/packages/postgres/src/types/fill-types.ts +++ b/indexer/packages/postgres/src/types/fill-types.ts @@ -14,8 +14,6 @@ export enum Liquidity { } export enum FillType { - // MARKET is the fill type for a fill with a market taker order. - MARKET = 'MARKET', // LIMIT is the fill type for a fill with a limit taker order. LIMIT = 'LIMIT', // LIQUIDATED is for the taker side of the fill where the subaccount was liquidated. diff --git a/indexer/services/comlink/public/api-documentation.md b/indexer/services/comlink/public/api-documentation.md index 59a4c0395e..459cff2273 100644 --- a/indexer/services/comlink/public/api-documentation.md +++ b/indexer/services/comlink/public/api-documentation.md @@ -618,7 +618,7 @@ fetch('https://indexer.v4testnet.dydx.exchange/v4/fills?address=string&subaccoun "id": "string", "side": "BUY", "liquidity": "TAKER", - "type": "MARKET", + "type": "LIMIT", "market": "string", "marketType": "PERPETUAL", "price": "string", @@ -1639,7 +1639,7 @@ fetch('https://indexer.v4testnet.dydx.exchange/v4/trades/perpetualMarket/{ticker "side": "BUY", "size": "string", "price": "string", - "type": "MARKET", + "type": "LIMIT", "createdAt": "string", "createdAtHeight": "string" } @@ -2270,7 +2270,7 @@ This operation does not require authentication ```json -"MARKET" +"LIMIT" ``` @@ -2284,7 +2284,6 @@ This operation does not require authentication |Property|Value| |---|---| -|*anonymous*|MARKET| |*anonymous*|LIMIT| |*anonymous*|LIQUIDATED| |*anonymous*|LIQUIDATION| @@ -2328,7 +2327,7 @@ This operation does not require authentication "id": "string", "side": "BUY", "liquidity": "TAKER", - "type": "MARKET", + "type": "LIMIT", "market": "string", "marketType": "PERPETUAL", "price": "string", @@ -2374,7 +2373,7 @@ This operation does not require authentication "id": "string", "side": "BUY", "liquidity": "TAKER", - "type": "MARKET", + "type": "LIMIT", "market": "string", "marketType": "PERPETUAL", "price": "string", @@ -3063,7 +3062,7 @@ or "side": "BUY", "size": "string", "price": "string", - "type": "MARKET", + "type": "LIMIT", "createdAt": "string", "createdAtHeight": "string" } @@ -3097,7 +3096,7 @@ or "side": "BUY", "size": "string", "price": "string", - "type": "MARKET", + "type": "LIMIT", "createdAt": "string", "createdAtHeight": "string" } diff --git a/indexer/services/comlink/public/swagger.json b/indexer/services/comlink/public/swagger.json index ac9488555e..6e74f995c9 100644 --- a/indexer/services/comlink/public/swagger.json +++ b/indexer/services/comlink/public/swagger.json @@ -301,7 +301,6 @@ }, "FillType": { "enum": [ - "MARKET", "LIMIT", "LIQUIDATED", "LIQUIDATION", diff --git a/indexer/services/comlink/public/websocket-documentation.md b/indexer/services/comlink/public/websocket-documentation.md index bde62d3c89..b0b5f634b6 100644 --- a/indexer/services/comlink/public/websocket-documentation.md +++ b/indexer/services/comlink/public/websocket-documentation.md @@ -251,8 +251,6 @@ export enum Liquidity { } export enum FillType { - // MARKET is the fill type for a fill with a market taker order. - MARKET = 'MARKET', // LIMIT is the fill type for a fill with a limit taker order. LIMIT = 'LIMIT', // LIQUIDATED is for the taker side of the fill where the subaccount was liquidated. @@ -752,7 +750,7 @@ interface TradeContent { "price": "27837", "side": "SELL", "createdAt": "2023-04-04T00:29:19.353Z", - "type": "MARKET" + "type": "LIMIT" }, { "id": "dd1088b5-5cab-518f-a59c-4d5f735ab861", diff --git a/indexer/services/ender/__tests__/helpers/constants.ts b/indexer/services/ender/__tests__/helpers/constants.ts index 9f69cdd730..4e8dfbeba5 100644 --- a/indexer/services/ender/__tests__/helpers/constants.ts +++ b/indexer/services/ender/__tests__/helpers/constants.ts @@ -325,7 +325,7 @@ export const defaultTradeContent: TradeContent = { price: '10000', side: 'BUY', createdAt: 'createdAt', - type: FillType.MARKET, + type: FillType.LIMIT, }; export const defaultTradeMessage: SingleTradeMessage = contentToSingleTradeMessage( defaultTradeContent, diff --git a/indexer/services/ender/__tests__/lib/kafka-publisher.test.ts b/indexer/services/ender/__tests__/lib/kafka-publisher.test.ts index 6e915a86b0..184ddfd104 100644 --- a/indexer/services/ender/__tests__/lib/kafka-publisher.test.ts +++ b/indexer/services/ender/__tests__/lib/kafka-publisher.test.ts @@ -241,7 +241,7 @@ describe('kafka-publisher', () => { subaccountId: testConstants.defaultSubaccountId, side: OrderSide.BUY, liquidity: Liquidity.TAKER, - type: FillType.MARKET, + type: FillType.LIMIT, clobPairId: '1', orderId: testConstants.defaultOrderId, size: '10',