The Graph Academy
Master The GraphBug BountyExplorer
  • Welcome to The Graph Hub
  • FAQs
  • Official Docs
    • Get Started
    • About The Graph
      • Introduction
      • Network Overview
    • Developer
      • Mastering Subgraphs
      • Quick Start
      • Define a Subgraph
      • Create a Subgraph
      • Publish a Subgraph to the Decentralized Network
      • Query The Graph
      • Querying from an Application
      • Distributed Systems
      • AssemblyScript API
      • AssemblyScript Migration Guide
      • GraphQL API
      • Unit Testing Framework
      • Quick and easy subgraph debugging using forks
      • Deprecating a Subgraph
    • Indexer
      • What are Indexers?
      • Revenue Streams
      • Reward Distribution
      • Allocation Lifecycles
      • Indexing & Querying
      • Hardware requirements
      • IPFS hash converter
      • Vulnerabilities
      • Indexer Subgraph Selection Guide
      • Testnet
        • Graph Protocol Testnet Docker Compose
        • Graph Protocol Testnet Baremetal
          • Architecture Considerations
          • Deploy and Configure Database
          • Deploy and Configure Graph-node
          • Deploy and Configure Indexer stack
      • Monitoring
        • Ethereum Node Chainhead Monitoring - no third parties
      • Best Practices
        • Failed subgraphs - Manually Closing Allocations
    • Delegator
      • Choosing Indexers
        • Network Page
        • Tools
        • Guides
      • Reward Statuses
    • Curator
    • Subgraph Studio
      • How to Use the Subgraph Studio
      • Deploy a Subgraph to the Subgraph Studio
      • Billing on the Subgraph Studio
      • Managing your API keys
      • Subgraph Studio FAQs
      • Transferring Subgraph Ownership
    • The Graph Explorer
    • Supported Networks
      • Building Subgraphs on NEAR
      • Building Subgraphs on Cosmos
      • Building Subgraphs on Arweave
  • The Graph Ecosystem
    • Network
      • Core Developer Teams
        • Edge & Node
        • Streamingfast
        • Figment
        • Semiotic
        • The Guild
        • GraphOps
      • The Graph Foundation
      • The Graph Council
      • Graph Advocates
      • Graph Advocates DAO
    • Infrastructure
      • Mainnet
      • Testnet
      • Network Migration
      • Multichain Migration
      • Firehose
      • Substreams
      • The Graph Client
Powered by GitBook
On this page

Was this helpful?

  1. Official Docs
  2. Subgraph Studio

Billing on the Subgraph Studio

PreviousDeploy a Subgraph to the Subgraph StudioNextManaging your API keys

Last updated 2 years ago

Was this helpful?

Overview

Invoices are statements of payment amounts owed by a customer and are typically generated on a weekly basis in the system. You’ll be required to pay fees based on the query fees you generate using your API keys. The billing contract lives on the network. It’ll allow you to:

  • Add and remove GRT

  • Keep track of your balances based on how much GRT you have added to your account, how much you have removed, and your invoices

  • Automatically clear payments based on query fees generated

In order to add GRT to your account, you will need to go through the following steps:

  1. Purchase GRT and ETH on an exchange of your choice

  2. Send the GRT and ETH to your wallet

  3. Bridge GRT to Polygon using the UI

    a) You will receive 0.001 Matic in a few minutes after you send any amount of GRT to the Polygon bridge. You can track the transaction on by inputting your address into the search bar.

  4. Add bridged GRT to the billing contract on Polygon. The billing contract address is: .

    a) In order to complete step #4, you'll need to switch your network in your wallet to Polygon. You can add Polygon's network by connecting your wallet and clicking on "Choose Matic (Polygon) Mainnet" Once you've added the network, switch it over in your wallet by navigating to the network pill on the top right-hand side corner. In Metamask, the network is called Matic Mainnnet.

At the end of each week, if you used your API keys, you will receive an invoice based on the query fees you have generated during this period. This invoice will be paid using GRT available in your balance. Query volume is evaluated by the API keys you own. Your balance will be updated after fees are withdrawn.

Here’s how you go through the invoicing process:

There are 4 states your invoice can be in:

  1. Created - your invoice has just been created and not been paid yet

  2. Paid - your invoice has been successfully paid

  3. Unpaid - there is not enough GRT in your balance on the billing contract

  4. Error - there is an error processing the payment

See the diagram below for more information:

For a quick demo of how billing works on the Subgraph Studio, check out the video below:

Multisig Users

Multisigs are smart contracts that can exist only on the network they have been created, so if you created one on Ethereum Mainnet - it will only exist on Mainnet. Since our billing uses Polygon, if you were to bridge GRT to the multisig address on Polygon the funds would be lost.

This tool will guide you to go through the following steps:

  1. Connect your standard wallet / EOA (this wallet needs to own some ETH as well as the GRT you want to deposit)

  2. Bridge GRT to Polygon. You will have to wait 7-8 minutes after the transaction is complete for the bridge transfer to be finalized.

  3. Once your GRT is available on your Polygon balance you can deposit them to the billing contract while specifying the multisig address you are funding in the Multisig Address field.

Those queries will generate invoices that will be paid automatically using the multisig’s billing balance.

Billing Flow

To overcome this issue, we created that will help you deposit GRT on our billing contract (on behalf of the multisig) with a standard wallet / EOA (an account controlled by a private key).

You can access our Multisig Billing Tool here:

Once the deposit transaction has been confirmed you can go back to and connect with your Gnosis Safe Multisig to create API keys and use them to generate queries.

Polygon
Polygonscan
0x10829DB618E6F520Fa3A01c75bC6dDf8722fA9fE
here.
a dedicated tool
https://multisig-billing.thegraph.com/
Subgraph Studio