diff --git a/packages/subgraph/schema.graphql b/packages/subgraph/schema.graphql index ca3c7ffa44..dc662fbc35 100644 --- a/packages/subgraph/schema.graphql +++ b/packages/subgraph/schema.graphql @@ -2303,6 +2303,8 @@ type AccountTokenSnapshot @entity { ID composed of: accountID-tokenID """ id: ID! + createdAtTimestamp: BigInt! + createdAtBlockNumber: BigInt! updatedAtTimestamp: BigInt! updatedAtBlockNumber: BigInt! # ---------------------------------- state ---------------------------------- diff --git a/packages/subgraph/src/mappingHelpers.ts b/packages/subgraph/src/mappingHelpers.ts index 2f206ffed6..2d14d64e98 100644 --- a/packages/subgraph/src/mappingHelpers.ts +++ b/packages/subgraph/src/mappingHelpers.ts @@ -643,6 +643,8 @@ export function getOrInitAccountTokenSnapshot( if (accountTokenSnapshot == null) { accountTokenSnapshot = new AccountTokenSnapshot(atsId); + accountTokenSnapshot.createdAtTimestamp = block.timestamp; + accountTokenSnapshot.createdAtBlockNumber = block.number; accountTokenSnapshot.updatedAtTimestamp = block.timestamp; accountTokenSnapshot.updatedAtBlockNumber = block.number; accountTokenSnapshot.totalNumberOfActiveStreams = 0;