Skip to content

Commit

Permalink
copy over scaled orders (#130)
Browse files Browse the repository at this point in the history
* copy code over

* add order type descriptions
  • Loading branch information
lowkeynicc authored Nov 21, 2024
1 parent c251089 commit b92a8c6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
21 changes: 21 additions & 0 deletions common-ts/src/constants/orders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,43 @@ export const UI_ORDER_TYPES: UIOrderTypeLookup = {
label: 'Market',
value: 'market',
orderType: OrderType.MARKET,
description:
'A Market Order is an order to buy or sell an asset immediately at the current Market Price. Users can set a maximum slippage tolerance.',
},
limit: {
label: 'Limit',
value: 'limit',
orderType: OrderType.LIMIT,
description:
'A Limit Order is an order to buy or sell a given asset at a specified price. Limit Orders are triggered once Oracle Price reaches the specified price.',
},
stopMarket: {
label: 'Stop Market',
value: 'stopMarket',
orderType: OrderType.TRIGGER_MARKET,
description:
'A Stop Market Order is an order to close the position of a given asset if its Oracle Price reaches the specified Trigger Price. If this happens, the position is closed at Market Price.',
},
stopLimit: {
label: 'Stop Limit',
value: 'stopLimit',
orderType: OrderType.TRIGGER_LIMIT,
description:
'A Stop Limit Order will only execute where the Oracle Price of a given asset reaches the Trigger Price. If this happens, a Limit Order at the specified Limit Price will be placed.',
},
takeProfitMarket: {
label: 'Take Profit',
value: 'takeProfitMarket',
orderType: OrderType.TRIGGER_MARKET,
description:
'A Take Profit Order is an order to close the position of a given asset if its Oracle Price reaches the specified Trigger Price. If this happens, the position is closed at Market Price.',
},
takeProfitLimit: {
label: 'Take Profit Limit',
value: 'takeProfitLimit',
orderType: OrderType.TRIGGER_LIMIT,
description:
'A Take Profit Limit Order will only execute where the Oracle Price of a given asset reaches the Trigger Price. If this happens, a Limit Order at the specified Limit Price will be placed.',
},
oracle: {
label: 'Oracle Market',
Expand All @@ -41,6 +53,15 @@ export const UI_ORDER_TYPES: UIOrderTypeLookup = {
label: 'Oracle Limit',
value: 'oracleLimit',
orderType: OrderType.LIMIT,
description:
'An Oracle Limit Order allows you to specify an offset rather than limit price to execute your order. The offset represents the price above/below the current Oracle Price you want to be filled at. Learn more.',
},
scaledOrders: {
label: 'Scaled Orders',
value: 'scaledOrders',
orderType: OrderType.LIMIT,
description:
'A scaled order automatically generates multiple limit orders within a specified price range. It splits the order amount into several suborders and places them separately without significantly impacting the market.',
},
};

Expand Down
4 changes: 3 additions & 1 deletion common-ts/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,14 @@ export type UIOrderType =
| 'takeProfitMarket'
| 'takeProfitLimit'
| 'oracle'
| 'oracleLimit';
| 'oracleLimit'
| 'scaledOrders';

export type UIOrderTypeValue = {
label: string;
value: UIOrderType;
orderType: OrderType;
description?: string;
};

export type UIOrderTypeLookup = {
Expand Down

0 comments on commit b92a8c6

Please sign in to comment.