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

remove unused order types from documentation #1559

Merged
merged 1 commit into from
May 21, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,6 @@ describe('protocolTranslations', () => {
describe('orderTypeToProtocolConditionType', () => {
it.each([
['LIMIT', OrderType.LIMIT, IndexerOrder_ConditionType.CONDITION_TYPE_UNSPECIFIED],
['HARD_TRADE', OrderType.HARD_TRADE, IndexerOrder_ConditionType.CONDITION_TYPE_UNSPECIFIED],
[
'FAILED_HARD_TRADE',
OrderType.FAILED_HARD_TRADE,
IndexerOrder_ConditionType.CONDITION_TYPE_UNSPECIFIED,
],
['MARKET', OrderType.MARKET, IndexerOrder_ConditionType.CONDITION_TYPE_UNSPECIFIED],
[
'TRAILING_STOP',
Expand Down
3 changes: 0 additions & 3 deletions indexer/packages/postgres/src/lib/protocol-translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ const ORDER_TYPE_TO_CONDITION_TYPE_MAP: Record<OrderType, IndexerOrder_Condition

// TODO(IND-356): Remove irrelevant order types
// Unused order types
[OrderType.HARD_TRADE]: IndexerOrder_ConditionType.CONDITION_TYPE_UNSPECIFIED,
[OrderType.FAILED_HARD_TRADE]: IndexerOrder_ConditionType.CONDITION_TYPE_UNSPECIFIED,
[OrderType.MARKET]: IndexerOrder_ConditionType.CONDITION_TYPE_UNSPECIFIED,
[OrderType.TRANSFER_PLACEHOLDER]: IndexerOrder_ConditionType.CONDITION_TYPE_UNSPECIFIED,
[OrderType.TRAILING_STOP]: IndexerOrder_ConditionType.CONDITION_TYPE_UNSPECIFIED,
};

Expand Down
3 changes: 0 additions & 3 deletions indexer/packages/postgres/src/types/order-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ export enum OrderType {
TRAILING_STOP = 'TRAILING_STOP',
TAKE_PROFIT = 'TAKE_PROFIT',
TAKE_PROFIT_MARKET = 'TAKE_PROFIT_MARKET',
HARD_TRADE = 'HARD_TRADE',
FAILED_HARD_TRADE = 'FAILED_HARD_TRADE',
TRANSFER_PLACEHOLDER = 'TRANSFER_PLACEHOLDER',
}

export enum TimeInForce {
Expand Down
15 changes: 0 additions & 15 deletions indexer/services/comlink/public/api-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -1553,9 +1553,6 @@ fetch('https://dydx-testnet.imperator.co/v4/orders?address=string&subaccountNumb
|type|TRAILING_STOP|
|type|TAKE_PROFIT|
|type|TAKE_PROFIT_MARKET|
|type|HARD_TRADE|
|type|FAILED_HARD_TRADE|
|type|TRANSFER_PLACEHOLDER|

> Example responses

Expand Down Expand Up @@ -1658,9 +1655,6 @@ Status Code **200**
|type|TRAILING_STOP|
|type|TAKE_PROFIT|
|type|TAKE_PROFIT_MARKET|
|type|HARD_TRADE|
|type|FAILED_HARD_TRADE|
|type|TRANSFER_PLACEHOLDER|
|timeInForce|GTT|
|timeInForce|FOK|
|timeInForce|IOC|
Expand Down Expand Up @@ -1745,9 +1739,6 @@ fetch('https://dydx-testnet.imperator.co/v4/orders/parentSubaccountNumber?addres
|type|TRAILING_STOP|
|type|TAKE_PROFIT|
|type|TAKE_PROFIT_MARKET|
|type|HARD_TRADE|
|type|FAILED_HARD_TRADE|
|type|TRANSFER_PLACEHOLDER|

> Example responses

Expand Down Expand Up @@ -1850,9 +1841,6 @@ Status Code **200**
|type|TRAILING_STOP|
|type|TAKE_PROFIT|
|type|TAKE_PROFIT_MARKET|
|type|HARD_TRADE|
|type|FAILED_HARD_TRADE|
|type|TRANSFER_PLACEHOLDER|
|timeInForce|GTT|
|timeInForce|FOK|
|timeInForce|IOC|
Expand Down Expand Up @@ -4080,9 +4068,6 @@ or
|*anonymous*|TRAILING_STOP|
|*anonymous*|TAKE_PROFIT|
|*anonymous*|TAKE_PROFIT_MARKET|
|*anonymous*|HARD_TRADE|
|*anonymous*|FAILED_HARD_TRADE|
|*anonymous*|TRANSFER_PLACEHOLDER|

## OrderResponseObject

Expand Down
5 changes: 1 addition & 4 deletions indexer/services/comlink/public/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -803,10 +803,7 @@
"STOP_MARKET",
"TRAILING_STOP",
"TAKE_PROFIT",
"TAKE_PROFIT_MARKET",
"HARD_TRADE",
"FAILED_HARD_TRADE",
"TRANSFER_PLACEHOLDER"
"TAKE_PROFIT_MARKET"
],
"type": "string"
},
Expand Down
25 changes: 11 additions & 14 deletions indexer/services/comlink/public/websocket-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ wscli connect wss://indexer.v4testnet.dydx.exchange/v4/ws

## Subaccounts

This channel provides realtime information about orders, fills, transfers, perpetual positions, and perpetual assets for a subaccount.
This channel provides realtime information about orders, fills, transfers, perpetual positions, and perpetual assets for a subaccount.

### Subscribe

Expand Down Expand Up @@ -198,9 +198,6 @@ export enum OrderType {
TRAILING_STOP = 'TRAILING_STOP',
TAKE_PROFIT = 'TAKE_PROFIT',
TAKE_PROFIT_MARKET = 'TAKE_PROFIT_MARKET',
HARD_TRADE = 'HARD_TRADE',
FAILED_HARD_TRADE = 'FAILED_HARD_TRADE',
TRANSFER_PLACEHOLDER = 'TRANSFER_PLACEHOLDER',
}

export enum APITimeInForce {
Expand Down Expand Up @@ -302,7 +299,7 @@ export enum TransferType {
```

### Example

```tsx
{
"type": "channel_data",
Expand Down Expand Up @@ -385,7 +382,7 @@ export enum TransferType {
Returns everything from `v4/orderbooks/perpetualMarkets/${id}` endpoint.

- Example

```tsx
{
"type": "subscribed",
Expand Down Expand Up @@ -469,7 +466,7 @@ Returns everything from `v4/orderbooks/perpetualMarkets/${id}` endpoint.
},
}
```


### Channel Data

Expand All @@ -492,7 +489,7 @@ type PriceLevel = [string, string];
```

- Example

```tsx
{
"type": "channel_data",
Expand All @@ -511,7 +508,7 @@ type PriceLevel = [string, string];
}
}
```


## Trades

Expand All @@ -528,7 +525,7 @@ type PriceLevel = [string, string];
Returns everything from `v4/trades/perpetualMarkets/${id}` endpoint.

- Example

```tsx
{
"type": "subscribed",
Expand Down Expand Up @@ -696,7 +693,7 @@ Returns everything from `v4/trades/perpetualMarkets/${id}` endpoint.
},
}
```


### Channel Data

Expand Down Expand Up @@ -726,7 +723,7 @@ interface TradeContent {
```

### Example

```tsx
{
"type": "channel_data",
Expand Down Expand Up @@ -789,7 +786,7 @@ interface TradeContent {
Returns everything from `v4/perpetualMarkets` endpoint.

### Example

```tsx
{
"type": "subscribed",
Expand Down Expand Up @@ -908,7 +905,7 @@ interface OraclePriceMarket {
```

### Example

```tsx
{
"type": "channel_data",
Expand Down
Loading