LogoLogo
  • 🌊Superfluid
  • Protocol Overview
    • πŸ’‘What is Superfluid?
    • πŸ“„In-Depth Overview
      • Super Tokens
      • Super Agreements
        • 🚰Money Streaming (CFA)
        • ✳️Distributions (IDA)
        • 🌊Streaming Distributions
      • Super Apps
      • Superfluid Host
    • 🧠Use Cases
      • Recurring Payments
      • DeFi
      • Social & Community
      • Gaming
    • πŸ“”Glossary of Terms
  • Developers
    • πŸƒQuickstart
    • πŸͺ™Super Tokens
      • Super Tokens - Solidity
      • Super Tokens - SDK Core
      • Super Tokens - Frontend Examples
      • Types of Super Tokens
      • Deploy a Super Token
        • Deploying a Wrapper Super Token
        • Deploying a Self Governed Super Token
        • Deploying a Pure Super Token
      • In-Depth
        • Tracking Super Token Balances
        • ERC777 in Super Tokens
      • Test Super Token Faucet
    • 🌊Money Streaming (CFA)
      • Solidity
        • Read Methods
          • getFlowInfo
          • getFlowRate
          • getNetFlowRate
        • Write Methods
          • createFlow
          • updateFlow
          • deleteFlow
          • With User Data
          • With Context
      • SDK Core
        • Read Methods
          • getFlow
          • getNetFlow
          • getAccountFlowInfo
        • Write Methods
          • createFlow
          • updateFlow
          • deleteFlow
      • Access Control List (ACL)
        • Solidity
          • createFlowFrom
          • updateFlowFrom
          • deleteFlowFrom
          • setFlowPermissions
          • setMaxFlowPermissions
          • revokeFlowPermissions
          • increaseFlowRateAllowanceWithPermissions
          • decreaseFlowRateAllowanceWithPermissions
          • getFlowPermissions
        • SDK Core
          • createFlowByOperator
          • updateFlowByOperator
          • deleteFlowByOperator
          • updateFlowOperatorPermissions
          • revokeFlowOperatorPermissions
          • increaseFlowRateAllowanceWithPermissions
          • getFlowOperatorData
      • Frontend Examples
      • More...
        • Flow Rate Time Frames
        • Building Batched Streams in Safe
        • Flow NFTs
    • ✳️Distributions (IDA)
      • IDA - Solidity
      • IDA - SDK Core
      • IDA - Frontend Examples
    • πŸ€–Super Apps
      • Super Apps in Depth
      • Super App Callbacks
        • Calling Agreements In Super Apps
      • User Data
        • NFT Billboard Example
      • SuperAppBaseFlow
      • Super App Examples
      • Super App Deployment Guide
    • 🧺Batch Calls
      • Batch Calls - SDK Core
      • Batch Calls - Frontend Examples
    • βš™οΈAutomations
      • Auto-Wrap
        • Dev Guide
      • Stream Scheduler
        • Dev Guide
      • Vesting Scheduler
        • Dev Guide
      • Stream Accounting API
        • Dev Guide
      • Automation Subgraphs
        • Stream Scheduler Subgraph
        • Vesting Scheduler Subgraph
        • Auto Wrap Subgraph
    • πŸ—οΈIntegration Guides
      • For Your Integration: The Basics
        • Supporting Super Tokens
        • Supporting Money Streams
        • Supporting Instant Distributions
      • Gating with Superfluid Subscriptions & Guild.xyz
      • Displaying Token Balances
      • Useful Queries for Your Integration
        • Instant Distribution Events
        • Money Streaming Events
        • Super Token Events
        • Other Helpful Queries
      • Constructing Links to The Superfluid Dashboard
    • πŸ”Superfluid Subscriptions
      • Superfluid Checkout Widget
      • Implementing Subscriptions in your App
    • SDK Core General
      • Initialization
      • Functionality
      • Getting Data
      • Resolver
      • Reference Docs
    • Solidity General
      • Calling Super Agreements
      • Libraries
      • Resolver
    • Testing Guide
      • Hardhat Testing
      • Foundry Testing
      • In-Depth
        • Hardhat Mainnet Fork Testing
        • Super App Testing on Mainnet Forks
    • Subgraph
    • Reference
      • Deploying The Framework
      • EVM Contracts
      • SDK Redux
      • Superfluid Console
      • Superfluid Protocol Addresses
    • Contract Addresses
  • Sentinels
    • πŸ₯…Liquidations & TOGA
    • πŸ€–Running a Sentinel
    • πŸ—ΊοΈSolvency Dashboard
  • Resources
    • 🌊Superfluid Wave Pool
    • πŸ“œSuperfluid on Ethereum Mainnet
    • πŸ’°Bounty Program
    • πŸ›‘οΈSecurity & Bug Bounties
    • πŸ’‘Project Ideas
    • πŸ—³οΈToken Dashboard Submission
    • πŸŽ₯Videos
    • Superfluid Deployment Guide
    • Learn about Ethereum
    • Code of Conduct
Powered by GitBook
On this page

Was this helpful?

  1. Developers
  2. Integration Guides
  3. Useful Queries for Your Integration

Instant Distribution Events

Query IDA Events

PreviousUseful Queries for Your IntegrationNextMoney Streaming Events

Last updated 2 years ago

Was this helpful?

IDA Events (For Distributions)

indexDistributionClaimed: emits when a subscriber claims a pending distribution. This will increment the super balance of the subscriber

Sample Subgraph Query:

#get events where subscriber "0xdcb" claimed a pending distribution
query MyQuery {
  indexDistributionClaimedEvents(
    where: {subscriber: "0xDCB45e4f6762C3D7C61a00e96Fb94ADb7Cf27721"}
  ) {
    amount
    indexId
    timestamp
    token
  }
}

subscriptionApprovedEvents : emits when a subscribed approves a subscription. If the subscribed has any unclaimed distributions, this will increment the token balance of the subscriber

Sample Subgraph Query:

#get events where subscriber "0xdcb" approved a subscription
query MyQuery {
  subscriptionApprovedEvents(
    where: {subscriber: "0xdcb45e4f6762c3d7c61a00e96fb94adb7cf27721"}
  ) {
    timestamp
    token
    transactionHash
  }
}

indexUpdatedEvents: emits when an index is updated. This will happen when a publisher distributes funds to an index. If a subscriber has approved the subscription by calling approveSubscription(), then these events will increment the user’s balance. In this case, we’d recommend getting a user’s list of index subscriptions and then simply calling balanceOf() when an indexUpdatedEvent is emitted for one of those subscriptions.

Sample Subgraph Queries

#get a subscriber's index subscriptions
{
   accounts(where: {
   #your address below
    id: "0x..."
    }) {
    subscriptions{
      	index {
          token{
            symbol
          }
        }
        id
        approved
        units
        totalAmountReceivedUntilUpdatedAt
    }
  }
}

Then, you can listen for events for the above indexIds^

query MyQuery {
  indexUpdatedEvents(where: {indexId: $id}) {
    timestamp
  }
}

πŸ—οΈ
Solidity Event:
Solidity Event:
Solidity Event: