diff --git a/src/publishers/tradesPublisher.ts b/src/publishers/tradesPublisher.ts index d0bd14e..16d9542 100644 --- a/src/publishers/tradesPublisher.ts +++ b/src/publishers/tradesPublisher.ts @@ -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 ), };