Skip to content

Commit 0659466

Browse files
committed
starter queries changes
1 parent 95a8493 commit 0659466

3 files changed

Lines changed: 112 additions & 15 deletions

File tree

docs/blockchain/Ethereum/balances/transaction-balance-tracker/eth-transaction-balance-tracker.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,18 +204,22 @@ This API gives you latest balance of a specific address (here in example `0xd194
204204

205205
## Latest liquidity of EVM Pool
206206

207-
This API gives you latest liquidity of EVM Pool (here in example `0x5d4F3C6fA16908609BAC31Ff148Bd002AA6b8c83` LINK/USDC Uniswap v3 pool). Try it out [here](https://ide.bitquery.io/latest-liquidity-of-a-EVM-pool).
207+
This API provides the latest liquidity information for multiple EVM pools in one API call. The example shows results for two pool addresses using a query updated to support multiple addresses. You can try 500 as well,just put them as a list in `where` clause. Try it out [here](https://ide.bitquery.io/latest-liquidity-of-multiple-pools#).
208208

209209
```graphql
210210
{
211-
EVM(network: eth) {
211+
EVM(network: base) {
212212
TransactionBalances(
213-
limit: { count: 2 }
214-
limitBy: { by: TokenBalance_Currency_SmartContract, count: 1 }
213+
limitBy: { by: TokenBalance_Address, count: 2 }
215214
orderBy: { descendingByField: "TokenBalance_PostBalanceInUSD" }
216215
where: {
217216
TokenBalance: {
218-
Address: { is: "0x5d4F3C6fA16908609BAC31Ff148Bd002AA6b8c83" }
217+
Address: {
218+
in: [
219+
"0x3f0296BF652e19bca772EC3dF08b32732F93014A"
220+
"0x22AEe3699b6A0fEd71490C103Bd4E5f3309891D5"
221+
]
222+
}
219223
}
220224
}
221225
) {
@@ -268,4 +272,4 @@ This API gives you latest Supply and Marketcap of a token on EVM (here as exampl
268272
}
269273
}
270274
}
271-
```
275+
```

docs/blockchain/Ethereum/dextrades/ethereum-liquidity-api.md

Lines changed: 98 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,104 @@ subscription MyQuery {
269269

270270
> **Important Note:** In Uniswap V4, all pools' liquidity is stored in the PoolManager contract, so the DEX smart contract address will be the same for all pairs. Use `PoolId` to differentiate between different pools. The `PoolId` field uniquely identifies each pool within the PoolManager.
271271
272+
## Top Liquidity Pools for cbBTC on Base
273+
274+
The following API query retrieves the top liquidity pools where cbBTC (`0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf`) is either token A or token B in the pool on the Base chain. This allows you to identify which pools have the most liquidity for cbBTC, filtered to exclude certain pools if necessary.
275+
276+
This query separates results by whether cbBTC is listed as the first token (`CurrencyA`) or the second token (`CurrencyB`) in the DEX pool, returning the 10 pools with the highest liquidity for each category. Exclusions (e.g., pools you want omitted from the results) are specified in the `SmartContract: {notIn: [...]}` filter.
277+
278+
To test run, visit the [IDE example](https://ide.bitquery.io/top-liquidity-pools-of-cbBTC) or modify the pool filters to target another token as needed.
279+
280+
```graphql
281+
query MyQuery {
282+
EVM(network: base) {
283+
TokenIsCurrencyA: DEXPoolEvents(
284+
limit: { count: 10 }
285+
orderBy: {
286+
descendingByField: "PoolEvent_Liquidity_AmountCurrencyA_maximum"
287+
}
288+
where: {
289+
PoolEvent: {
290+
Pool: {
291+
CurrencyA: {
292+
SmartContract: {
293+
is: "0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"
294+
}
295+
}
296+
SmartContract: {
297+
notIn: ["0x498581ff718922c3f8e6a244956af099b2652b2b"]
298+
}
299+
}
300+
}
301+
}
302+
) {
303+
PoolEvent {
304+
Liquidity {
305+
AmountCurrencyA(maximum: Block_Time)
306+
AmountCurrencyB(maximum: Block_Time)
307+
}
308+
Pool {
309+
PoolId
310+
SmartContract
311+
CurrencyA {
312+
Name
313+
Symbol
314+
SmartContract
315+
}
316+
CurrencyB {
317+
Name
318+
Symbol
319+
SmartContract
320+
}
321+
}
322+
}
323+
}
324+
325+
TokenIsCurrencyB: DEXPoolEvents(
326+
limit: { count: 10 }
327+
orderBy: {
328+
descendingByField: "PoolEvent_Liquidity_AmountCurrencyB_maximum"
329+
}
330+
where: {
331+
PoolEvent: {
332+
Pool: {
333+
CurrencyB: {
334+
SmartContract: {
335+
is: "0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"
336+
}
337+
}
338+
SmartContract: {
339+
notIn: ["0x498581ff718922c3f8e6a244956af099b2652b2b"]
340+
}
341+
}
342+
}
343+
}
344+
) {
345+
PoolEvent {
346+
Liquidity {
347+
AmountCurrencyA(maximum: Block_Time)
348+
AmountCurrencyB(maximum: Block_Time)
349+
}
350+
Pool {
351+
PoolId
352+
SmartContract
353+
CurrencyA {
354+
Name
355+
Symbol
356+
SmartContract
357+
}
358+
CurrencyB {
359+
Name
360+
Symbol
361+
SmartContract
362+
}
363+
}
364+
}
365+
}
366+
}
367+
}
368+
```
369+
272370
## Realtime Liquidity Data via Kafka Streams
273371

274372
Liquidity data can also be obtained via Kafka streams for lower latency and better reliability. The Kafka topic for Ethereum DEX pools is:
@@ -291,7 +389,6 @@ For detailed information on how to connect to Kafka streams, subscribe to topics
291389
The `DEXPoolEvents` API response contains the following information:
292390

293391
- **`PoolEvent`**: Pool event information
294-
295392
- **`Liquidity`**: Current pool reserves
296393
- `AmountCurrencyA`: Current balance of CurrencyA in the pool (in raw units)
297394
- `AmountCurrencyB`: Current balance of CurrencyB in the pool (in raw units)
@@ -307,7 +404,6 @@ The `DEXPoolEvents` API response contains the following information:
307404
- `ProtocolName`: Protocol name (e.g., Uniswap V2, Uniswap V3, Uniswap V4)
308405

309406
- **`Block`**: Block information when the liquidity event occurred
310-
311407
- `Time`: Timestamp of the block
312408
- `Number`: Block number
313409

docs/start/starter-queries.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,21 @@ Get transactions ordered by block number in descending order.
9494

9595
### Trades
9696

97-
#### Ethereum DEX Trades
97+
#### Ethereum DEXTrades latest trades for a token
9898

9999
This query returns the latest trades on the Ethereum network where distinction of the buy and sell sides is present.
100-
▶️ [Ethereum DEX Trades](https://ide.bitquery.io/Copy-of-Ethereum-dextrades_1)
100+
▶️ [Ethereum DEX Trades](https://ide.bitquery.io/Ethereum-dextrades-of-a-token)
101101

102-
#### Ethereum Dex Trade By Tokens
102+
#### Ethereum DexTradeByTokens latest trades for a token
103103

104104
This query returns the latest trades on the Ethereum network. This is useful when looking for trades of a token without worrying about the buy or sell side.
105-
▶️ [DexTrade By Tokens](https://ide.bitquery.io/Ethereum-DexTradeByTokens_1)
105+
▶️ [DexTrade By Tokens](https://ide.bitquery.io/Ethereum-DexTradeByTokens-of-a-token)
106106

107107
#### Get Swaps by Wallet Address
108108

109109
Get all swap related transactions (buy, sell).
110110
▶️ [Get Swaps by Wallet Address](https://ide.bitquery.io/latest_trades_by_maker)
111111

112-
113112
#### Ethereum DEX Trades
114113

115114
This query returns the latest trades on the Ethereum network where distinction of the buy and sell sides is present.
@@ -120,7 +119,6 @@ This query returns the latest trades on the Ethereum network where distinction o
120119
This query returns the latest trades on the Ethereum network. This is useful when looking for trades of a token without worrying about the buy or sell side.
121120
▶️ [DexTrade By Tokens](https://ide.bitquery.io/Ethereum-DexTradeByTokens)
122121

123-
124122
### Events & Calls
125123

126124
#### Get Latest Events
@@ -684,7 +682,6 @@ Get token balances for a specific wallet address.
684682
Get the net worth of a wallet in USD.
685683
▶️ [Get wallet net worth](https://ide.bitquery.io/balance-of-a-wallet-in-USD_2)
686684

687-
688685
### Token Supply
689686

690687
#### Get Total Supply and Marketcap of an BSC token

0 commit comments

Comments
 (0)