Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ allium realtime prices history \
--start-timestamp 2026-01-01T00:00:00Z --end-timestamp 2026-01-07T00:00:00Z \
--time-granularity 1d

# Historical price series with cursor
allium realtime prices history \
--chain solana --token-address So11111111111111111111111111111111111111112 \
--start-timestamp 2024-08-17T13:00:00Z --end-timestamp 2025-08-17T20:00:00Z \
--time-granularity 5m --cursor eyJzb2xhbmEiOiAiZXlKc1lYTjBYM1JwYldWemRHRnRjQ0k2SUNJeU1ESTBMVEV5TFRJeUlEQTJPalF3T2pBd0luMD0ifQ==

# 24h/1h price stats (high, low, volume, trade count, percent change)
allium realtime prices stats \
--chain solana --token-address So11111111111111111111111111111111111111112
Expand Down
29 changes: 28 additions & 1 deletion cli/commands/realtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ def build() -> dict[str, Any]:
type=click.Choice(["15s", "1m", "5m", "1h", "1d"]),
help="Aggregation interval for price data.",
)
@click.option(
"--cursor",
default=None,
help="Cursor for pagination.",
)
@click.pass_context
@async_command
async def prices_history(
Expand All @@ -140,6 +145,7 @@ async def prices_history(
start_timestamp: str,
end_timestamp: str,
time_granularity: str,
cursor: str | None,
body: str | None,
) -> None:
"""fetch historical price series for tokens over a time range.
Expand All @@ -159,7 +165,12 @@ def build() -> dict[str, Any]:
return payload

payload = load_body_or_build(body, build)
resp = await client.post("/api/v1/developer/prices/history", json=payload)
params: dict[str, Any] = {}
if cursor is not None:
params["cursor"] = cursor
resp = await client.post(
"/api/v1/developer/prices/history", json=payload, params=params
)
output_response(ctx, resp)


Expand Down Expand Up @@ -337,6 +348,11 @@ def build() -> list[dict[str, str]]:
type=click.IntRange(1, 5000),
help="Max results (up to 5000).",
)
@click.option(
"--cursor",
default=None,
help="Cursor for pagination.",
)
@click.pass_context
@async_command
async def balances_history(
Expand All @@ -346,6 +362,7 @@ async def balances_history(
start_timestamp: str,
end_timestamp: str,
limit: int | None,
cursor: str | None,
body: str | None,
) -> None:
"""fetch historical token balance snapshots (raw) over a time range."""
Expand All @@ -362,6 +379,8 @@ def build() -> dict[str, Any]:
params: dict[str, Any] = {}
if limit is not None:
params["limit"] = limit
if cursor is not None:
params["cursor"] = cursor
resp = await client.post(
"/api/v1/developer/wallet/balances/history", json=payload, params=params
)
Expand All @@ -387,6 +406,11 @@ def build() -> dict[str, Any]:
type=click.IntRange(1, 1000),
help="Max results (up to 1000).",
)
@click.option(
"--cursor",
default=None,
help="Cursor for pagination.",
)
@click.pass_context
@async_command
async def transactions(
Expand All @@ -396,6 +420,7 @@ async def transactions(
activity_type: str | None,
lookback_days: int | None,
limit: int | None,
cursor: str | None,
body: str | None,
) -> None:
"""fetch transaction activity for wallets.
Expand All @@ -415,6 +440,8 @@ def build() -> list[dict[str, str]]:
params["lookback_days"] = lookback_days
if limit is not None:
params["limit"] = limit
if cursor is not None:
params["cursor"] = cursor
resp = await client.post(
"/api/v1/developer/wallet/transactions", json=payload, params=params
)
Expand Down
Loading