Skip to content

Commit 55d95e7

Browse files
committed
don't process when tokenOut is OGN
1 parent b457ee7 commit 55d95e7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/mainnet/processors/ogn-buybacks.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,14 @@ export const ognBuybacks = defineProcessor({
196196
if (Object.keys(entry.tokensOut).length > 1) throw new Error('multiple tokens out')
197197
const tokenOut = tokensOut[0]
198198
const tokenIn = tokensIn[0]
199+
200+
// Don't process if theres no observed token out or the token out is OGN.
199201
if (!tokenOut) {
200202
// console.log('no token out ' + transaction.hash)
201203
continue
202204
}
205+
if (tokenOut === OGN_ADDRESS) continue
206+
203207
if (Object.keys(entry.tokensIn).length > 1) throw new Error('multiple tokens in')
204208
if (tokenIn === OGN_ADDRESS || tokenIn === OGV_ADDRESS) {
205209
const [tokenOutDecimals, tokenRate] = await Promise.all([
@@ -256,6 +260,10 @@ export const ognBuybacks = defineProcessor({
256260
}
257261

258262
const tokenOut = transferFrom.log.address
263+
264+
// Don't process if the token out is OGN.
265+
if (tokenOut === OGN_ADDRESS) continue
266+
259267
const [tokenOutDecimals, tokenRate] = await Promise.all([
260268
new erc20Abi.Contract(ctx, block.header, tokenOut).decimals(),
261269
ensureExchangeRate(ctx, block, tokenOut as CurrencyAddress, 'USD'),

0 commit comments

Comments
 (0)