underlyingAddress, etc.) are lowercase (i.e. not checksummed). Be sure to convert addresses to lowercase first before making queries.
TokenStatistictypes is now
Subscriberentity has been changed to
Subscription. If you have been using the
subscriberproperty when querying any events, this has been changed to
subscriptionseverywhere. The only place where
subscriberis still a field is on the
Subscriptionentity as a property of type
updatedAtfields are now
updatedAtTimestampon every type.
schema.graphqlfile and will be viewable in the playground as well. These entities are created once and never updated. For example, the
FlowUpdatedEventtype will mirror the properties on the
FlowUpdatedevent inside of the Superfluid contracts.
Note: Each event entity
idis formulated as follows:
Note: event types in our legacy subgraph did not have 'Event' appended onto the end of their name. In our new v1 implementation, every event type is named 'Event Name' + 'Event.' For example,
IndexCreatedEvent. This schema is applied to every other event type as well.
Indexwithin a Superfluid instant distribution agreement (IDA)
subscriberaccount of a particular
receiver. An account can create a stream or update its flow rate, but when they delete it, it is considered "dead." The next stream that is created between the same
receiverwill generate a new stream entity. Therefore, multiple stream entities can be created between the same
Streamwith a specific constant flowRate. You can think of it as a portion of a
Stream. Each time a Stream's
flowRateis updated, a new
StreamPeriodwill be created.
Note: the stream type is a replacement for the previously used Flow type (as of October '21). The below image provides a good visual outline of how the
StreamPeriodtypes compare to the previously used
Note: keep in mind that a maximum of 1000 items may be returned in a single query.
tokenwill return the token entity type - with the
idin this case.
createdAtTimestampwill return the timestamp at which the
updatedAtTimestampwill return the timestamp of the last time the stream was updated.
currentFlowRatewill return the current flow rate of the stream.
streamedUntilUpdatedAtwill return the amount streamed until
Note: to get the current (dynamic) total amount streamed, you can use the following formula: streamedUntilUpdatedAt + ((current time in seconds) - updatedAtTimestamp) * currentFlowRate
orderDirectionto get the 10 most recently updated flows.
Note: as explained in the previous higher order level entities section under the
Streamtype, it's important to understand the difference between a Flow and a Stream. A Flow represents all streaming activity between 2 addresses for a given token, while a Stream may only represent a portion of that flow. A new stream period is created each time the
flowRateis updated, and a new stream is created each time a stream is terminated and restarted again (with the creation happening upon restarting)
oldFlowRate- the flowRate of the previous stream (will return "0" if this is a newly created Flow)
flowRate- the flowRate of the current stream
stream- the Stream type associated with the flow. In our case, the next few items will come from the Stream type. Several streams may be returned if there have been multiple streams created for this
tokenused in the updated flow. Here we are returning this token's
senderof the updated flow. Here we will return this sender's
receiverof the updated flow. Here we will return this receiver's
subscriptionswill return an
IndexSubscriptiontype for each
Indexthat this account is subscribed to
Tokenused in each subscription. Here we display the
id- the ID of the
IndexSubscription. This ID is composed of:
approved- a boolean value that represents whether or not the subscription is
approved. Approved subscriptions don't require subscribers to claim tokens that are distributed from the publisher.
units- the total number of units allocated to this account in the index. If
unitsis 0, it indicates that the subscription is "deleted". They are no longer subscribed to the index.
totalAmountReceivedUntilUpdatedAt- the total amount of tokens that this account has received via this IDA index until
indexValue- used to calculate the distribution amount that a user receives when the publisher updates the index value. The distribution amount can be calculated using the following formula:
(index.indexValue - subscriber.indexValue) * subscriber.units
totalUnitsPending- he number of units allocated by the
Indexthat are pending. This refers to the current (as of updatedAt)
totalUnitsPending- not all that has ever been pending.
totalUnitsApproved- he number of units allocated by the
Indexthat have been approved. This refers to the current (as of updatedAt)
totalUnitsApproved- not all that has ever been approved.
totalUnits- the sum of
token- the type
Tokenused in the index.
symbol- the symbol of the
Tokenused in the index
totalNumberOfActiveStreams- the total count of active streams using the token.
totalNumberOfActiveIndexes- total number of active IDA indexes for the token.
totalAmountStreamedUntilUpdatedAt- all-time total amount streamed until the
totalOutFlowRate- total outflow rate of the
token(how much value is being moved).
totalAmountDistributedUntilUpdatedAt- all-time total amount distributed until the
Accountentity will return an
AccountTokenSnapshotfor every token used for each
id(i.e. for each Account's address).
trueif the account is a super app,
inflows- will return all
outflows- will return all
token- the address of the token used in streams or subscriptions
totalNumberOfActiveStreams- the total number of streams the account is associated with for the given token
totalNetFlowRate- the total net flow rate of the
accountfor the given token as of
NOTE: Please refer to the above section on Breaking Changes as of October 2021, and the section on Streams vs Flows in the above section on the V1 Subgraph documentation. For example, you'll notice in the below example that the
Flowtype is used in a query. This type has been deprecated.
sumsince the last on-chain event (
flowDeleted). Therefore, if
flowRateis greater than zero, you will need to calculate the tokens flowed since the last event. Use this equation to get the the total sum of tokens flowed: