Skip to content

Commit

Permalink
[GDA][SUBGRAPH] GDA Subgraph Fixes (#1816)
Browse files Browse the repository at this point in the history
* fix mapping logic

* removed unused fields (mostly related to GDA inflows), fix possible overflow in updatePoolMemberTotalAmountUntilUpdatedAtFields

* fix build
  • Loading branch information
0xdavinchee authored Jan 30, 2024
1 parent 977e20d commit 40e7b55
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 310 deletions.
137 changes: 10 additions & 127 deletions packages/subgraph/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -2281,20 +2281,11 @@ type AccountTokenSnapshot @entity {
"""
activeGDAOutgoingStreamCount: Int!

"""
The count of active incoming streams to this account for all agreements.
"""
activeIncomingStreamCount: Int!

"""
The count of active incoming streams to this account for the CFA.
GDA incoming streams are *NOT* counted here.
"""
activeCFAIncomingStreamCount: Int!

"""
The count of active incoming streams to this account for the GDA.
"""
activeGDAIncomingStreamCount: Int!
activeIncomingStreamCount: Int!

"""
The count of closed streams by `account`, both incoming and outgoing for all agreements.
Expand Down Expand Up @@ -2326,20 +2317,11 @@ type AccountTokenSnapshot @entity {
"""
inactiveGDAOutgoingStreamCount: Int!

"""
The count of closed incoming streams by `account` for all agreements.
"""
inactiveIncomingStreamCount: Int!

"""
The count of closed incoming streams by `account` for the CFA.
Close incoming GDA streams are *NOT* counted here.
"""
inactiveCFAIncomingStreamCount: Int!

"""
The count of closed incoming streams by `account` for the GDA.
"""
inactiveGDAIncomingStreamCount: Int!
inactiveIncomingStreamCount: Int!

"""
The current (as of updatedAt) number of subscriptions with units allocated to them tied to this `account`.
Expand Down Expand Up @@ -2384,6 +2366,7 @@ type AccountTokenSnapshot @entity {
"""
The total net flow rate of the `account` as of `updatedAtTimestamp`/`updatedAtBlock` for all flow agreements.
This can be obtained by: `totalInflowRate - totalOutflowRate`.
NOTE: this property will NOT be 100% accurate all the time for receivers of GDA flows.
"""
totalNetFlowRate: BigInt!

Expand All @@ -2392,25 +2375,11 @@ type AccountTokenSnapshot @entity {
"""
totalCFANetFlowRate: BigInt!

"""
The total net flow rate of the `account` as of `updatedAtTimestamp`/`updatedAtBlock` for the GDA.
"""
totalGDANetFlowRate: BigInt!

"""
The total inflow rate (receive flowRate per second) of the `account` for all flow agreements.
"""
totalInflowRate: BigInt!

"""
The total inflow rate (receive flowRate per second) of the `account` for the CFA.
GDA inflow rate is *NOT* included here.
"""
totalCFAInflowRate: BigInt!

"""
The total inflow rate (receive flowRate per second) of the `account` for the GDA.
"""
totalGDAInflowRate: BigInt!
totalInflowRate: BigInt!

"""
The total outflow rate (send flowrate per second) of the `account` for all flow agreements.
Expand All @@ -2427,20 +2396,10 @@ type AccountTokenSnapshot @entity {
"""
totalGDAOutflowRate: BigInt!

"""
The total amount of `token` streamed into this `account` until the `updatedAtTimestamp`/`updatedAtBlock` for all flow agreements.
"""
totalAmountStreamedInUntilUpdatedAt: BigInt!

"""
The total amount of `token` streamed into this `account` until the `updatedAtTimestamp`/`updatedAtBlock` for the CFA.
"""
totalCFAAmountStreamedInUntilUpdatedAt: BigInt!

"""
The total amount of `token` streamed into this `account` until the `updatedAtTimestamp`/`updatedAtBlock` for the GDA.
"""
totalGDAAmountStreamedInUntilUpdatedAt: BigInt!
totalAmountStreamedInUntilUpdatedAt: BigInt!

"""
The total amount of `token` streamed from this `account` until the `updatedAtTimestamp`/`updatedAtBlock` for all flow agreements.
Expand All @@ -2452,11 +2411,6 @@ type AccountTokenSnapshot @entity {
"""
totalCFAAmountStreamedOutUntilUpdatedAt: BigInt!

"""
The total amount of `token` streamed from this `account` until the `updatedAtTimestamp`/`updatedAtBlock` for the GDA.
"""
totalGDAAmountStreamedOutUntilUpdatedAt: BigInt!

"""
The total amount of `token` streamed through this `account` until the `updatedAtTimestamp`/`updatedAtBlock` for all flow agreements.
"""
Expand All @@ -2467,11 +2421,6 @@ type AccountTokenSnapshot @entity {
"""
totalCFAAmountStreamedUntilUpdatedAt: BigInt!

"""
The total amount of `token` streamed through this `account` until the `updatedAtTimestamp`/`updatedAtBlock` for the GDA.
"""
totalGDAAmountStreamedUntilUpdatedAt: BigInt!

"""
The total amount of `token` this `account` has transferred.
"""
Expand Down Expand Up @@ -2538,16 +2487,6 @@ type AccountTokenSnapshotLog @entity {
"""
activeIncomingStreamCount: Int!

"""
The count of active incoming streams to this account for the CFA.
"""
activeCFAIncomingStreamCount: Int!

"""
The count of active incoming streams to this account for the GDA.
"""
activeGDAIncomingStreamCount: Int!

"""
The current (as of timestamp) count of closed streams for all agreements.
"""
Expand Down Expand Up @@ -2578,20 +2517,11 @@ type AccountTokenSnapshotLog @entity {
"""
inactiveGDAOutgoingStreamCount: Int!

"""
The count of closed incoming streams by `account` for all agreements.
"""
inactiveIncomingStreamCount: Int!

"""
The count of closed incoming streams by `account` for the CFA.
Close incoming GDA streams are *NOT* counted here.
"""
inactiveCFAIncomingStreamCount: Int!

"""
The count of closed incoming streams by `account` for the GDA.
"""
inactiveGDAIncomingStreamCount: Int!
inactiveIncomingStreamCount: Int!

"""
The current (as of timestamp) number of subscriptions with units allocated to them tied to this `account`.
Expand Down Expand Up @@ -2641,31 +2571,14 @@ type AccountTokenSnapshotLog @entity {

"""
The total (as of timestamp) net flow rate of the `account` as of `timestamp`/`block` for the CFA.
This can be obtained by: `totalCFAInflowRate - totalCFAOutflowRate`
"""
totalCFANetFlowRate: BigInt!

"""
The total (as of timestamp) net flow rate of the `account` as of `timestamp`/`block` for the GDA.
This can be obtained by: `totalGDAInflowRate - totalGDAOutflowRate`
"""
totalGDANetFlowRate: BigInt!

"""
The total (as of timestamp) inflow rate (receive flowRate per second) of the `account`.
"""
totalInflowRate: BigInt!

"""
The total (as of timestamp) inflow rate (receive flowRate per second) of the `account` for the CFA.
"""
totalCFAInflowRate: BigInt!

"""
The total (as of timestamp) inflow rate (receive flowRate per second) of the `account` for the GDA.
"""
totalGDAInflowRate: BigInt!

"""
The total (as of timestamp) outflow rate (send flowrate per second) of the `account`.
"""
Expand All @@ -2686,16 +2599,6 @@ type AccountTokenSnapshotLog @entity {
"""
totalAmountStreamedIn: BigInt!

"""
The total (as of timestamp) amount of `token` streamed into this `account` until the `timestamp`/`block` for the CFA.
"""
totalCFAAmountStreamedIn: BigInt!

"""
The total (as of timestamp) amount of `token` streamed into this `account` until the `timestamp`/`block` for the GDA.
"""
totalGDAAmountStreamedIn: BigInt!

"""
The total (as of timestamp) amount of `token` streamed from this `account` until the `timestamp`/`block`.
"""
Expand All @@ -2706,11 +2609,6 @@ type AccountTokenSnapshotLog @entity {
"""
totalCFAAmountStreamedOut: BigInt!

"""
The total (as of timestamp) amount of `token` streamed from this `account` until the `timestamp`/`block` for the GDA.
"""
totalGDAAmountStreamedOut: BigInt!

"""
The total (as of timestamp) net amount of `token` streamed through this `account` until the `timestamp`/`block`.
"""
Expand All @@ -2721,11 +2619,6 @@ type AccountTokenSnapshotLog @entity {
"""
totalCFAAmountStreamed: BigInt!

"""
The total (as of timestamp) net amount of `token` streamed through this `account` until the `timestamp`/`block` for the GDA.
"""
totalGDAAmountStreamed: BigInt!

"""
The total (as of timestamp) amount of `token` this `account` has transferred out until the `timestamp`/`block`.
"""
Expand Down Expand Up @@ -2857,11 +2750,6 @@ type TokenStatistic @entity {
"""
totalCFAAmountStreamedUntilUpdatedAt: BigInt!

"""
The all-time total amount streamed (outflows) until the `updatedAtTimestamp`/`updatedAtBlock` for the GDA.
"""
totalGDAAmountStreamedUntilUpdatedAt: BigInt!

"""
The all-time total amount transferred until the `updatedAtTimestamp`/`updatedAtBlock`.
"""
Expand Down Expand Up @@ -3016,11 +2904,6 @@ type TokenStatisticLog @entity {
"""
totalCFAAmountStreamed: BigInt!

"""
The all-time total amount of `token` streamed (outflows) until the `timestamp`/`block` for the GDA.
"""
totalGDAAmountStreamed: BigInt!

"""
The all-time total amount of `token` transferred until the `timestamp`/`block`.
"""
Expand Down
Loading

0 comments on commit 40e7b55

Please sign in to comment.