Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UNI TWAP support for getting prices #142

Closed
shayzluf opened this issue May 8, 2022 · 1 comment
Closed

UNI TWAP support for getting prices #142

shayzluf opened this issue May 8, 2022 · 1 comment

Comments

@shayzluf
Copy link
Collaborator

shayzluf commented May 8, 2022

example query for MKR previous day token price:

https://thegraph.com/hosted-service/subgraph/uniswap/uniswap-v3

{
token(id:"0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2") {
  id
  name
  tokenDayData(skip:1,first:1) {
   priceUSD
  }
}
}

multiple tokens can be retrieved in that way

{
 tokens(  where: {
   id_in : [
 "0xc944e90c64b2c07662a292be6244bdf05cda44a7",
 "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984"
]
  }
 ) {
    id
    tokenDayData(skip:1,first:1){priceUSD
  }
  
  }
    
 }
@leviyehonatan
Copy link
Contributor

apollographql/apollo-client#84 (comment)

this technique is used

leviyehonatan added a commit that referenced this issue Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants