Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IND-487] remove market enum from FillsType #788

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion indexer/packages/postgres/__tests__/helpers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as Knex from 'knex';

import { formatAlterTableEnumSql } from '../helpers';

export async function up(knex: Knex): Promise<void> {
return knex.raw(formatAlterTableEnumSql(
'fills',
'type',
['LIMIT', 'LIQUIDATED', 'LIQUIDATION', 'DELEVERAGED', 'OFFSETTING'],
));
}

export async function down(knex: Knex): Promise<void> {
return knex.raw(formatAlterTableEnumSql(
'fills',
'type',
['MARKET', 'LIMIT', 'LIQUIDATED', 'LIQUIDATION', 'DELEVERAGED', 'OFFSETTING'],
));
}
2 changes: 0 additions & 2 deletions indexer/packages/postgres/src/types/fill-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
15 changes: 7 additions & 8 deletions indexer/services/comlink/public/api-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
Expand Down Expand Up @@ -2270,7 +2270,7 @@ This operation does not require authentication
<a id="tocsfilltype"></a>

```json
"MARKET"
"LIMIT"

```

Expand All @@ -2284,7 +2284,6 @@ This operation does not require authentication

|Property|Value|
|---|---|
|*anonymous*|MARKET|
|*anonymous*|LIMIT|
|*anonymous*|LIQUIDATED|
|*anonymous*|LIQUIDATION|
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -3063,7 +3062,7 @@ or
"side": "BUY",
"size": "string",
"price": "string",
"type": "MARKET",
"type": "LIMIT",
"createdAt": "string",
"createdAtHeight": "string"
}
Expand Down Expand Up @@ -3097,7 +3096,7 @@ or
"side": "BUY",
"size": "string",
"price": "string",
"type": "MARKET",
"type": "LIMIT",
"createdAt": "string",
"createdAtHeight": "string"
}
Expand Down
1 change: 0 additions & 1 deletion indexer/services/comlink/public/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@
},
"FillType": {
"enum": [
"MARKET",
"LIMIT",
"LIQUIDATED",
"LIQUIDATION",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion indexer/services/ender/__tests__/helpers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down