Skip to content

Commit

Permalink
Add block number to JoinExit entity.
Browse files Browse the repository at this point in the history
  • Loading branch information
thetroyharris committed Dec 12, 2023
1 parent 5d10bf9 commit 9e566a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ type JoinExit @entity(immutable: true) {
user: User!
timestamp: Int!
tx: Bytes!
block: BigInt!
}

type LatestPrice @entity {
Expand Down
2 changes: 2 additions & 0 deletions src/mappings/vault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ function handlePoolJoined(event: PoolBalanceChanged): void {
join.timestamp = blockTimestamp;
join.tx = transactionHash;
join.valueUSD = valueUSD;
join.block = event.block.number;
join.save();

let protocolFeeUSD = ZERO_BD;
Expand Down Expand Up @@ -329,6 +330,7 @@ function handlePoolExited(event: PoolBalanceChanged): void {
exit.timestamp = blockTimestamp;
exit.tx = transactionHash;
exit.valueUSD = valueUSD;
exit.block = event.block.number;
exit.save();

let protocolFeeUSD = ZERO_BD;
Expand Down

0 comments on commit 9e566a5

Please sign in to comment.