diff --git a/packages/subgraph/src/mappingHelpers.ts b/packages/subgraph/src/mappingHelpers.ts index 7fbb596983..39e2dc7eea 100644 --- a/packages/subgraph/src/mappingHelpers.ts +++ b/packages/subgraph/src/mappingHelpers.ts @@ -1042,10 +1042,6 @@ export function updateATSStreamedAndBalanceUntilUpdatedAt( accountAddress: Address, tokenAddress: Address, block: ethereum.Block, - - // TODO: we are currently always passing null here - // remove null one at a time and use validation script - // to compare v1 to feature balanceDelta: BigInt | null ): void { let accountTokenSnapshot = getOrInitAccountTokenSnapshot( diff --git a/packages/subgraph/src/mappings/cfav1.ts b/packages/subgraph/src/mappings/cfav1.ts index 3ad3b198ca..0c2f758060 100644 --- a/packages/subgraph/src/mappings/cfav1.ts +++ b/packages/subgraph/src/mappings/cfav1.ts @@ -134,8 +134,7 @@ export function handleFlowUpdated(event: FlowUpdated): void { senderAddress, tokenAddress, event.block, - // @note when deleting, we do RPC call (prevents double accounting post-liquidation) - null + depositDelta ); updateATSStreamedAndBalanceUntilUpdatedAt( receiverAddress, diff --git a/packages/subgraph/src/mappings/gdav1.ts b/packages/subgraph/src/mappings/gdav1.ts index 5afc5c4b3d..025f5a82d6 100644 --- a/packages/subgraph/src/mappings/gdav1.ts +++ b/packages/subgraph/src/mappings/gdav1.ts @@ -264,18 +264,6 @@ export function handleFlowDistributionUpdated( ); _createTokenStatisticLogEntity(event, event.params.token, eventName); - // Update ATS - updateSenderATSStreamData( - event.params.distributor, - event.params.token, - event.params.newDistributorToPoolFlowRate, - flowRateDelta, - BIG_INT_ZERO, - isCreate, - isDelete, - false, - event.block - ); updateATSStreamedAndBalanceUntilUpdatedAt( event.params.distributor, event.params.token, @@ -289,6 +277,19 @@ export function handleFlowDistributionUpdated( eventName ); + // Update ATS + updateSenderATSStreamData( + event.params.distributor, + event.params.token, + event.params.newDistributorToPoolFlowRate, + flowRateDelta, + BIG_INT_ZERO, + isCreate, + isDelete, + false, + event.block + ); + // Create Event Entity _createFlowDistributionUpdatedEntity(event, poolDistributor.id, pool.totalUnits); } diff --git a/packages/subgraph/src/mappings/idav1.ts b/packages/subgraph/src/mappings/idav1.ts index 43d3bbf6af..f019fdd603 100644 --- a/packages/subgraph/src/mappings/idav1.ts +++ b/packages/subgraph/src/mappings/idav1.ts @@ -262,7 +262,7 @@ export function handleSubscriptionApproved(event: SubscriptionApproved): void { event.params.subscriber, event.params.token, event.block, - null // will do RPC if any units exist anyways + balanceDelta ); if (hasSubscriptionWithUnits) {