Questions tagged [thegraph]

TheGraph is a solution for accessing blockchain data from SQL via GraphQL interface implemented as, as well as an approach to generate schema and mappings from smart contracts.

TheGraph is a solution for accessing blockchain data from SQL via GraphQL interface implemented as graph_node, as well as an approach to generate schema and mappings from smart contracts.

44 questions
3
votes
3 answers

Python Uniswap Subgraph - Constant product formula

I'm trying to calculate the price impact on trades and am getting strange results. I am using uniswap v2 subgraph to get current data for WETH/USDC. def loadUni2(): query = """ { pairs ( first: 10 orderBy: volumeUSD …
cryptotheo
  • 151
  • 1
  • 7
3
votes
1 answer

What is the best way to access historical price data from Chainlink on a token in a decentralised manner?

I need to get the Chainlink prices of a token from a specific time to the most recent round. This time varies based on user input but will be relatively short windows (1 day to 2 weeks max) based on the heartbeat of the token. This is used to…
Bruce Jayasinghe
  • 173
  • 1
  • 1
  • 7
3
votes
1 answer

The Graph: No value provided for ID argument in subgraph query

I'm following The Graph documentation (https://thegraph.com/docs/quick-start#hosted-service) and creating a subgraph using the following code: graph init / When I build and then deploy I see in the Playground there…
mobiman
  • 619
  • 1
  • 11
  • 26
3
votes
0 answers

Has anyone used The Graph before? I am having trouble creating a SubGraph

I am trying to create a SubGraph using an existing contract, but I keep getting the error: Load subgraph from subgraph.yaml ✖ Failed to load subgraph from subgraph.yaml: Error in subgraph.yaml: Path: dataSources > 0 > mapping > entities No…
Chinmay Gopal
  • 59
  • 1
  • 6
3
votes
1 answer

Python GraphQL Client - Unexpected punctuator when passing variables

Code: contract="0xdAC17F958D2ee523a2206206994597C13D831ec7" query = """ ($contract: Int!) { token(id:$contract){ name symbol decimals derivedETH tradeVolumeUSD totalLiquidity } } """ variables = { "contract":…
Marcus
  • 63
  • 1
  • 3
2
votes
1 answer

Is there any major difference between thegraph subgrah and openzeppelin subgraph?

As i see, they need similar scheme and manifest to create graphqlients, graph clients is also looks similar. They both can be deployed on thegraph and to the nodes. There are not so much info about openzeppelin subgraph, and i cant find any…
2
votes
2 answers

GraphQL filtering the nested objects

I want to get some info about some Uniswap transactions using The Graph but I don't know how to go about filtering. I want to get only Swaps that one of their tokens is ether. That means that the symbol of the token is "ETH". Is there a way to do…
damavrom
  • 325
  • 2
  • 9
2
votes
1 answer

How can I deploy this repo(uniswap v3 subgraph) on my own subgraph?(The Graph) #104

I just try to deploy uniswap v3 subgraph in The Graph. (hosted service) I clone this repo and ran this steps yarn npm run codegen npm run build graph auth --product hosted-service npm run deploy when 5 I got Build completed: ~~~ ✖…
mingo
  • 21
  • 1
2
votes
2 answers

Filtering nested properties in subgraph (the graph)

Is it possible to filter subgraph using "where" when properties are nested? For example if we have query like this one, can we filter it by application name? { challenges(where: {something?}) { challenger outcome application { …
marija
  • 53
  • 6
2
votes
1 answer

TheGraph Uniswap Subgraph returning strange values for Volume and Liquidity

I'm using the python graphql client lib to pull some basic token data from Uniswap. Docs here: https://thegraph.com/explorer/subgraph/uniswap/uniswap-v2?query=Example%20query My query: query = """ query($contract: String!) { token(id:$contract)…
Marcus
  • 63
  • 1
  • 3
1
vote
1 answer

Handling exception for invalid json format for `assemblyscript-json` in `JSON.parse`

The following works: let jsonObj: JSON.Obj = (JSON.parse('{"hello": "world", "value": 24}')); but if jsonString has an invalid json format, it breaks my subgraph. Using: "@graphprotocol/graph-cli": "0.35.0", "@graphprotocol/graph-ts":…
Sami
  • 45
  • 4
1
vote
1 answer

Showing subgraph timestamp results in human-readable format

My subgraph as a UNIX timestamp as seconds defined as the following type TokenSwap @entity { id: ID! # UNIX timestamp of block in which the swap was created timestamp: BigInt! } When I am experimenting in TheGraph playground, is there a way…
Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435
1
vote
1 answer

Type script array push doesn't do anything

I'd like to lead off with, this isn't the async issues that other people have posted about where their pushes aren't doing anything. Here is my code function createHolderPosition(holder: Holder, position: Position): void { if(holder.positions ==…
Steve
  • 4,457
  • 12
  • 48
  • 89
1
vote
2 answers

graph-cli installs but is not getting read

I am installing @graphprotocol/graph-cli with yarn with the command yarn global add @graphprotocol/graph-cli I get the success message saying: success Installed "@graphprotocol/graph-cli@0.31.0" with binaries: - graph But when I try to check its…
DevArcane
  • 21
  • 2
1
vote
1 answer

Near balances dashboard

I just want to get dashboard with amount of users balances from 0 to 100N and from 100N to 1000N. I’m sitting on macOS High Sierra and my laptop is old, so I cannot to build whole part of indexer I’m little bit confused, cause I don’t need to build…
1
2 3