Subgraph
View data related to markets, tokens and bond purchases
We have subgraphs available for all supported chains, mainnet and testnet. Our Ethereum Mainnet runs on Graph Protocol's decentralized network, all others are on their hosted service.
Documentation is available for all entities and their fields, to access it, follow one of the links at the bottom of this page, then in GraphiQL:
The documentation is usually identical across all subgraphs, so it does not matter which one you use.
However, if changes are being made, the updates may appear on testnet or backup subgraphs before they appear in production.
Mainnet Subgraphs
https://api.studio.thegraph.com/query/41517/bond-protocol-ethereum-mainnet/v1.0.6 (Mainnet Development - version number at the end of the URL may change)
https://api.thegraph.com/subgraphs/name/bond-protocol/bond-protocol-arbitrum-mainnet (Arbitrum Production)
Testnet Subgraphs
Example Queries
NOTES
Each subgraph only returns data for the chain it is indexing. You cannot filter by fields such as "network" or "chainId", they have only been added to allow the dApp to do so, once the results from multiple subgraphs have been merged.
String searches are case sensitive, unless you add
_nocase
for exampleowner_contains_nocase
as seen in the vesting token balance example.The
hasClosed
field on theMarket
entity is not fully trustworthy, markets can sometimes close without triggering an event which updates this. We use it to filter out the majority which do trigger an event, then on the dApp, filter the rest manually.By default, a request returns a maximum of 100 results. You can request up to 1000 using
first: 1000
, for example:ownerTokenTbvs(first: 1000)
. If more than 1000 results are required, you will have to use pagination (https://thegraph.com/docs/en/querying/graphql-api/#pagination).
List markets, including all data loaded by dApp on initial load:
List all tokens:
Show vesting token balances for a given user:
TBV per owner/token combination:
Bond purchases per market:
Last updated