Skip to content

Commit e198839

Browse files
committed
Fix logic in CT lookup
1 parent 0331b47 commit e198839

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/lazy-rings-yell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@3loop/transaction-interpreter': patch
3+
---
4+
5+
Fix logic in CT lookup

packages/transaction-interpreter/interpreters/polymarket.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export async function transformEvent(
178178
const marketData = context.marketData as any
179179
const user = { address: userAddress, name: null }
180180
const baseContext = { proxyWallets: signersAndProxies, ...context }
181-
const lookupTokenId = userIsBuying ? takerAssetId : tokenId
181+
const lookupTokenId = userAddress && tokenId ? tokenId : userIsBuying && userIsMaker ? takerAssetId : makerAssetId
182182
const outcome = marketData?.tokens.find((t: any) => t.tokenId === lookupTokenId)?.outcome
183183
const outcomeText = outcome ? `'${outcome}'` : 'outcome tokens'
184184
const marketText = marketData?.question ? ` in the market '${marketData.question}'` : ''

0 commit comments

Comments
 (0)