V3 Technical Docs
  • Deployed Contracts
    • Notional V3
      • Ethereum Mainnet
      • Arbitrum
  • Security
    • Audits
    • Bug Bounty
  • Currency Ids & Precision
    • Currency Ids
    • Market Indexes
    • Notional Internal Precision
  • Contract interaction guides
    • Intro
    • Trading guide
      • Deposit (Prime Lend)
      • Trade fCash (Borrow & Lend Fixed)
      • Add liquidity (Mint nTokens)
      • Withdraw liquidity (Redeem nTokens)
      • Withdraw (Prime Cash)
      • Settle Account
      • Enter Leveraged Vaults
      • Exit Leveraged Vaults
    • Accounts
    • Prime Cash Markets
    • fCash Markets
    • nTokens
    • Leveraged Vaults
    • Oracles
    • Governance parameters
  • Subgraph guides
    • Notional V3 Subgraphs
      • Fetch Notional Accounts
      • Fetch Notional's reserves
      • Fetch Notional nToken accounts
      • Fetch Historical Trades
      • Fetch an Account's P&L
      • Fetch current fCash and Prime Cash Rates
      • Fetch Historical Prime Cash & Prime Debt Exchange Rates
      • Fetch Prime Cash Market Balances
      • Fetch fCash Market Balances
      • Fetch Outstanding Debt
      • Fetch Historical nToken Exchange Rates
      • Fetch ETH Oracle Exchange Rates
      • Fetch Annual Incentive Rates
      • Fetch Interest Rate Models
      • Fetch Governance Parameters
  • Dune Dashboard
  • Notional Risk Docs
  • Notional V3 Docs
  • Notional Blog
Powered by GitBook
On this page
  • The Graph & subgraphs
  • GraphQL
  • Notional Subgraphs
  • Query Notional’s subgraph with python
  1. Subgraph guides

Notional V3 Subgraphs

PreviousGovernance parametersNextFetch Notional Accounts

Last updated 5 months ago

The Graph & subgraphs

The Graph is a decentralized protocol for indexing and querying data from blockchains. Anyone can build and publish open APIs, called subgraphs, making data easily accessible in a decentralized and reliable way. Subgraphs make it possible for anyone to query data that would otherwise be difficult to query on-chain directly. Each subgraph pays attention to events of a project’s contracts and maps that event data to data that The Graph stores in its database. Learn more about The Graph .

GraphQL

GraphQL is the underlying query language utilized in The Graph. GraphQL is especially useful for calls requiring lots of information where instead of making multiple API calls one only needs to do one subgraph call to get all of the information needed. Learn more about GraphQL .

Notional Subgraphs

Version
Network
Subgraph Endpoint

Notional V3

Mainnet

Notional V3

Arbitrum

Query Notional’s subgraph with python

To run subgraph queries through python one can use the following script and modify the url to the appropriate endpoint and modify the GQL query:

from gql import gql, Client from gql.transport.requests 
import RequestsHTTPTransport

#Connect with theGraph
sample_transport = RequestsHTTPTransport( url="https://api.studio.thegraph.com/proxy/33671/notional-finance-v3-arbitrum/v0.0.135/", # change to the appropriate endpoint 
verify=True, retries=10, ) client = Client( transport=sample_transport )

#Update the GQL query
query = gql('''
{
  accounts(first: 1000, where:{ systemAccountType: None}) {
    id
  }
}
''')

response = client.execute(query) 

We will go over a few example queries to explore Notional's V3 subgraph.

here
here
Link
Link