Latest price
Returns the latest DEX trade on Ethereum: timestamp time, block height, trade index, protocol, full name, buy amount, buy currency symbol and 7 more fields.
What it returns
- timestamp time
- block height
- trade index
- protocol
- full name
- buy amount
- buy currency symbol
- buy currency address
- buy currency name
- sell amount
- sell currency symbol
- sell currency address
- sell currency name
- expression
The query
query ($network: EthereumNetwork!, $sellCurrency: String!, $buyCurrency: String!) {
ethereum(network: $network) {
dexTrades(
options: {desc: ["block.height", "tradeIndex"], limit: 1}
sellCurrency: {is: $sellCurrency}
buyCurrency: {is: $buyCurrency}
) {
block {
timestamp {
time(format: "%Y-%m-%d %H:%M:%S")
}
height
}
tradeIndex
protocol
exchange {
fullName
}
buyAmount
buyCurrency {
symbol
address
name
}
buy_amount_usd: buyAmount(in: USD)
sellAmount
sellCurrency {
symbol
address
name
}
sell_amount_usd: sellAmount(in: USD)
priceInUSD: expression(get: "sell_amount_usd / buyAmount")
}
}
}
Variables
{"limit": 10, : "$buyCurrency": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "$sellCurrency": "0x97f85616fe30618fa2f44d0e6b2fffd31932a3be",
"network": "ethereum",
"dateFormat": "%Y-%m-%d"}
Similar queries
- Latest Curve DEX swaps on Ethereum · Ethereum · DEXTrades
- Top Curve liquidity pools by 24h volume on Ethereum · Ethereum · DEXTrades
- STRN_TOKEN_MULTIPLE_DECIMALS_DEX_TRADES · Ethereum · DEXTrades
- USDT DECIMAL SHOWING 0 · Ethereum · DEXTrades
- Trades - 0xEE61159E8A72A08371c52D62c19Efd0C7914f917 · Ethereum · DEXTrades