-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFR] create account token snapshot log for each account token snapshot updates #830
Changes from all commits
21be422
6df583c
8d42b9a
9fe6041
b26cffd
52ca199
43e8eb9
4d86aa2
2b970a0
4bf0e53
c5663db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1196,6 +1196,12 @@ type AccountTokenSnapshot @entity { | |
updatedAtTimestamp: BigInt! | ||
updatedAtBlockNumber: BigInt! | ||
# ---------------------------------- state ---------------------------------- | ||
""" | ||
isLiquidationEstimateOptimistic, If `totalSubscriptionsWithUnits > 0`, it is true. | ||
Optimistic means that it is the earliest time the user will be liquidated as they may receive ongoing distributions which aren't tracked by the subgraph | ||
""" | ||
isLiquidationEstimateOptimistic: Boolean! | ||
|
||
""" | ||
Optimistic liquidation estimation property. | ||
""" | ||
|
@@ -1260,6 +1266,86 @@ type AccountTokenSnapshot @entity { | |
account: Account! | ||
token: Token! | ||
flowOperators: [FlowOperator!]! @derivedFrom(field: "accountTokenSnapshot") | ||
accountTokenSnapshotLogs: [AccountTokenSnapshotLog!]! @derivedFrom(field: "accountTokenSnapshot") | ||
} | ||
|
||
""" | ||
AccountTokenSnapshotLog: Historical entries of AccountTokenSnapshot updates. | ||
""" | ||
type AccountTokenSnapshotLog @entity { | ||
id: ID! | ||
timestamp: BigInt! | ||
blockNumber: BigInt! | ||
|
||
transactionHash: Bytes! | ||
logIndex: BigInt! | ||
order: BigInt! | ||
triggeredByEventName: String! | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @0xdavinchee Could we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure, but it may be useful to have both properties, one for filtering and the other for the information There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess... although in this case, the event ID actually contains all the same information, except the order, but of course it's not as explicit. By the way, it seems that the Graph team is quite close to implementing filtering by child entity: graphprotocol/graph-node#3184 Once that gets merged, we can have a more normalized schema, i.e. less duplicated fields just for filtering. |
||
|
||
# ---------------------------------- state ---------------------------------- | ||
""" | ||
Optimistic liquidation estimation property. | ||
""" | ||
maybeCriticalAtTimestamp: BigInt! | ||
""" | ||
The current (as of timestamp) number of currently open streams. | ||
""" | ||
totalNumberOfActiveStreams: Int! | ||
|
||
""" | ||
The current (as of timestamp) number of all-time closed streams. | ||
""" | ||
totalNumberOfClosedStreams: Int! | ||
|
||
""" | ||
The current (as of timestamp) number of subscriptions with units allocated to them tied to this `account`. | ||
""" | ||
totalSubscriptionsWithUnits: Int! | ||
|
||
""" | ||
Counts all currently (as of timestamp) approved subscriptions whether or not they have units. | ||
""" | ||
totalApprovedSubscriptions: Int! | ||
|
||
""" | ||
Balance of `account` as of `timestamp`/`block`. | ||
""" | ||
balance: BigInt! | ||
|
||
""" | ||
The total (as of timestamp) deposit this account has held by the CFA agreement for `account` active streams. | ||
""" | ||
totalDeposit: BigInt! | ||
|
||
""" | ||
The total (as of timestamp) net flow rate of the `account` as of `timestamp`/`block`. | ||
""" | ||
totalNetFlowRate: BigInt! | ||
|
||
""" | ||
The total (as of timestamp) inflow rate (receive flowRate per second) of the `account`. | ||
""" | ||
totalInflowRate: BigInt! | ||
|
||
""" | ||
The total (as of timestamp) outflow rate (send flowrate per second) of the `account`. | ||
""" | ||
totalOutflowRate: BigInt! | ||
|
||
""" | ||
The total (as of timestamp) amount of `token` streamed to this `account` until | ||
the `timestamp`/`block`. | ||
""" | ||
totalAmountStreamed: BigInt! | ||
|
||
""" | ||
The total (as of timestamp) amount of `token` this `account` has transferred. | ||
""" | ||
totalAmountTransferred: BigInt! | ||
# ---------------------------------- links ---------------------------------- | ||
account: Account! | ||
token: Token! | ||
accountTokenSnapshot: AccountTokenSnapshot! | ||
} | ||
|
||
""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be marked immutable somewhere? @0xdavinchee
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not super necessary tbh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it's supposed to be an immutable entity ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's add this to an issue and give the HOL entities an interface to implement and do this once the graph fixes the issue w/ mixing immutable/non-immutable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently it got fixed: graphprotocol/graph-node#3553 ;) Maybe hasn't shown up in hosted service yet.