trades publisher fix

This commit is contained in:
Nour Alharithi
2023-11-28 10:41:49 -08:00
parent bdea4a1bb8
commit b29a29998c

View File

@@ -18,6 +18,7 @@ import {
PRICE_PRECISION,
getVariant,
ZERO,
BN,
} from '@drift-labs/sdk';
import { logger, setLogLevel } from '../utils/logger';
@@ -146,7 +147,9 @@ const main = async () => {
),
taker: fill.taker?.toBase58(),
takerOrderId: fill.takerOrderId,
takerOrderDirection: getVariant(fill.takerOrderDirection),
takerOrderDirection: fill.takerOrderDirection
? getVariant(fill.takerOrderDirection)
: undefined,
takerOrderBaseAssetAmount: convertToNumber(
fill.takerOrderBaseAssetAmount,
BASE_PRECISION
@@ -182,7 +185,7 @@ const main = async () => {
action: 'fill',
actionExplanation: getVariant(fill.actionExplanation),
referrerReward: convertToNumber(
fill.referrerReward ?? ZERO,
new BN(fill.referrerReward ?? ZERO),
QUOTE_PRECISION
),
};