Interaction¶
cyhole.gecko.Gecko
¶
Gecko(
api_key: str | None = None, headers: Any | None = None
)
Bases: Interaction
flowchart TD
cyhole.gecko.Gecko[Gecko]
cyhole.core.interaction.Interaction[Interaction]
cyhole.core.interaction.Interaction --> cyhole.gecko.Gecko
click cyhole.gecko.Gecko href "" "cyhole.gecko.Gecko"
click cyhole.core.interaction.Interaction href "" "cyhole.core.interaction.Interaction"
Class used to connect GeckoTerminal v2 API.
GeckoTerminal exposes on-chain DEX market data across 250+ networks. The public base URL is
https://api.geckoterminal.com/api/v2 and works without
an API key on a 10 calls/min free tier. Paying CoinGecko users can pass an api_key to route
requests through the higher-rate pro-api.coingecko.com/api/v3/onchain mirror.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
api_key
|
str | None
|
optional CoinGecko Pro API key. When provided, requests are sent to the
|
None
|
headers
|
Any | None
|
optional extra headers merged into every request. |
None
|
Example
import asyncio
from cyhole.gecko import Gecko
gecko = Gecko()
# synchronous
response = gecko.client.get_networks()
print(f"Currently supported networks: {len(response.data)}")
# asynchronous
async def main() -> None:
async with gecko.async_client as client:
response = await client.get_search_pools("SOL/USDC")
for pool in response.data:
print(pool.attributes.address)
asyncio.run(main())
Source code in src/cyhole/gecko/interaction.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | |
_get_networks
¶
_get_networks(
sync: Literal[True], page: int | None = None
) -> GetNetworksResponse
_get_networks(
sync: Literal[False], page: int | None = None
) -> Coroutine[None, None, GetNetworksResponse]
_get_networks(
sync: bool, page: int | None = None
) -> (
GetNetworksResponse
| Coroutine[None, None, GetNetworksResponse]
)
This function refers to the Networks API endpoint.
Returns the paginated list of every blockchain network supported by GeckoTerminal. Use it
to discover the network identifier strings required by all other endpoints (e.g. "eth",
"solana", "bsc", "polygon_pos").
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if |
required |
page
|
int | None
|
1-based page number; defaults to |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
GetNetworksResponse |
GetNetworksResponse | Coroutine[None, None, GetNetworksResponse]
|
paginated list of supported networks with their CoinGecko asset-platform mapping when available. |
Raises:
| Type | Description |
|---|---|
GeckoException
|
if the API returns an error. |
Source code in src/cyhole/gecko/interaction.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |
_get_dexes
¶
_get_dexes(
sync: Literal[True],
network: str,
page: int | None = None,
) -> GetDexesResponse
_get_dexes(
sync: Literal[False],
network: str,
page: int | None = None,
) -> Coroutine[None, None, GetDexesResponse]
_get_dexes(
sync: bool, network: str, page: int | None = None
) -> (
GetDexesResponse
| Coroutine[None, None, GetDexesResponse]
)
This function refers to the Dexes by Network API endpoint.
Returns the paginated list of every DEX indexed by GeckoTerminal on the requested network. Useful to scope pool / volume queries to a specific exchange or to surface the DEX universe of a given chain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if |
required |
network
|
str
|
network identifier (e.g. |
required |
page
|
int | None
|
1-based page number; defaults to |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
GetDexesResponse |
GetDexesResponse | Coroutine[None, None, GetDexesResponse]
|
paginated list of DEXes available on the network. |
Raises:
| Type | Description |
|---|---|
GeckoException
|
if the API returns an error. |
Source code in src/cyhole/gecko/interaction.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | |
_get_pool_ohlcv
¶
_get_pool_ohlcv(
sync: Literal[True],
network: str,
pool_address: str,
timeframe: str,
query: GetPoolOhlcvQuery | None = None,
) -> GetPoolOHLCVResponse
_get_pool_ohlcv(
sync: Literal[False],
network: str,
pool_address: str,
timeframe: str,
query: GetPoolOhlcvQuery | None = None,
) -> Coroutine[None, None, GetPoolOHLCVResponse]
_get_pool_ohlcv(
sync: bool,
network: str,
pool_address: str,
timeframe: str,
query: GetPoolOhlcvQuery | None = None,
) -> (
GetPoolOHLCVResponse
| Coroutine[None, None, GetPoolOHLCVResponse]
)
This function refers to the Pool OHLCV API endpoint.
Returns historical candlestick data for the requested pool at the chosen timeframe. The
candles are returned newest-first up to the configured limit and can be denominated in
USD or quoted in either side of the pool. Useful for charting and for backtesting price
action against a specific DEX pair.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if |
required |
network
|
str
|
network identifier (e.g. |
required |
pool_address
|
str
|
contract address of the pool. |
required |
timeframe
|
str
|
candle granularity; one of the values declared by
|
required |
query
|
GetPoolOhlcvQuery | None
|
optional |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
GetPoolOHLCVResponse |
GetPoolOHLCVResponse | Coroutine[None, None, GetPoolOHLCVResponse]
|
OHLCV series plus a |
Raises:
| Type | Description |
|---|---|
GeckoException
|
if the API returns an error. |
Source code in src/cyhole/gecko/interaction.py
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | |
_get_pool_token_info
¶
_get_pool_token_info(
sync: Literal[True], network: str, pool_address: str
) -> GetPoolTokenInfoResponse
_get_pool_token_info(
sync: Literal[False], network: str, pool_address: str
) -> Coroutine[None, None, GetPoolTokenInfoResponse]
_get_pool_token_info(
sync: bool, network: str, pool_address: str
) -> (
GetPoolTokenInfoResponse
| Coroutine[None, None, GetPoolTokenInfoResponse]
)
This function refers to the Pool Tokens Info API endpoint.
Returns the full metadata block of every token that participates in the requested pool (typically two entries — base and quote). The payload includes image set, GeckoTerminal trust score breakdown, holder distribution and social links, so callers can enrich a pool view without making a separate request per token.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if |
required |
network
|
str
|
network identifier (e.g. |
required |
pool_address
|
str
|
contract address of the pool. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
GetPoolTokenInfoResponse |
GetPoolTokenInfoResponse | Coroutine[None, None, GetPoolTokenInfoResponse]
|
list of token-info entries, one per pool side. |
Raises:
| Type | Description |
|---|---|
GeckoException
|
if the API returns an error. |
Source code in src/cyhole/gecko/interaction.py
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | |
_get_pool_trades
¶
_get_pool_trades(
sync: Literal[True],
network: str,
pool_address: str,
trade_volume_in_usd_greater_than: float | None = None,
token: str | None = None,
) -> GetPoolTradesResponse
_get_pool_trades(
sync: Literal[False],
network: str,
pool_address: str,
trade_volume_in_usd_greater_than: float | None = None,
token: str | None = None,
) -> Coroutine[None, None, GetPoolTradesResponse]
_get_pool_trades(
sync: bool,
network: str,
pool_address: str,
trade_volume_in_usd_greater_than: float | None = None,
token: str | None = None,
) -> (
GetPoolTradesResponse
| Coroutine[None, None, GetPoolTradesResponse]
)
This function refers to the Pool Trades API endpoint.
Returns the trade history of the requested pool over the trailing 24 hours, optionally
filtered by a minimum USD volume threshold. Each trade reports block / transaction info,
amounts on both sides, prices in the chosen currency token, and a kind flag distinguishing
buys from sells.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if |
required |
network
|
str
|
network identifier (e.g. |
required |
pool_address
|
str
|
contract address of the pool. |
required |
trade_volume_in_usd_greater_than
|
float | None
|
minimum USD volume per trade; defaults to |
None
|
token
|
str | None
|
which side of the pool to express prices on. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
GetPoolTradesResponse |
GetPoolTradesResponse | Coroutine[None, None, GetPoolTradesResponse]
|
list of trades, newest-first. |
Raises:
| Type | Description |
|---|---|
GeckoException
|
if the API returns an error. |
Source code in src/cyhole/gecko/interaction.py
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | |
_get_token_data
¶
_get_token_data(
sync: Literal[True],
network: str,
address: str,
include: str | None = None,
include_composition: bool | None = None,
include_inactive_source: bool | None = None,
) -> GetTokenDataResponse
_get_token_data(
sync: Literal[True],
network: str,
address: list[str],
include: str | None = None,
include_composition: bool | None = None,
include_inactive_source: bool | None = None,
) -> GetTokenDataMultipleResponse
_get_token_data(
sync: Literal[False],
network: str,
address: str,
include: str | None = None,
include_composition: bool | None = None,
include_inactive_source: bool | None = None,
) -> Coroutine[None, None, GetTokenDataResponse]
_get_token_data(
sync: Literal[False],
network: str,
address: list[str],
include: str | None = None,
include_composition: bool | None = None,
include_inactive_source: bool | None = None,
) -> Coroutine[None, None, GetTokenDataMultipleResponse]
_get_token_data(
sync: bool,
network: str,
address: str | list[str],
include: str | None = None,
include_composition: bool | None = None,
include_inactive_source: bool | None = None,
) -> (
GetTokenDataResponse
| GetTokenDataMultipleResponse
| Coroutine[None, None, GetTokenDataResponse]
| Coroutine[None, None, GetTokenDataMultipleResponse]
)
This function refers to the Token Data API endpoint.
Returns current price, supply, liquidity and volume metrics for one or more tokens on a
given network. When a single address string is provided, the single-token endpoint is
used and the response is a GetTokenDataResponse;
when a list[str] of addresses is provided, the multi-token endpoint is used and the
response is a GetTokenDataMultipleResponse
whose entries also carry a launchpad_details block. Pass include="top_pools" to embed
each token's most relevant pools inside the included array.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if |
required |
network
|
str
|
network identifier (e.g. |
required |
address
|
str | list[str]
|
token contract address, or list of addresses (up to ~50 for the multi endpoint). |
required |
include
|
str | None
|
when set to |
None
|
include_composition
|
bool | None
|
only effective with |
None
|
include_inactive_source
|
bool | None
|
when |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
GetTokenDataResponse |
GetTokenDataResponse | GetTokenDataMultipleResponse | Coroutine[None, None, GetTokenDataResponse] | Coroutine[None, None, GetTokenDataMultipleResponse]
|
when |
GetTokenDataMultipleResponse |
GetTokenDataResponse | GetTokenDataMultipleResponse | Coroutine[None, None, GetTokenDataResponse] | Coroutine[None, None, GetTokenDataMultipleResponse]
|
when |
Raises:
| Type | Description |
|---|---|
GeckoException
|
if the API returns an error. |
Source code in src/cyhole/gecko/interaction.py
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | |
_get_token_info
¶
_get_token_info(
sync: Literal[True], network: str, address: str
) -> GetTokenInfoResponse
_get_token_info(
sync: Literal[False], network: str, address: str
) -> Coroutine[None, None, GetTokenInfoResponse]
_get_token_info(
sync: bool, network: str, address: str
) -> (
GetTokenInfoResponse
| Coroutine[None, None, GetTokenInfoResponse]
)
This function refers to the Token Info API endpoint.
Returns the complete metadata block of a single token on a given network: image set, GeckoTerminal trust score (with per-dimension breakdown), holders distribution, social links, free-text description, mint/freeze authorities, and the honeypot flag.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if |
required |
network
|
str
|
network identifier (e.g. |
required |
address
|
str
|
token contract address. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
GetTokenInfoResponse |
GetTokenInfoResponse | Coroutine[None, None, GetTokenInfoResponse]
|
token metadata block. |
Raises:
| Type | Description |
|---|---|
GeckoException
|
if the API returns an error. |
Source code in src/cyhole/gecko/interaction.py
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 | |
_get_recently_updated_tokens
¶
_get_recently_updated_tokens(
sync: Literal[True],
network: str | None = None,
include: str | None = None,
) -> GetRecentlyUpdatedTokensResponse
_get_recently_updated_tokens(
sync: Literal[False],
network: str | None = None,
include: str | None = None,
) -> Coroutine[
None, None, GetRecentlyUpdatedTokensResponse
]
_get_recently_updated_tokens(
sync: bool,
network: str | None = None,
include: str | None = None,
) -> (
GetRecentlyUpdatedTokensResponse
| Coroutine[
None, None, GetRecentlyUpdatedTokensResponse
]
)
This function refers to the Recently Updated Tokens API endpoint.
Returns tokens whose metadata (description, social links, GeckoTerminal score, ...) was updated most recently. Useful to surface newly enriched projects across a network.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if |
required |
network
|
str | None
|
network identifier; defaults to |
None
|
include
|
str | None
|
when set to |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
GetRecentlyUpdatedTokensResponse |
GetRecentlyUpdatedTokensResponse | Coroutine[None, None, GetRecentlyUpdatedTokensResponse]
|
list of recently updated tokens. |
Raises:
| Type | Description |
|---|---|
GeckoException
|
if the API returns an error. |
Source code in src/cyhole/gecko/interaction.py
378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 | |
_get_token_ohlcv
¶
_get_token_ohlcv(
sync: Literal[True],
network: str,
token_address: str,
timeframe: str,
query: GetTokenOhlcvQuery | None = None,
) -> GetTokenOHLCVResponse
_get_token_ohlcv(
sync: Literal[False],
network: str,
token_address: str,
timeframe: str,
query: GetTokenOhlcvQuery | None = None,
) -> Coroutine[None, None, GetTokenOHLCVResponse]
_get_token_ohlcv(
sync: bool,
network: str,
token_address: str,
timeframe: str,
query: GetTokenOhlcvQuery | None = None,
) -> (
GetTokenOHLCVResponse
| Coroutine[None, None, GetTokenOHLCVResponse]
)
This function refers to the Token OHLCV API endpoint.
Returns aggregated candlestick data for the requested token at the chosen timeframe. The
server automatically selects the most relevant pool on the network and returns the same
candle structure as get_pool_ohlcv. Useful when the
caller wants a per-token chart without first resolving the underlying pool.
Pro plan required
This endpoint is not exposed on the public api.geckoterminal.com tier and returns
401 Unauthorized without a CoinGecko Pro API key. Construct the Gecko interaction
with api_key = "..." so requests are routed through the pro-api.coingecko.com
on-chain mirror.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if |
required |
network
|
str
|
network identifier (e.g. |
required |
token_address
|
str
|
token contract address. |
required |
timeframe
|
str
|
candle granularity; one of the values declared by
|
required |
query
|
GetTokenOhlcvQuery | None
|
optional |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
GetTokenOHLCVResponse |
GetTokenOHLCVResponse | Coroutine[None, None, GetTokenOHLCVResponse]
|
OHLCV series plus a |
Raises:
| Type | Description |
|---|---|
GeckoException
|
if the API returns an error. |
Source code in src/cyhole/gecko/interaction.py
416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 | |
_get_token_trades
¶
_get_token_trades(
sync: Literal[True],
network: str,
token_address: str,
trade_volume_in_usd_greater_than: float | None = None,
) -> GetTokenTradesResponse
_get_token_trades(
sync: Literal[False],
network: str,
token_address: str,
trade_volume_in_usd_greater_than: float | None = None,
) -> Coroutine[None, None, GetTokenTradesResponse]
_get_token_trades(
sync: bool,
network: str,
token_address: str,
trade_volume_in_usd_greater_than: float | None = None,
) -> (
GetTokenTradesResponse
| Coroutine[None, None, GetTokenTradesResponse]
)
This function refers to the Token Trades API endpoint.
Returns the trade history involving the requested token across every indexed pool over the
trailing 24 hours, optionally filtered by a minimum USD volume threshold. Each trade also
reports the pool that executed it (pool_address, pool_dex).
Pro plan required
This endpoint is not exposed on the public api.geckoterminal.com tier and returns
401 Unauthorized without a CoinGecko Pro API key. Construct the Gecko interaction
with api_key = "..." so requests are routed through the pro-api.coingecko.com
on-chain mirror.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if |
required |
network
|
str
|
network identifier (e.g. |
required |
token_address
|
str
|
token contract address. |
required |
trade_volume_in_usd_greater_than
|
float | None
|
minimum USD volume per trade; defaults to |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
GetTokenTradesResponse |
GetTokenTradesResponse | Coroutine[None, None, GetTokenTradesResponse]
|
list of trades, newest-first. |
Raises:
| Type | Description |
|---|---|
GeckoException
|
if the API returns an error. |
Source code in src/cyhole/gecko/interaction.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 | |
_get_token_holders_chart
¶
_get_token_holders_chart(
sync: Literal[True],
network: str,
token_address: str,
days: str | None = None,
) -> GetTokenHoldersChartResponse
_get_token_holders_chart(
sync: Literal[False],
network: str,
token_address: str,
days: str | None = None,
) -> Coroutine[None, None, GetTokenHoldersChartResponse]
_get_token_holders_chart(
sync: bool,
network: str,
token_address: str,
days: str | None = None,
) -> (
GetTokenHoldersChartResponse
| Coroutine[None, None, GetTokenHoldersChartResponse]
)
This function refers to the Token Holders Chart API endpoint.
Returns the historical holders count for the requested token across the chosen window
("7", "30", or "max" days). Useful to track adoption or sell-off pressure over time.
Pro plan required
This endpoint is not exposed on the public api.geckoterminal.com tier and returns
401 Unauthorized without a CoinGecko Pro API key. Construct the Gecko interaction
with api_key = "..." so requests are routed through the pro-api.coingecko.com
on-chain mirror.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if |
required |
network
|
str
|
network identifier (e.g. |
required |
token_address
|
str
|
token contract address. |
required |
days
|
str | None
|
time window; one of the values declared by
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
GetTokenHoldersChartResponse |
GetTokenHoldersChartResponse | Coroutine[None, None, GetTokenHoldersChartResponse]
|
list of |
Raises:
| Type | Description |
|---|---|
GeckoException
|
if the API returns an error. |
Source code in src/cyhole/gecko/interaction.py
502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 | |
_get_top_token_holders
¶
_get_top_token_holders(
sync: Literal[True],
network: str,
address: str,
holders: str | None = None,
include_pnl_details: bool | None = None,
) -> GetTopTokenHoldersResponse
_get_top_token_holders(
sync: Literal[False],
network: str,
address: str,
holders: str | None = None,
include_pnl_details: bool | None = None,
) -> Coroutine[None, None, GetTopTokenHoldersResponse]
_get_top_token_holders(
sync: bool,
network: str,
address: str,
holders: str | None = None,
include_pnl_details: bool | None = None,
) -> (
GetTopTokenHoldersResponse
| Coroutine[None, None, GetTopTokenHoldersResponse]
)
This function refers to the Top Token Holders API endpoint.
Returns the top wallets holding the requested token, ordered by balance. When
include_pnl_details=True each entry also carries realised/unrealised PnL fields, average
buy price, and the number of buy/sell trades. Useful for whale-tracking dashboards.
Pro plan required
This endpoint is not exposed on the public api.geckoterminal.com tier and returns
401 Unauthorized without a CoinGecko Pro API key. Construct the Gecko interaction
with api_key = "..." so requests are routed through the pro-api.coingecko.com
on-chain mirror.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if |
required |
network
|
str
|
network identifier (e.g. |
required |
address
|
str
|
token contract address. |
required |
holders
|
str | None
|
number of top holders to return as a decimal string, or |
None
|
include_pnl_details
|
bool | None
|
when |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
GetTopTokenHoldersResponse |
GetTopTokenHoldersResponse | Coroutine[None, None, GetTopTokenHoldersResponse]
|
ordered list of top holders with snapshot timestamp. |
Raises:
| Type | Description |
|---|---|
GeckoException
|
if the API returns an error. |
Source code in src/cyhole/gecko/interaction.py
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 | |
_get_top_token_traders
¶
_get_top_token_traders(
sync: Literal[True],
network: str,
token_address: str,
traders: str | None = None,
sort: str | None = None,
include_address_label: bool | None = None,
) -> GetTopTokenTradersResponse
_get_top_token_traders(
sync: Literal[False],
network: str,
token_address: str,
traders: str | None = None,
sort: str | None = None,
include_address_label: bool | None = None,
) -> Coroutine[None, None, GetTopTokenTradersResponse]
_get_top_token_traders(
sync: bool,
network: str,
token_address: str,
traders: str | None = None,
sort: str | None = None,
include_address_label: bool | None = None,
) -> (
GetTopTokenTradersResponse
| Coroutine[None, None, GetTopTokenTradersResponse]
)
This function refers to the Top Token Traders API endpoint.
Returns the highest-performing wallets on the requested token, ranked by the chosen sort
criterion (default: realised PnL in USD). Each entry includes buy/sell counts, amounts and
USD totals — useful for smart-money / copy-trading strategies.
Pro plan required
This endpoint is not exposed on the public api.geckoterminal.com tier and returns
401 Unauthorized without a CoinGecko Pro API key. Construct the Gecko interaction
with api_key = "..." so requests are routed through the pro-api.coingecko.com
on-chain mirror.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if |
required |
network
|
str
|
network identifier (e.g. |
required |
token_address
|
str
|
token contract address. |
required |
traders
|
str | None
|
number of top traders to return as a decimal string, or |
None
|
sort
|
str | None
|
sorting criterion; one of the values declared by
|
None
|
include_address_label
|
bool | None
|
when |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
GetTopTokenTradersResponse |
GetTopTokenTradersResponse | Coroutine[None, None, GetTopTokenTradersResponse]
|
ordered list of top traders. |
Raises:
| Type | Description |
|---|---|
GeckoException
|
if the API returns an error. |
Source code in src/cyhole/gecko/interaction.py
591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 | |
_get_simple_token_price
¶
_get_simple_token_price(
sync: Literal[True],
network: str,
address: str | list[str],
query: GetSimpleTokenPriceQuery | None = None,
) -> GetSimpleTokenPriceResponse
_get_simple_token_price(
sync: Literal[False],
network: str,
address: str | list[str],
query: GetSimpleTokenPriceQuery | None = None,
) -> Coroutine[None, None, GetSimpleTokenPriceResponse]
_get_simple_token_price(
sync: bool,
network: str,
address: str | list[str],
query: GetSimpleTokenPriceQuery | None = None,
) -> (
GetSimpleTokenPriceResponse
| Coroutine[None, None, GetSimpleTokenPriceResponse]
)
This function refers to the Onchain Simple Token Price API endpoint.
Returns current USD prices for up to 100 tokens on a single network in one request, plus
optional market-cap / 24h-volume / 24h-price-change / total-reserve metrics when the
corresponding include_* flag is enabled in query. Designed for lightweight quote
lookups when the full Token Data payload is not needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if |
required |
network
|
str
|
network identifier (e.g. |
required |
address
|
str | list[str]
|
token contract address or list of addresses (up to 100). Lists are joined with commas before being sent. |
required |
query
|
GetSimpleTokenPriceQuery | None
|
optional |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
GetSimpleTokenPriceResponse |
GetSimpleTokenPriceResponse | Coroutine[None, None, GetSimpleTokenPriceResponse]
|
per-address maps of price plus any optional metrics. |
Raises:
| Type | Description |
|---|---|
GeckoException
|
if the API returns an error. |
Source code in src/cyhole/gecko/interaction.py
642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 | |
_get_search_pools
¶
_get_search_pools(
sync: Literal[True],
query: str,
network: str | None = None,
include: str | None = None,
page: int | None = None,
) -> GetSearchPoolsResponse
_get_search_pools(
sync: Literal[False],
query: str,
network: str | None = None,
include: str | None = None,
page: int | None = None,
) -> Coroutine[None, None, GetSearchPoolsResponse]
_get_search_pools(
sync: bool,
query: str,
network: str | None = None,
include: str | None = None,
page: int | None = None,
) -> (
GetSearchPoolsResponse
| Coroutine[None, None, GetSearchPoolsResponse]
)
This function refers to the Search Pools API endpoint.
Returns the pools matching the requested query (pool address, token name, token symbol or
token contract address), optionally restricted to one network. When include is provided,
the linked base_token, quote_token and / or dex resources are expanded inline inside
the JSON:API included array.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if |
required |
query
|
str
|
free-text search query. |
required |
network
|
str | None
|
optional network identifier to constrain the search. |
None
|
include
|
str | None
|
comma-separated list of relationships to expand; values from
|
None
|
page
|
int | None
|
1-based page number; defaults to |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
GetSearchPoolsResponse |
GetSearchPoolsResponse | Coroutine[None, None, GetSearchPoolsResponse]
|
matching pools with optional embedded token / DEX resources. |
Raises:
| Type | Description |
|---|---|
GeckoException
|
if the API returns an error. |
Source code in src/cyhole/gecko/interaction.py
679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 | |