From 8db286fa93d014c4ff7a77986bb13084a21fd493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20G=C5=82ownia?= Date: Fri, 9 Feb 2024 15:02:09 +0100 Subject: [PATCH] feat(deal-ticket): rename EstimatePosition argument --- .../src/components/deal-ticket/deal-ticket.tsx | 2 +- .../src/components/deal-ticket/margin-mode-selector.tsx | 2 +- libs/positions/src/lib/Positions.graphql | 4 ++-- libs/positions/src/lib/__generated__/Positions.ts | 8 ++++---- libs/types/src/__generated__/types.ts | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libs/deal-ticket/src/components/deal-ticket/deal-ticket.tsx b/libs/deal-ticket/src/components/deal-ticket/deal-ticket.tsx index b94ff8cf7..04a9cce76 100644 --- a/libs/deal-ticket/src/components/deal-ticket/deal-ticket.tsx +++ b/libs/deal-ticket/src/components/deal-ticket/deal-ticket.tsx @@ -281,7 +281,7 @@ export const DealTicket = ({ marginFactor: margin?.marginFactor || '1', marginMode: margin?.marginMode || Schema.MarginMode.MARGIN_MODE_CROSS_MARGIN, - includeCollateralIncreaseInAvailableCollateral: true, + includeRequiredPositionMarginInAvailableCollateral: true, }, !normalizedOrder || (normalizedOrder.type !== Schema.OrderType.TYPE_MARKET && diff --git a/libs/deal-ticket/src/components/deal-ticket/margin-mode-selector.tsx b/libs/deal-ticket/src/components/deal-ticket/margin-mode-selector.tsx index 1f5fc1bda..a0113d637 100644 --- a/libs/deal-ticket/src/components/deal-ticket/margin-mode-selector.tsx +++ b/libs/deal-ticket/src/components/deal-ticket/margin-mode-selector.tsx @@ -89,7 +89,7 @@ export const MarginChange = ({ openVolume, marketId, orderMarginAccountBalance: orderMarginAccountBalance || '0', - includeCollateralIncreaseInAvailableCollateral: true, + includeRequiredPositionMarginInAvailableCollateral: true, orders, }, skip diff --git a/libs/positions/src/lib/Positions.graphql b/libs/positions/src/lib/Positions.graphql index e90d486a9..4af025ca4 100644 --- a/libs/positions/src/lib/Positions.graphql +++ b/libs/positions/src/lib/Positions.graphql @@ -48,7 +48,7 @@ query EstimatePosition( $orderMarginAccountBalance: String! $marginMode: MarginMode! $marginFactor: String - $includeCollateralIncreaseInAvailableCollateral: Boolean + $includeRequiredPositionMarginInAvailableCollateral: Boolean ) { estimatePosition( marketId: $marketId @@ -60,7 +60,7 @@ query EstimatePosition( orderMarginAccountBalance: $orderMarginAccountBalance marginMode: $marginMode marginFactor: $marginFactor - includeCollateralIncreaseInAvailableCollateral: $includeCollateralIncreaseInAvailableCollateral + includeRequiredPositionMarginInAvailableCollateral: $includeRequiredPositionMarginInAvailableCollateral # Everywhere in the codebase we expect price values of the underlying to have the right # number of digits for formatting with market.decimalPlaces. By default the estimatePosition # query will return a full value requiring formatting using asset.decimals. For consistency diff --git a/libs/positions/src/lib/__generated__/Positions.ts b/libs/positions/src/lib/__generated__/Positions.ts index 4c08dabcb..60d7b2529 100644 --- a/libs/positions/src/lib/__generated__/Positions.ts +++ b/libs/positions/src/lib/__generated__/Positions.ts @@ -29,7 +29,7 @@ export type EstimatePositionQueryVariables = Types.Exact<{ orderMarginAccountBalance: Types.Scalars['String']; marginMode: Types.MarginMode; marginFactor?: Types.InputMaybe; - includeCollateralIncreaseInAvailableCollateral?: Types.InputMaybe; + includeRequiredPositionMarginInAvailableCollateral?: Types.InputMaybe; }>; @@ -130,7 +130,7 @@ export function usePositionsSubscriptionSubscription(baseOptions: Apollo.Subscri export type PositionsSubscriptionSubscriptionHookResult = ReturnType; export type PositionsSubscriptionSubscriptionResult = Apollo.SubscriptionResult; export const EstimatePositionDocument = gql` - query EstimatePosition($marketId: ID!, $openVolume: String!, $averageEntryPrice: String!, $orders: [OrderInfo!], $marginAccountBalance: String!, $generalAccountBalance: String!, $orderMarginAccountBalance: String!, $marginMode: MarginMode!, $marginFactor: String, $includeCollateralIncreaseInAvailableCollateral: Boolean) { + query EstimatePosition($marketId: ID!, $openVolume: String!, $averageEntryPrice: String!, $orders: [OrderInfo!], $marginAccountBalance: String!, $generalAccountBalance: String!, $orderMarginAccountBalance: String!, $marginMode: MarginMode!, $marginFactor: String, $includeRequiredPositionMarginInAvailableCollateral: Boolean) { estimatePosition( marketId: $marketId openVolume: $openVolume @@ -141,7 +141,7 @@ export const EstimatePositionDocument = gql` orderMarginAccountBalance: $orderMarginAccountBalance marginMode: $marginMode marginFactor: $marginFactor - includeCollateralIncreaseInAvailableCollateral: $includeCollateralIncreaseInAvailableCollateral + includeRequiredPositionMarginInAvailableCollateral: $includeRequiredPositionMarginInAvailableCollateral scaleLiquidationPriceToMarketDecimals: true ) { collateralIncreaseEstimate { @@ -185,7 +185,7 @@ export const EstimatePositionDocument = gql` * orderMarginAccountBalance: // value for 'orderMarginAccountBalance' * marginMode: // value for 'marginMode' * marginFactor: // value for 'marginFactor' - * includeCollateralIncreaseInAvailableCollateral: // value for 'includeCollateralIncreaseInAvailableCollateral' + * includeRequiredPositionMarginInAvailableCollateral: // value for 'includeRequiredPositionMarginInAvailableCollateral' * }, * }); */ diff --git a/libs/types/src/__generated__/types.ts b/libs/types/src/__generated__/types.ts index 5b147778c..5918756b8 100644 --- a/libs/types/src/__generated__/types.ts +++ b/libs/types/src/__generated__/types.ts @@ -5015,7 +5015,7 @@ export type QueryestimateOrderArgs = { export type QueryestimatePositionArgs = { averageEntryPrice: Scalars['String']; generalAccountBalance: Scalars['String']; - includeCollateralIncreaseInAvailableCollateral?: InputMaybe; + includeRequiredPositionMarginInAvailableCollateral?: InputMaybe; marginAccountBalance: Scalars['String']; marginFactor?: InputMaybe; marginMode: MarginMode;