Back

Python SDK

Pure Python 3.10+. No external dependencies. Perfect for bots, scanners, and trading systems.

pip install asahi

Basic Usage

from asahi import classify, MemeTokenContext

ctx = MemeTokenContext(
    token_mint="AsahiXyz...pump",
    symbol="ASAHI",
    price_usd=0.00082,
    price_change_1h_pct=38.0,
    price_change_24h_pct=180.0,
    volume_1h=480_000,
    volume_24h=1_200_000,
    holder_count=4_200,
    holder_count_prev=3_100,
    market_cap_usd=560_000,
)

report = classify(ctx)

print(report.state)            # NARRATIVE
print(report.narrative_score)  # ~67.4
print(report.insight)          # "Coherent narrative in motion..."

Batch Analysis

from asahi import classify_batch, loudest

contexts = [
    MemeTokenContext(symbol="ASAHI", ...),
    MemeTokenContext(symbol="PUMP", ...),
    MemeTokenContext(symbol="BONK", ...),
]

reports = classify_batch(contexts)
top = loudest(contexts)  # context with highest narrative score

for report in reports:
    if report.narrative_score >= 70:
        print(f"Loud: {report.symbol} - {report.state}")

Signal Breakdown

from asahi import classify, MemeTokenContext

ctx = MemeTokenContext(...)
report = classify(ctx)

# Access individual signals
print(f"Velocity:  {report.signals.velocity}")   # 82
print(f"Resonance: {report.signals.resonance}")  # 71
print(f"Depth:     {report.signals.depth}")      # 68
print(f"Coherence: {report.signals.coherence}")  # 55

print(f"Triggered: {report.triggered_count}/4")
print(f"Coherent:  {report.is_coherent}")

API Reference

MemeTokenContext

Token data snapshot

token_mintSolana token mint address
symbolToken symbol
price_change_1h_pct1h price change percentage
volume_1h / volume_24hVolume metrics
holder_count / holder_count_prevHolder growth data
market_cap_usdMarket cap in USD
classify(ctx)

Main classification function

ctxMemeTokenContext input
returnsNarrativeReport object
NarrativeReport

Classification output

.narrative_scoreScore (0-100)
.stateNOISE / SIGNAL / NARRATIVE / VIRAL
.insightHuman-readable insight
.triggered_countNumber of triggered signals
.is_coherentTrue if >= 2 signals triggered

Try it live in the Lab

Experiment with AsahiLM interactively

Open Lab