fix(trading): order iceberg fills (#4502)
This commit is contained in:
parent
cdd91c24f2
commit
4990c5808d
@ -114,9 +114,11 @@ describe('OrderListTable', () => {
|
||||
it('should apply correct formatting applied for an iceberg order', async () => {
|
||||
const icebergOrder = {
|
||||
...limitOrder,
|
||||
size: '100',
|
||||
remaining: '50',
|
||||
icebergOrder: {
|
||||
__typename: 'IcebergOrder',
|
||||
minimumVisibleSize: '100',
|
||||
minimumVisibleSize: '1',
|
||||
peakSize: '50',
|
||||
reservedRemaining: '50',
|
||||
} as OrderFieldsFragment['icebergOrder'],
|
||||
@ -127,8 +129,8 @@ describe('OrderListTable', () => {
|
||||
const cells = screen.getAllByRole('gridcell');
|
||||
const expectedValues: string[] = [
|
||||
icebergOrder.market?.tradableInstrument.instrument.code || '',
|
||||
'0.05',
|
||||
'0.10',
|
||||
'0.00',
|
||||
'+1.00',
|
||||
Schema.OrderTypeMapping[
|
||||
icebergOrder.type || Schema.OrderType.TYPE_LIMIT
|
||||
] + ' (Iceberg)',
|
||||
|
@ -86,21 +86,13 @@ export const OrderListTable = memo<
|
||||
valueGetter: ({ data }: VegaValueGetterParams<Order>) => {
|
||||
if (data?.icebergOrder) {
|
||||
return data?.size && data.market
|
||||
? toBigNum(
|
||||
(
|
||||
BigInt(data.size) -
|
||||
BigInt(data.remaining) -
|
||||
BigInt(data.icebergOrder.reservedRemaining)
|
||||
).toString(),
|
||||
data.market.positionDecimalPlaces ?? 0
|
||||
).toNumber()
|
||||
? BigInt(data.size) -
|
||||
BigInt(data.remaining) -
|
||||
BigInt(data.icebergOrder.reservedRemaining)
|
||||
: undefined;
|
||||
}
|
||||
return data?.size && data.market
|
||||
? toBigNum(
|
||||
(BigInt(data.size) - BigInt(data.remaining)).toString(),
|
||||
data.market.positionDecimalPlaces ?? 0
|
||||
).toNumber()
|
||||
? BigInt(data.size) - BigInt(data.remaining)
|
||||
: undefined;
|
||||
},
|
||||
valueFormatter: ({
|
||||
@ -114,8 +106,8 @@ export const OrderListTable = memo<
|
||||
return '-';
|
||||
}
|
||||
return addDecimalsFormatNumber(
|
||||
(BigInt(data.size) - BigInt(data.remaining)).toString(),
|
||||
data.market.positionDecimalPlaces
|
||||
value,
|
||||
data.market.positionDecimalPlaces ?? 0
|
||||
);
|
||||
},
|
||||
minWidth: 50,
|
||||
|
Loading…
Reference in New Issue
Block a user