chore(wallet,positions): use reduceOnly and IOC order for close position tx (#3263)

This commit is contained in:
Maciek 2023-03-29 08:50:11 +02:00 committed by GitHub
parent b1b0039b33
commit fcda4d7fcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -45,11 +45,12 @@ export const PositionsManager = ({
{ {
marketId: marketId, marketId: marketId,
type: Schema.OrderType.TYPE_MARKET as const, type: Schema.OrderType.TYPE_MARKET as const,
timeInForce: Schema.OrderTimeInForce.TIME_IN_FORCE_FOK as const, timeInForce: Schema.OrderTimeInForce.TIME_IN_FORCE_IOC as const,
side: openVolume.startsWith('-') side: openVolume.startsWith('-')
? Schema.Side.SIDE_BUY ? Schema.Side.SIDE_BUY
: Schema.Side.SIDE_SELL, : Schema.Side.SIDE_SELL,
size: openVolume.replace('-', ''), size: openVolume.replace('-', ''),
reduceOnly: true,
}, },
], ],
}, },

View File

@ -45,6 +45,7 @@ export interface OrderSubmission {
size: string; size: string;
price?: string; price?: string;
expiresAt?: string; expiresAt?: string;
reduceOnly?: boolean;
} }
export interface OrderCancellation { export interface OrderCancellation {