Skip to content

Commit

Permalink
fix bn imports
Browse files Browse the repository at this point in the history
  • Loading branch information
spacedragon committed May 15, 2024
1 parent 8304c1c commit 5681246
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
],
"type": "module",
"dependencies": {
"@sentio/sdk": "^2.36.0-rc.16",
"@sentio/sdk": "^2.36.0-rc.17",
"node-fetch": "^3.3.1"
},
"resolutions": {
Expand Down
5 changes: 3 additions & 2 deletions projects/spark/src/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ OrderbookProcessor.bind({
// }
// })
.onLogTradeEvent(async (trade, ctx) => {
const vol = BigInt(trade.data.trade_price.toString()) * BigInt(trade.data.trade_size.toString())

const vol = trade.data.trade_price.mul(trade.data.trade_size)
ctx.eventLogger.emit('trade', {
distinctId: ctx.transaction?.sender,
...trade,
vol: vol.scaleDown(2 * 10)
vol: BigInt(vol.scaleDown(2 * 10).toString())
})
})
.onLogOrderChangeEvent(async (order, ctx) => {
Expand Down

0 comments on commit 5681246

Please sign in to comment.