What are the units for amount 0 and 1? I thought I was querying the pairs address of USDC/ETH but I cant make out the results units. If usdc/eth the values are way too high for what is currently locked.
query MyQuery {
ethereum {
smartContractEvents(
smartContractAddress: {is: “0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc”}
smartContractEvent: {is: “Mint”}
options: {limit: 10, desc: “block.height”}
) {
block {
height
}
arguments {
value
argument
}
smartContract {
currency {
symbol
}
}
}
}
}
gaurav
November 19, 2021, 6:45am
2
What are you trying to do?
To look at values minted on the address 0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc then values burn to try and piece together pool liquidity over time. New query used but still dont understant the amounts.
Query
query MyQuery {
ethereum {
smartContractEvents(
smartContractAddress: {is: “0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc”}
smartContractEvent: {is: “Mint”}
options: {limit: 10, desc: “block.height”}
) {
block {
height
}
arguments {
value
argument
}
smartContract {
currency {
symbol
}
}
}
}
}
Results
{
“ethereum”: {
“smartContractEvents”: [
{
“block”: {
“height”: 13644939
},
“arguments”: [
{
“value”: “0x7a250d5630b4cf539739df2c5dacb4c659f2488d”,
“argument”: “sender”
},
{
“value”: “207809183688”,
“argument”: “amount0”
},
{
“value”: “50000000000000000000”,
“argument”: “amount1”
}
],
“smartContract”: {
“currency”: {
“symbol”: “UNI-V2”
}
}
},
aman
November 22, 2021, 6:51am
4
Could you simplify your objective and what are you trying to do
gaurav
November 22, 2021, 10:08am
5
Try a query like this
You can get it through the Mint event
For example check following example which get USDT-WETH pairs mint event data
{
ethereum(network: ethereum) {
arguments(
options: {desc: ["block.height","index"], limit: 10}
smartContractAddress: {in: "0x0d4a11d5EEaaC28EC3F61d100daF4d40471f1852", }
smartContractEvent: {is: "Mint"}
) {
block {
height
}
index
sender: any(of: argument_value, argument: {is: "sender"})
amount0: any(of: argument_v…
Here amount0 and amount1 represent the currencies in the pair.
So if it’s USDT-WETH pair, then amount0 might be USDT and amount1 is WETH and vice versa.
1 Like
Thanks. I did this for 0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc and it only gave the amount of ether provided to the pool. Is it possible to also get the amount of USDC provided?
This does this. Thank you for the help. Posted for anyone else
query MyQuery {
ethereum {
smartContractEvents(
smartContractAddress: {is: “0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc”}
smartContractEvent: {is: “Mint”}
options: {limit: 10, desc: “block.height”}
) {
block {
height
}
arguments {
value
argument
}
smartContract {
currency {
symbol
}
}
}
}
}
Thank you for everybody that tried and helps for us…Thanks&Regards.