Why is there billing from the first query?

I am a fairly new developer of DeFi, coming from the Web Dev world.

I’ve been going in circles for weeks, trying to figure out how to query for UniV3 Liquidity Pairs given a pair of tokens… a task quite trivial with UniV2 and the factory contract… After weeks of asking and asking around, I concluded that the only feasible way is through using thegraph protocol via GraphQL queries.

I have now realised that in order to perform even a single query on TheGraph, I am required to pay in GRT.

This has perplexed and confused me in multiple levels…

  1. I know and understand there are costs involved in maintaining this infrastructure. Everyone knew this when TheGraph started and positioned itself as the “single-source-of-truth” for many queries… Is this now a matter of TheGraph leveraging their unique position in expense of the developers?

  2. Why aren’t DAOs participating in the costs instead of collecting fees from the Developers?

  3. How are the DAOs actively supporting this business model, milking the people who put their work in to make tooling, applications and services for DeFi?

  4. Why isn’t there a common sense tier system like most commercial services have? Where they offer a free tier for up an amount of resource usage and beyond that billing starts, something sensible?

I could go on and on with issues and trying to understand justification, but for this to be so widely supported and noone raising the issue, I must be missing something fundamental…

So I am prepared to get embarrassed with what I am missing here…

1 Like

The Graph Network is technically a paid service, you pay for the queries you run through the network.
There’s still the “free” service, which is what was known as the “hosted service”, which is still functioning (probably where you were querying the UniV2 data) and will still be available for some time, as far as I understand.

Whether there’s a UniV3 deployment on the hosted service that you can query for free I’m not sure, you could try reaching out to the Uniswap team. As far as I understand, the Uniswap V3 on the The Graph Network wasn’t deployed by them, but it’s using their code :thinking:

EDIT: There’s actually deployments on the hosted service, which are linked in the uniswap official documentation
Uniswap official docs for subgraph data: Uniswap Subgraph Data | Uniswap
Uniswap V3 on hosted service: https://thegraph.com/legacy-explorer/subgraph/uniswap/uniswap-v3

Thank you Juanmardefago for the reply.

The issue I posted appears as “two-fold” but it really isn’t. It appears as if I have a technical problem in fetching data for UniV3. But that’s not really the case at all. Thank you for the provided resources, though, that helps.

The real issue here is the politics involved in the decision making to move the cost of running this service (thegraph) to the end-users (developers).

In a world where the entire global industry, horizontally, vertically and through any slice or segment you wanna cut it, are subsidising development adoption and are thirsty for talent, thegraph is effectively doing the exact opposite by taxing application development and platform (of DAOs) adoption.

Let’s be clear on what is going on here, the main beneficiary in this service are the DAOs. The whole premise of this project (TheGraph) is to make information more accessible. The mission statement of TheGraph is:

“The Graph’s mission is to make serverless applications possible and to make building on Web3 accessible to anyone.”

How does the decision to raise a paywall on the data bode with the mission statement and the fact that the main beneficiaries are the DAOs?

Don’t get me wrong here, I have been in the tech industry for over 20 years and I know what the costs are and what paying bills is and means. And that’s why I can confidently say, that the costs of the entire TheGraph’s operation can be covered by DAOs and they wouldn’t even flinch at the cost.

This isn’t about me being frugal, this is about the wrongs I see on DeFi as a new engineer trying to ramp up. This one takes the cake because it’s not “just another blockchain indexer”. It is 100% supported and exists because of, the entire DeFi community.

It is the DAOs that put in very significant resources to build the schemas and how the graph will populate, and it is with these resources that “TheGraph” is what it is today.

Deciding to move the costs of TheGraph infrastructure and operations to the developers while at the same time DAOs are yearning for developer adoption and application development, is quite an interesting position.

1 Like

This is a really good question. There should be a freemium tier for devs to just play around with. Thanks for raising this point.

I think this is great feedback, and I appreciate you taking the time to share the insight. I don’t have anything to add to the discussion at this point, but I wanted to leave a comment here so that I can follow along/come back if I had something to add.

Hi @thanpolas! I think you raise quite a few interesting points here.

Firstly - can you clarify who / what you mean by “DAOs”? There are quite a lot of types of organisation building on Ethereum, and I don’t know if it makes sense to treat them all as one group.

When you say “the costs of the entire TheGraph’s operation can be covered by DAOs and they wouldn’t even flinch at the cost”, I think that is slightly at odds to the overall approach of the network. Firstly, there isn’t one single infrastructure provider - there is a network of indexers who are incurring cost to index and serve subgraphs. The Graph Protocol aims to create a self-sustaining ecosystem where indexing and serving subgraphs is a sustainable business for indexers, while providing a robust & affordable solution for developers. Right now the bulk of the compensation for indexers is indexing rewards, but query fees are a key aspect of the network design. Is your suggestion that all query fees to indexers should be paid by DeFi protocols, or some larger shift in the overall model?

You say that “It is the DAOs that put in very significant resources to build the schemas and how the graph will populate, and it is with these resources that “TheGraph” is what it is today”, but actually it is more egalitarian than that. It is true that some of the most-used subgraphs were developed by large Defi protocols, but there are thousands of subgraphs built for specific dapps by subgraph developers, and that customisability and variety is one of the real strengths of The Graph. Ethereum is a diverse & interesting place, and so subgraphs have to be diverse and interesting too.

To address you primary point, there are a bunch of participants in The Graph ecosystem, and a few types of developers. Subgraph developers build and maintain subgraphs, Dapp developers build applications on top of those subgraphs (and of course often developers will wear both hats).

It is true that the network introduces costs to both types of developers that weren’t there before.

Subgraph developers now have to pay transaction costs to publish their subgraphs to the network, they may have to lock up some GRT as signal, and may have to pay GRT to upgrade their subgraphs. But as a subgraph developer just starting out, you can deploy your subgraph to the subgraph studio, where it will get indexed by some Edge & Node indexers for testing and development purposes, before publishing to the network. It won’t work for production-scale dapps, but it is like the free tier suggestion from your original message.

However it is the case that on the network, Dapp developers who didn’t develop the subgraph they want to use (which I believe is the category you are in) now have an upfront cost from the first query outside the explorer, which is a valid concern and real barrier to entry. I think there are potential solutions to this (a faucet, some kind of community-subsidised limit) which it would be great to explore.

1 Like

Hello Adam,

thank you for taking the time to give a thorough reply. Let me start by answering your specific questions:

can you clarify who / what you mean by “DAOs”

As you correctly mentioned later, I am referring to all the DeFi protocols that participate in the subgraph.

Is your suggestion that all query fees to indexers should be paid by DeFi protocols, or some larger shift in the overall model?

Yes, all fees to indexers should be paid by DeFi protocols. And that is not “at odds to the overall approach of the network”.

TheGraph’s [new] role is to collect and distribute the fees and create and enforce the fee policies. So, there is a centralized entity taking care of that, albeit it can be a DAO itself (I am not sure to what degree, as I said, I am new to the space).

So, it’s just a decision to be made. That decision, is even more easy to be made considering the points you make further down your reply:

Subgraph developers build and maintain subgraphs, Dapp developers build applications on top of those subgraphs (and of course often developers will wear both hats).

So, effectively, the biggest percentage of the cost, is already handled by the DeFi Protocols.

My point and belief still stands:

“the costs of the entire TheGraph’s operation can be covered by DAOs and they wouldn’t even flinch at the cost”

And that would be fair, as the DeFi protocols are the main beneficiaries in this service. Paywalling the service, doesn’t really serve anyone, nor thegraph’s mission itself. Nor does it help new protocols that are trying to get a footing on the space, to be taxed by the moment they want to submit their first subgraph. A subsidy has to exist there too if we care for the ecosystem at large.

I understand that big consumers of thegraph, outside the DeFi protocols, should weigh in the costs too, but that’s a good problem to have, when it presents itself. So far, as I understand it, the vast majority of the users of thegraph, are the DeFi protocols themselves to feed their frontends. Correct me if I am wrong here.

There are some other technical problems, like how it is not really fair to charge by the query when you are dealing with GraphQL (not all queries are equal), or the choice of a highly volatile token as the main unit of payment, but let’s not get technical at this point.

The issue at hand is of a larger, political scale, and requires big moves before you get to the nitty gritty.

I am more in line with what @adamfuller is presenting than what you are presenting @thanpolas and I’ll try to explain why.

Adam is putting forth the idea of a faucet or community-subsidized initial amount of queries. When reading your initial post, this was my first thought as well. The devs still get their initial usage covered so that they can ramp up and develop their PoC. From there, it can either be shown to be relevant to the point of making sense to have a bit of funding put in by the dev themselves, monetized through the dapp(s) it is serving data to, a grant can be requested if it is a communal resource, or perhaps it can be shopped around to be funded by community members or other dapps.

By saying that you think DAOs of DeFi protocols should bare this cost is (to me) perhaps a bit too short sighted. What if next month NFT platforms are the real consumers of The Graph, but DeFi DAOs are paying for it to run? And then a year later another “hot” area explodes and begins to be the biggest consumer? I don’t think the DeFi DAOs would be too happy to be taking on the cost, and then any new major consumer market would have to be approached for funding, etc.
This would also make The Graph beholden to the needs/wants/pivots of those marketplaces. If DeFi protocol X wanted certain features modified because it would fit their needs better, and they are one of the main funders, then the autonomy of The Graph would be getting compromised a bit.

The Foundation and The Council have a position to steer the protocol as a whole towards serving the widest market, as well as is possible (or else fear that The Graph would not maintain its relevance and utility to devs). Once you start to have a narrower segment with outsized control, this dynamic shifts.

This was perhaps a long winded way of saying that the value of autonomy and self-funding goes very deep, and getting funding from deep pockets who “wouldn’t flinch at the costs” could put things at odds with the mission.

Note: in case my response comes off as a bit flippant, it is not meant to be at all. I fully agree with you that this issue needs to be addressed and I am really happy you brought it up!