traderclaw-v1 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +296 -0
- package/bin/openclaw-trader.mjs +897 -0
- package/dist/chunk-3UQIQJPQ.js +144 -0
- package/dist/chunk-45WQGKBZ.js +369 -0
- package/dist/chunk-GHV6TKIC.js +217 -0
- package/dist/chunk-OIWH6XY6.js +64 -0
- package/dist/index.js +927 -0
- package/dist/src/alpha-buffer.js +6 -0
- package/dist/src/alpha-ws.js +6 -0
- package/dist/src/http-client.js +6 -0
- package/dist/src/session-manager.js +6 -0
- package/openclaw.plugin.json +97 -0
- package/package.json +57 -0
- package/skills/social-intel/SKILL.md +305 -0
- package/skills/solana-trader/SKILL.md +1652 -0
- package/skills/solana-trader/bitquery-schema.md +303 -0
- package/skills/solana-trader/query-catalog.md +184 -0
- package/skills/solana-trader/websocket-streaming.md +265 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
# Bitquery v2 EAP GraphQL Schema Reference
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
This is the Bitquery v2 EAP (Early Access Program) GraphQL schema reference for Solana. Use this before writing any custom raw GraphQL query via `solana_bitquery_query`.
|
|
6
|
+
|
|
7
|
+
**Endpoint:** `https://streaming.bitquery.io/graphql` (HTTP and WebSocket)
|
|
8
|
+
**Auth header:** `Authorization: Bearer <BITQUERY_API_KEY>`
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## The Two Trade Cubes
|
|
13
|
+
|
|
14
|
+
Bitquery v2 has two Solana trade cubes with **fundamentally different `Trade` shapes**. Mixing them up causes `Cannot query field "X" on type "Solana_DEXTrade_Fields_Trade"` errors.
|
|
15
|
+
|
|
16
|
+
### `DEXTrades` — buy/sell pair per transaction
|
|
17
|
+
|
|
18
|
+
The `Trade` object exposes **nested** Buy and Sell sub-objects. There is **no** direct `Trade.Currency`, `Trade.Side`, `Trade.PriceInUSD`, `Trade.AmountInUSD`, or `Trade.Buyer`.
|
|
19
|
+
|
|
20
|
+
```graphql
|
|
21
|
+
DEXTrades(...) {
|
|
22
|
+
Block { Time }
|
|
23
|
+
Transaction { Signature Signer }
|
|
24
|
+
Trade {
|
|
25
|
+
Buy {
|
|
26
|
+
Currency { MintAddress Symbol Name Decimals }
|
|
27
|
+
Account { Address }
|
|
28
|
+
Amount
|
|
29
|
+
Price
|
|
30
|
+
PriceInUSD
|
|
31
|
+
}
|
|
32
|
+
Sell {
|
|
33
|
+
Currency { MintAddress Symbol Name Decimals }
|
|
34
|
+
Account { Address }
|
|
35
|
+
Amount
|
|
36
|
+
Price
|
|
37
|
+
PriceInUSD
|
|
38
|
+
}
|
|
39
|
+
Dex { ProtocolName ProtocolFamily }
|
|
40
|
+
Market { MarketAddress }
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**WHERE filters in DEXTrades:**
|
|
46
|
+
- Filter by Dex: `Trade: { Dex: { ProtocolName: { includes: "pump" } } }`
|
|
47
|
+
- Filter by token (buy side): `Trade: { Buy: { Currency: { MintAddress: { is: $token } } } }`
|
|
48
|
+
- Filter by signer: `Transaction: { Signer: { is: $wallet } }`
|
|
49
|
+
- `Trade: { Currency: { MintAddress: ... } }` — **INVALID on DEXTrades**
|
|
50
|
+
- `Trade: { Buyer: { is: $wallet } }` — **INVALID on DEXTrades**
|
|
51
|
+
|
|
52
|
+
**Aggregate keys for DEXTrades:**
|
|
53
|
+
- `sum(of: Trade_Buy_AmountInUSD)` — buy-side USD volume
|
|
54
|
+
- `sum(of: Trade_Sell_AmountInUSD)` — sell-side USD volume
|
|
55
|
+
- `count` — trade count
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
### `DEXTradeByTokens` — one row per token per trade
|
|
60
|
+
|
|
61
|
+
The `Trade` object exposes fields **directly** (Currency, Side, PriceInUSD, AmountInUSD). This is the correct cube for per-token analysis (price streams, volume, top traders, OHLC).
|
|
62
|
+
|
|
63
|
+
```graphql
|
|
64
|
+
DEXTradeByTokens(...) {
|
|
65
|
+
Block { Time }
|
|
66
|
+
Trade {
|
|
67
|
+
Currency { MintAddress Symbol Name Decimals }
|
|
68
|
+
Side { Type Currency { MintAddress Symbol } }
|
|
69
|
+
Price
|
|
70
|
+
PriceInUSD
|
|
71
|
+
Amount
|
|
72
|
+
AmountInUSD
|
|
73
|
+
Account { Owner }
|
|
74
|
+
Dex { ProtocolName ProtocolFamily }
|
|
75
|
+
}
|
|
76
|
+
volumeUsd: sum(of: Trade_Side_AmountInUSD)
|
|
77
|
+
makers: count(distinct: Transaction_Signer)
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**WHERE filters in DEXTradeByTokens:**
|
|
82
|
+
- Filter by token: `Trade: { Currency: { MintAddress: { is: $token } } }`
|
|
83
|
+
- Filter by side: `Trade: { Side: { Type: { is: buy } } }`
|
|
84
|
+
- Filter by Dex: `Trade: { Dex: { ProtocolName: { includes: "pump" } } }`
|
|
85
|
+
|
|
86
|
+
**Aggregate keys for DEXTradeByTokens:**
|
|
87
|
+
- `sum(of: Trade_Side_AmountInUSD)` — total USD volume (NOT `Trade_AmountInUSD`)
|
|
88
|
+
- `sum(of: Trade_Amount)` — native token amount
|
|
89
|
+
- `count(distinct: Transaction_Signer)` — unique traders (NOT `Trade_Buyer`)
|
|
90
|
+
- `count(distinct: Transaction_Signer, if: {Trade: {Side: {Type: {is: buy}}}})` — unique buyers
|
|
91
|
+
- `groupBy` is NOT supported; use time-bounded aggregate windows instead
|
|
92
|
+
- If `groupBy` is removed, also remove unused variables (e.g. `$intervalSeconds`) from the operation signature
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Decision Guide: Which Cube to Use?
|
|
97
|
+
|
|
98
|
+
| Use case | Cube |
|
|
99
|
+
|---|---|
|
|
100
|
+
| Real-time trades for all tokens on a DEX (no token filter) | `DEXTrades` with Buy/Sell fields |
|
|
101
|
+
| Per-token price stream, OHLC, volume | `DEXTradeByTokens` |
|
|
102
|
+
| Per-token latest trades | `DEXTradeByTokens` |
|
|
103
|
+
| Per-token detailed stats (buys/sells/makers) | `DEXTradeByTokens` |
|
|
104
|
+
| Top traders for a token | `DEXTradeByTokens` |
|
|
105
|
+
| First N buyers of a token (ascending time) | `DEXTrades` with `Buy.Currency` filter |
|
|
106
|
+
| Trades by a specific wallet | `DEXTrades` with `Transaction.Signer` filter |
|
|
107
|
+
| Last trade before migration (graduation check) | `DEXTrades` with `Buy.Currency` + `Dex` filter |
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## BalanceUpdates — Correct Patterns
|
|
112
|
+
|
|
113
|
+
`BalanceUpdate.Address` does **not** exist in v2. Use nested account paths.
|
|
114
|
+
|
|
115
|
+
**For SPL token balances (most use cases):**
|
|
116
|
+
```graphql
|
|
117
|
+
BalanceUpdates(
|
|
118
|
+
where: {
|
|
119
|
+
BalanceUpdate: {
|
|
120
|
+
Account: { Token: { Owner: { is: $wallet } } }
|
|
121
|
+
Currency: { MintAddress: { is: $token } }
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
limitBy: { by: BalanceUpdate_Account_Token_Owner, count: 1 }
|
|
125
|
+
) {
|
|
126
|
+
BalanceUpdate {
|
|
127
|
+
Account { Token { Owner } }
|
|
128
|
+
balance: PostBalance(maximum: Block_Slot)
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**For SOL native balance:**
|
|
134
|
+
```graphql
|
|
135
|
+
BalanceUpdates(
|
|
136
|
+
where: {
|
|
137
|
+
BalanceUpdate: {
|
|
138
|
+
Account: { Owner: { is: $wallet } }
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
) {
|
|
142
|
+
BalanceUpdate {
|
|
143
|
+
Account { Owner }
|
|
144
|
+
balance: PostBalance(maximum: Block_Slot)
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**Key points:**
|
|
150
|
+
- `PostBalance` requires aggregation modifier: `PostBalance(maximum: Block_Slot)` to get the latest balance
|
|
151
|
+
- `limitBy` key: use `BalanceUpdate_Account_Token_Owner` (not `BalanceUpdate_Address`)
|
|
152
|
+
- WHERE path: `BalanceUpdate: { Account: { Token: { Owner: { is: $wallet } } } }`
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## TokenSupplyUpdates — Currency Metadata Fields
|
|
157
|
+
|
|
158
|
+
In `TokenSupplyUpdates`, the currency metadata field is `Uri` (camel-case), not `URI`.
|
|
159
|
+
|
|
160
|
+
```graphql
|
|
161
|
+
TokenSupplyUpdates(
|
|
162
|
+
where: {
|
|
163
|
+
TokenSupplyUpdate: { Currency: { MintAddress: { is: $token } } }
|
|
164
|
+
}
|
|
165
|
+
orderBy: { descending: Block_Time }
|
|
166
|
+
limit: { count: 1 }
|
|
167
|
+
) {
|
|
168
|
+
TokenSupplyUpdate {
|
|
169
|
+
Currency { Name Symbol MintAddress Decimals Uri }
|
|
170
|
+
PostBalance
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Common Schema Errors and Fix Map
|
|
178
|
+
|
|
179
|
+
| Error message | Root cause | Fix |
|
|
180
|
+
|---|---|---|
|
|
181
|
+
| `Cannot query field "Currency" on type "Solana_DEXTrade_Fields_Trade"` | Using `Trade.Currency` on `DEXTrades` | Use `Trade.Buy.Currency` / `Trade.Sell.Currency` |
|
|
182
|
+
| `Cannot query field "Side" on type "Solana_DEXTrade_Fields_Trade"` | Using `Trade.Side` on `DEXTrades` | Switch to `DEXTradeByTokens` or use `Trade.Buy`/`Trade.Sell` |
|
|
183
|
+
| `Cannot query field "PriceInUSD" on type "Solana_DEXTrade_Fields_Trade"` | Using `Trade.PriceInUSD` on `DEXTrades` | Use `Trade.Buy.PriceInUSD` or `Trade.Sell.PriceInUSD` |
|
|
184
|
+
| `Cannot query field "AmountInUSD" on type "Solana_DEXTrade_Fields_Trade"` | Using `Trade.AmountInUSD` on `DEXTrades` | Use `Trade.Buy.Amount` or switch to `DEXTradeByTokens` |
|
|
185
|
+
| `Cannot query field "Buyer" on type "Solana_DEXTrade_Fields_Trade"` | Using `Trade.Buyer` on `DEXTrades` | Use `Trade.Buy.Account.Address` for output; `Transaction.Signer` for WHERE |
|
|
186
|
+
| `Cannot query field "Address" on type "Solana_BalanceUpdate"` | Using `BalanceUpdate.Address` | Use `BalanceUpdate.Account.Token.Owner` (SPL) or `BalanceUpdate.Account.Owner` (SOL) |
|
|
187
|
+
| `Cannot query field "URI"` | Using uppercase `URI` in `TokenSupplyUpdate.Currency` | Use `Uri` |
|
|
188
|
+
| `Unknown field` in `Instruction.Accounts.Address` | Using direct `Accounts.Address` in `Instructions.where` | Use `Accounts: { includes: { Address: { is: $token } } }` |
|
|
189
|
+
| `Unknown argument "groupBy"` on `DEXTradeByTokens` | Attempting interval grouping | Remove `groupBy`; use aggregate windows over `Block.Time` ranges |
|
|
190
|
+
| `Variable "$intervalSeconds" is never used` | Leftover variable after removing groupBy | Remove from query args and `variableShape` |
|
|
191
|
+
| `Unexpected metric name or alias to order balance` | Ordering by non-existent alias | Order by concrete metric name (e.g. `BalanceUpdate_balance_maximum`) |
|
|
192
|
+
| `Variable "$minCap" of type "Float!"` type mismatch | Comparator input type mismatch | Use `String` vars for `PostBalanceInUSD` filters |
|
|
193
|
+
| `This operation was aborted` | Query exceeded timeout | Increase `options.timeoutMs` (e.g. 120000) and/or reduce scan window/limit |
|
|
194
|
+
| `Field "Trade_Buyer" not found` | Aggregate `count(distinct: Trade_Buyer)` | Use `count(distinct: Transaction_Signer)` |
|
|
195
|
+
| `Field "Trade_AmountInUSD" not found` (DEXTradeByTokens) | Wrong aggregate key | Use `Trade_Side_AmountInUSD` |
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## DEXPools — When to Use
|
|
200
|
+
|
|
201
|
+
`DEXPools` is the correct cube for:
|
|
202
|
+
- New pool creation events
|
|
203
|
+
- Liquidity changes and LP snapshots
|
|
204
|
+
- Bonding curve progress (Pump.fun graduation threshold)
|
|
205
|
+
- Market pair addresses
|
|
206
|
+
- Replacing heavy `Instructions` scans that frequently abort/time out
|
|
207
|
+
|
|
208
|
+
```graphql
|
|
209
|
+
DEXPools(
|
|
210
|
+
where: {
|
|
211
|
+
Pool: {
|
|
212
|
+
Dex: { ProtocolName: { includes: "pumpswap" } }
|
|
213
|
+
Market: { BaseCurrency: { MintAddress: { is: $token } } }
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
) {
|
|
217
|
+
Block { Time }
|
|
218
|
+
Pool {
|
|
219
|
+
Dex { ProtocolName }
|
|
220
|
+
Market { MarketAddress BaseCurrency { MintAddress Symbol } QuoteCurrency { MintAddress Symbol } }
|
|
221
|
+
Base { PostAmountInUSD ChangeAmountInUSD }
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Instructions Cube — Account Filters
|
|
229
|
+
|
|
230
|
+
For `Solana.Instructions`, account matching in `where.Instruction.Accounts` must use `includes`, not direct `Address` equality.
|
|
231
|
+
|
|
232
|
+
```graphql
|
|
233
|
+
Instructions(
|
|
234
|
+
where: {
|
|
235
|
+
Instruction: {
|
|
236
|
+
Program: { Name: { includes: "pump" } }
|
|
237
|
+
Accounts: { includes: { Address: { is: $token } } }
|
|
238
|
+
}
|
|
239
|
+
Transaction: { Result: { Success: true } }
|
|
240
|
+
}
|
|
241
|
+
) {
|
|
242
|
+
Block { Time }
|
|
243
|
+
Transaction { Signer Signature }
|
|
244
|
+
Instruction { Program { Method } Accounts { Address } }
|
|
245
|
+
}
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Avoid:
|
|
249
|
+
- `Accounts: { Address: { is: $token } }` (invalid shape)
|
|
250
|
+
- Duplicate keys in one input object — combine into one: `Program: { Name: ..., Method: ... }`
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## Pump.fun Specifics
|
|
255
|
+
|
|
256
|
+
- **Program address:** `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P`
|
|
257
|
+
- **DEX filter:** `Trade: { Dex: { ProtocolName: { includes: "pump" } } }`
|
|
258
|
+
- **PumpSwap filter:** `Trade: { Dex: { ProtocolName: { includes: "pumpswap" } } }`
|
|
259
|
+
- **Migration detection:** `Instructions` cube with `Program: { Method: { includes: "migrate" } }`
|
|
260
|
+
- **Bonding curve progress:** Requires `DEXPools` with `Base.PostAmountInUSD`
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## Subscriptions
|
|
265
|
+
|
|
266
|
+
Subscriptions use the same schema rules as queries. `DEXTrades` subscriptions must use `Trade.Buy`/`Trade.Sell` pattern:
|
|
267
|
+
|
|
268
|
+
```graphql
|
|
269
|
+
subscription PumpFunTrades($token: String) {
|
|
270
|
+
Solana {
|
|
271
|
+
DEXTrades(
|
|
272
|
+
where: {
|
|
273
|
+
Trade: {
|
|
274
|
+
Dex: { ProtocolName: { includes: "pump" } }
|
|
275
|
+
Buy: { Currency: { MintAddress: { is: $token } } }
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
) {
|
|
279
|
+
Block { Time }
|
|
280
|
+
Transaction { Signature }
|
|
281
|
+
Trade {
|
|
282
|
+
Buy { Currency { MintAddress Symbol } PriceInUSD }
|
|
283
|
+
Sell { Currency { MintAddress Symbol } PriceInUSD }
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
For price/OHLC subscriptions, the `Trading.Tokens` cube provides a simpler interface:
|
|
291
|
+
|
|
292
|
+
```graphql
|
|
293
|
+
subscription RealtimeTokenPrices($token: String!) {
|
|
294
|
+
Trading {
|
|
295
|
+
Tokens(where: { Token: { Network: { is: "Solana" }, Address: { is: $token } } }) {
|
|
296
|
+
Block { Time }
|
|
297
|
+
Token { Address Symbol }
|
|
298
|
+
Price { Value Usd }
|
|
299
|
+
Volume { Base Quote Usd }
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
```
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# Bitquery Query Catalog Reference
|
|
2
|
+
|
|
3
|
+
This document lists all available template paths for use with `solana_bitquery_catalog`. Use `solana_bitquery_templates` to get this list programmatically.
|
|
4
|
+
|
|
5
|
+
Template paths follow the format: `category.key`
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Category: pumpFunCreation
|
|
10
|
+
|
|
11
|
+
| Template Path | Description | Variables |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| `pumpFunCreation.trackNewTokens` | Track newly created Pump.fun tokens | `since: DateTime!, limit: Int!` |
|
|
14
|
+
| `pumpFunCreation.getCreationTimeAndDev` | Get creation time and dev address for token | `token: String!` |
|
|
15
|
+
| `pumpFunCreation.trackLaunchesRealtime` | Track new token launches in real-time via query polling | `since: DateTime!, limit: Int!` |
|
|
16
|
+
| `pumpFunCreation.getTokensByCreatorAddress` | Get all Pump.fun tokens created by creator wallet | `creator: String!, limit: Int!` |
|
|
17
|
+
| `pumpFunCreation.getTokensByCreatorHistorical` | Historical token creations by wallet | `creator: String!, since: DateTime!, till: DateTime!` |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Category: pumpFunMetadata
|
|
22
|
+
|
|
23
|
+
| Template Path | Description | Variables |
|
|
24
|
+
|---|---|---|
|
|
25
|
+
| `pumpFunMetadata.tokenMetadataByAddress` | Get token metadata plus dev and creation time | `token: String!` |
|
|
26
|
+
| `pumpFunMetadata.trackMayhemModeRealtime` | Track Mayhem Mode enabled tokens in real-time | `since: DateTime!, limit: Int!` |
|
|
27
|
+
| `pumpFunMetadata.currentMayhemModeStatus` | Check current Mayhem mode status for token | `token: String!` |
|
|
28
|
+
| `pumpFunMetadata.historicalMayhemModeStatus` | Historical mayhem mode changes for token | `token: String!, since: DateTime!, till: DateTime!` |
|
|
29
|
+
| `pumpFunMetadata.latestPrice` | Latest price for Pump.fun token | `token: String!` |
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Category: pumpFunPriceMomentum
|
|
34
|
+
|
|
35
|
+
| Template Path | Description | Variables |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| `pumpFunPriceMomentum.streamTokenPrice` | Price stream query for polling mode | `token: String!, since: DateTime!` |
|
|
38
|
+
| `pumpFunPriceMomentum.top10PriceChange5m` | Top 10 by short-term price change | `since: DateTime!` |
|
|
39
|
+
| `pumpFunPriceMomentum.tokenOHLC` | OHLC data for Pump.fun token | `token: String!, since: DateTime!` |
|
|
40
|
+
| `pumpFunPriceMomentum.athMarketCapWindow` | ATH market cap in window | `token: String!, since: DateTime!, till: DateTime!` |
|
|
41
|
+
| `pumpFunPriceMomentum.priceChangeDeltaFromMinutesAgo` | Price-change delta from X minutes back | `token: String!, since: DateTime!` |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Category: pumpFunTradesLiquidity
|
|
46
|
+
|
|
47
|
+
| Template Path | Description | Variables |
|
|
48
|
+
|---|---|---|
|
|
49
|
+
| `pumpFunTradesLiquidity.realtimeTrades` | Get real-time trades on Pump.fun | `since: DateTime!, limit: Int!` |
|
|
50
|
+
| `pumpFunTradesLiquidity.latestTradesByToken` | Latest trades by token | `token: String!, limit: Int!` |
|
|
51
|
+
| `pumpFunTradesLiquidity.tradingVolume` | Get trading volume for token | `token: String!, since: DateTime!` |
|
|
52
|
+
| `pumpFunTradesLiquidity.detailedTradeStats` | Detailed trade stats (volume/buys/sells/makers/buyers/sellers) | `token: String!, since: DateTime!` |
|
|
53
|
+
| `pumpFunTradesLiquidity.lastTradeBeforeMigration` | Last Pump.fun trade before migration to PumpSwap | `token: String!` |
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Category: pumpFunHoldersRisk
|
|
58
|
+
|
|
59
|
+
| Template Path | Description | Variables |
|
|
60
|
+
|---|---|---|
|
|
61
|
+
| `pumpFunHoldersRisk.first100Buyers` | Get first 100 buyers | `token: String!` |
|
|
62
|
+
| `pumpFunHoldersRisk.first100StillHolding` | Check whether first 100 buyers still hold | `holders: [String!], token: String!` |
|
|
63
|
+
| `pumpFunHoldersRisk.devHoldings` | Get developer holdings for token | `devWallet: String!, token: String!` |
|
|
64
|
+
| `pumpFunHoldersRisk.topHoldersTopTradersTopCreators` | Get top holders/top traders/top creators | `token: String!, since: DateTime!` |
|
|
65
|
+
| `pumpFunHoldersRisk.phishyAndMarketCapFilters` | Phishy check + market cap filter scaffolding | `since: DateTime!, minCap: String!, maxCap: String!` |
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Category: pumpSwapPostMigration
|
|
70
|
+
|
|
71
|
+
| Template Path | Description | Variables |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| `pumpSwapPostMigration.newPoolsRealtime` | Get newly created PumpSwap pools | `since: DateTime!, limit: Int!` |
|
|
74
|
+
| `pumpSwapPostMigration.trackMigratedPools` | Track pools migrated to PumpSwap | `since: DateTime!, limit: Int!` |
|
|
75
|
+
| `pumpSwapPostMigration.latestTrades` | Get latest trades on PumpSwap | `since: DateTime!, limit: Int!` |
|
|
76
|
+
| `pumpSwapPostMigration.latestTradesByToken` | Latest PumpSwap trades for token | `token: String!, limit: Int!` |
|
|
77
|
+
| `pumpSwapPostMigration.pumpSwapSubscriptionScaffold` | Query mirror for PumpSwap realtime subscription | `since: DateTime!` |
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Category: pumpSwapPriceTrader
|
|
82
|
+
|
|
83
|
+
| Template Path | Description | Variables |
|
|
84
|
+
|---|---|---|
|
|
85
|
+
| `pumpSwapPriceTrader.trackTokenPriceRealtime` | Track PumpSwap token price realtime | `token: String!, since: DateTime!` |
|
|
86
|
+
| `pumpSwapPriceTrader.latestPrice` | Get latest price for PumpSwap token | `token: String!` |
|
|
87
|
+
| `pumpSwapPriceTrader.ohlc` | OHLC for PumpSwap token | `token: String!, since: DateTime!` |
|
|
88
|
+
| `pumpSwapPriceTrader.latestTradesByTrader` | Get latest trades by trader | `wallet: String!, since: DateTime!` |
|
|
89
|
+
| `pumpSwapPriceTrader.topTradersAndStats` | Top traders and token trade stats | `token: String!, since: DateTime!` |
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Category: launchpadsRaydiumLetsBonk
|
|
94
|
+
|
|
95
|
+
| Template Path | Description | Variables |
|
|
96
|
+
|---|---|---|
|
|
97
|
+
| `launchpadsRaydiumLetsBonk.latestRaydiumLaunchpadPools` | Track latest pools created on Raydium Launchpad | `since: DateTime!, limit: Int!` |
|
|
98
|
+
| `launchpadsRaydiumLetsBonk.trackMigrationsToRaydium` | Track migrations to Raydium DEX/CPMM across launchpads | `since: DateTime!, limit: Int!` |
|
|
99
|
+
| `launchpadsRaydiumLetsBonk.bondingCurveProgress` | Compute bonding curve progress from latest pool/liquidity snapshot | `token: String!, since: DateTime!` |
|
|
100
|
+
| `launchpadsRaydiumLetsBonk.tokensAbove95Progress` | Track launchpad tokens above 95% bonding curve progress | `since: DateTime!, limit: Int!` |
|
|
101
|
+
| `launchpadsRaydiumLetsBonk.top100AboutToGraduate` | Top 100 launchpad tokens near migration | `since: DateTime!` |
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Category: launchpadsTokenLevel
|
|
106
|
+
|
|
107
|
+
| Template Path | Description | Variables |
|
|
108
|
+
|---|---|---|
|
|
109
|
+
| `launchpadsTokenLevel.latestLaunchpadTrades` | Get latest launchpad trades | `since: DateTime!, limit: Int!` |
|
|
110
|
+
| `launchpadsTokenLevel.latestPriceForToken` | Get latest price for launchpad token | `token: String!` |
|
|
111
|
+
| `launchpadsTokenLevel.latestTradesByUser` | Get latest trades by user | `wallet: String!, since: DateTime!` |
|
|
112
|
+
| `launchpadsTokenLevel.topBuyersAndSellers` | Get top buyers and top sellers for token | `token: String!, since: DateTime!` |
|
|
113
|
+
| `launchpadsTokenLevel.ohlcPairAndLiquidity` | Get OHLC, pair address and latest liquidity | `token: String!, since: DateTime!` |
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Category: exchangeSpecific
|
|
118
|
+
|
|
119
|
+
| Template Path | Description | Variables |
|
|
120
|
+
|---|---|---|
|
|
121
|
+
| `exchangeSpecific.raydiumSuite` | Raydium: pools, pair create time, latest price, trades, LP changes, OHLC | `token: String!, since: DateTime!` |
|
|
122
|
+
| `exchangeSpecific.bonkSwapSuite` | BonkSwap: latest trades, top traders, trader feed, OHLC | `token: String!, wallet: String!, since: DateTime!` |
|
|
123
|
+
| `exchangeSpecific.jupiterSuite` | Jupiter swaps and order lifecycle query suite | `since: DateTime!` |
|
|
124
|
+
| `exchangeSpecific.jupiterStudioSuite` | Jupiter Studio token trades, prices, OHLC, launches, migrations | `since: DateTime!, token: String` |
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Category: genericDexAnalytics
|
|
129
|
+
|
|
130
|
+
| Template Path | Description | Variables |
|
|
131
|
+
|---|---|---|
|
|
132
|
+
| `genericDexAnalytics.latestSolanaTrades` | Subscribe/query latest Solana trades | `since: DateTime!, limit: Int!` |
|
|
133
|
+
| `genericDexAnalytics.priceVsWsolUsdMultiMarket` | Token price vs WSOL/USD and multi-market | `token: String!, since: DateTime!` |
|
|
134
|
+
| `genericDexAnalytics.pressureTopsAndDexs` | Buy/sell pressure and top-bought/top-sold/pairs/dexs | `since: DateTime!, limit: Int!` |
|
|
135
|
+
| `genericDexAnalytics.dexMarketsPairsTokenDetails` | DEX markets/pairs/token details | `token: String!, since: DateTime!` |
|
|
136
|
+
| `genericDexAnalytics.ohlcHistoryAthTrendSearch` | OHLC history, ATH, first-24h, trend, search | `token: String!, since: DateTime!` |
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Subscriptions (Managed via WebSocket)
|
|
141
|
+
|
|
142
|
+
Subscriptions are real-time WebSocket streams managed by the orchestrator. **Do not use these via the REST `POST /api/bitquery/query` endpoint** — subscription operations sent through REST will be rejected with `BITQUERY_SUBSCRIPTION_MANAGED_ONLY`.
|
|
143
|
+
|
|
144
|
+
Instead, use the `solana_bitquery_subscribe` plugin tool (or WebSocket `bitquery_subscribe` message) to create managed subscriptions. The orchestrator handles upstream WebSocket connections, multiplexing, and policy enforcement.
|
|
145
|
+
|
|
146
|
+
Use these template keys (not dot-path format) with `solana_bitquery_subscribe`:
|
|
147
|
+
|
|
148
|
+
| Template Key | Description | Variables |
|
|
149
|
+
|---|---|---|
|
|
150
|
+
| `realtimeTokenPricesSolana` | Real-time token prices on Solana | `token: String!` |
|
|
151
|
+
| `ohlc1s` | 1-second OHLC stream | `token: String!` |
|
|
152
|
+
| `dexPoolLiquidityChanges` | DEXPool liquidity changes stream | `token: String!` |
|
|
153
|
+
| `pumpFunTokenCreation` | Pump.fun token creation stream | (none) |
|
|
154
|
+
| `pumpFunTrades` | Pump.fun trades stream | `token: String` |
|
|
155
|
+
| `pumpSwapTrades` | PumpSwap trades stream | `token: String` |
|
|
156
|
+
| `raydiumNewPools` | Raydium v4/Launchpad/CLMM new pools stream | (none) |
|
|
157
|
+
|
|
158
|
+
Subscription management tools:
|
|
159
|
+
```
|
|
160
|
+
solana_bitquery_subscribe({ templateKey: "pumpFunTrades", variables: { token: "MINT_ADDRESS" } })
|
|
161
|
+
solana_bitquery_unsubscribe({ subscriptionId: "sub_abc123" })
|
|
162
|
+
solana_bitquery_subscriptions()
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
See `websocket-streaming.md` for full message contract, auth flow, subscription lifecycle, and policy enforcement details.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Usage
|
|
170
|
+
|
|
171
|
+
To run a catalog template:
|
|
172
|
+
```
|
|
173
|
+
solana_bitquery_catalog({
|
|
174
|
+
templatePath: "pumpFunHoldersRisk.first100Buyers",
|
|
175
|
+
variables: { token: "TOKEN_MINT_ADDRESS" }
|
|
176
|
+
})
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
To discover available templates programmatically:
|
|
180
|
+
```
|
|
181
|
+
solana_bitquery_templates()
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
For custom queries not covered by templates, use `solana_bitquery_query` and consult `bitquery-schema.md` for correct schema usage.
|