Skip to content

Commit a9ba250

Browse files
committed
add swap.from EOA
1 parent 151d763 commit a9ba250

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

schema.graphql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ type Swap @entity {
196196

197197
# populated from the Swap event
198198
sender: Bytes!
199+
from: Bytes! # the EOA that initiated the txn
199200
amount0In: BigDecimal!
200201
amount1In: BigDecimal!
201202
amount0Out: BigDecimal!

src/mappings/core.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ export function handleSwap(event: Swap): void {
488488
swap.amount0Out = amount0Out
489489
swap.amount1Out = amount1Out
490490
swap.to = event.params.to
491+
swap.from = event.transaction.from
491492
swap.logIndex = event.logIndex
492493
// use the tracked amount if we have it
493494
swap.amountUSD = trackedAmountUSD === ZERO_BD ? derivedAmountUSD : trackedAmountUSD

0 commit comments

Comments
 (0)