Skip to content

sablier-labs/v1-subgraph

Repository files navigation

Sablier V1 Subgraph

This is the subgraph of the Sablier V1 token streaming protocol, which is a legacy release. The most recent release is V2 and can be found here. For more details about how Sablier works, check out our docs at docs.sablier.com/.

You can interact with the subgraph using The Graph's hosted service:

Queries

Below are a few ways to show how to query the Sablier V1 subgraph for data. The queries show most of the information that is queryable, but there are many other filtering options that can be used. Just check out the GraphQL API.

Query All Streams

{
  streams {
    id
    cancellation {
      recipientBalance
      timestamp
      txhash
    }
    deposit
    ratePerSecond
    recipient
    sender
    startTime
    stopTime
    timestamp
    token {
      id
      decimals
      name
      symbol
    }
    txs {
      id
      block
      event
      from
      timestamp
      to
    }
    withdrawals {
      id
      amount
    }
  }
}

Query All Streams for a Particular User

You can do this with the where clause. Make sure that the user address is in lowercase:

{
  streams(where: { sender: "0xcafe...beef" }) {
    id
  }
}

Query All Transactions

{
  transactions {
    id
    block
    event
    from
    stream {
      id
    }
    timestamp
    to
  }
}