BankrIQ Documentation

HOW THE AI WORKS

BankrIQ is a self-learning agent for Bankr memecoin launches. It detects new tokens on-chain, calls direction, learns from outcomes, and refines its calibration over time.

INTRODUCTION

[overview]

BankrIQ runs as a Bankr App — a sandboxed bundle of server scripts plus an iframe frontend hosted at bankr.bot/terminal/apps. The agent specializes in tokens deployed via Bankr (recognizable by the ba3 suffix on the Base contract address).

Every 3 seconds the frontend pulls a fresh snapshot of Top 100 most recent ba3 launches. When a token crosses qualification thresholds, the AI is invoked to predict direction over a 5-minute window. After the deadline a cron job fetches the exit price and records the outcome.

TECH STACK

[6 components]

BASE MAINNET

All token data lives on Base — fast, cheap on-chain reads.

🦄

UNISWAP V4

PoolManager + StateView for pool detection and price reads.

🐸

GMGN OPENAPI

Smart money, holder, rug-risk and momentum signals.

🤖

BANKR AGENT

LLM that reasons over signal snapshots + accumulated lessons.

💾

APPKV

Bankr platform key-value store for predictions, lessons, stats.

CRON

Every 2 min the resolve job processes due predictions.

1. DETECTION

[~3s latency]

The fetchTokens script polls Uniswap V4 PoolManager for Initialize events every 3 seconds, filters to ba3 addresses, and maintains a rolling Top 100 cache.

const INIT_TOPIC = "0xdd466e674ea5...";
const events = await bankr.chain.getLogs({
  chain: "base",
  address: POOL_MANAGER,
  fromBlock, toBlock: latestBlock,
  topics: [INIT_TOPIC]
});
// Filter to ba3 tokens, dedupe, cache 2h rolling window

Each new token gets enriched with name, symbol, totalSupply via a single Multicall3 batch (one RPC roundtrip for all unknowns).

2. LIVE SNAPSHOT

[20+ signals]

The getOnchainMetrics script batch-scans Swap events for all 100 pools in parallel chunks.

  • Current price from slot0.sqrtPriceX96
  • 1h transaction count, buy/sell breakdown
  • 1h WETH volume in USD
  • 1h price change %
  • Market cap (price × totalSupply)

When a prediction is triggered, predictToken also fetches GMGN data:

CategorySignals
Momentumprice 1m/5m/1h/6h/24h, hot_level
Order flowbuys, sells, volume per 1m/5m/1h
LiquidityliquidityUsd, marketCap, holders
Safetyrug_ratio, is_honeypot, rat_trader_rate
Smart moneysmart_degen_count, renowned_wallets

3. PREDICTION

[ai reasoning]

The agent receives the snapshot, the last 15 prediction lessons, and an aggregate calibration hint. It outputs JSON:

{
  "direction": "up" | "down",
  "confidence": 50-95,
  "reasoning": "2-4 sentences citing specific signals + lessons"
}

Confidence is clamped to [50, 95] — a 50% call is a coin-flip, 90%+ requires multiple aligned signals (momentum + smart money + low rug).

The record is saved with status: open and a 5-minute deadline.

4. RESOLUTION

[cron every 2 min]

The cron-scheduled resolvePredictions runs every 2 minutes. For each due prediction:

  1. Fetch exit price from GMGN /v1/token/info
  2. If unavailable, fall back to Uniswap V4 slot0
  3. Compute % change and tag:
    • actualChange >= 0 + predicted UP → HIT
    • actualChange < 0 + predicted DOWN → HIT
    • Otherwise → FAIL
  4. If no exit price after 5min past deadline → Pending Calibration
  5. If still stuck after 15min → force Pending Calibration
🛡️
No stuck predictions

The 5-min stale window + 15-min force-stale safety net guarantees no prediction stays "OPEN · EVALUATING" indefinitely.

5. SELF-LEARNING LOOP

[in-context]

After resolution, the agent writes a one-sentence pattern lesson citing the specific metrics. The lesson is appended to lessons:<wallet> (50 most recent kept).

On the next prediction, the prompt includes these 15 most recent lessons. Over time the AI builds an implicit pattern library:

1. [HIT]  up @75% → +18.2% — high smart_degen + m5 momentum win
2. [FAIL] up @85% → -22.1% — bundler_rate high, rug 0.4 ignored
3. [HIT]  down @60% → -8.3% — sells > buys + low liquidity dump

This is in-context learning, not model fine-tuning — but it produces measurable calibration improvement as the corpus grows.

FRESH BOARD LOGIC

[<3min + ≥10tx]

A token qualifies for the FRESH section when:

  • ageMinutes < 3 (still in launch window)
  • txnsH1 >= 10 (real trading activity)

Auto-predicts if additionally marketCap >= $30,000 (avoids empty rugs).

ACTIVE BOARD LOGIC

[never-fresh + ≥10tx]

A token qualifies for the ACTIVE section when:

  • txnsH1 >= 10
  • Token never qualified for FRESH (silent past 3min window)

Same auto-predict gating: marketCap >= $30,000.

TOKEN CLEANUP RULES

[lifecycle]

Frontend keeps token visible on FRESH/ACTIVE only when:

  • Currently in Top 100 AND not yet predicted, OR
  • Has an open prediction (regardless of Top 100 status)

Once prediction resolves (HIT / FAIL / Pending Calibration), token is removed from boards immediately. Only the prediction record stays in Recent Predictions.

BRIER CALIBRATION

[auto-adjust]

Every resolved prediction is scored:

brier = (confidence/100 - (outcome === "hit" ? 1 : 0))²

Aggregate Brier drives a calibration hint in the next prompt:

Brier avgHint to AI
< 0.18Well-calibrated — trust strong signals
0.18 - 0.30Moderate — stay honest
> 0.30Overconfident — lower confidence

SIGNAL REFERENCE

[bias map]

Bias contributions per signal:

SignalUPDOWN
price_5m > 0
buys_m5 > sells_m5
smart_degen_count > 0✓✓
renowned_wallets > 0✓✓
volume_m5 rising
rug_ratio > 0.3✓✓
is_honeypot✓✓✓
bundler_rate high
rat_trader_rate high
sells_m5 > buys_m5
holders < 30
price_1h > 50%✓ (retrace)

STORAGE ARCHITECTURE

[appkv]

App data lives in appKV, segmented by key prefix:

Key patternPurpose
cache:bankrPoolRolling 2h ba3 pool (1 key)
cache:meta:<addr>Token metadata, 24h TTL
cache:ethUsdETH/USD spot, 5min TTL
record:pred:<wallet>:<id>Predictions (per user, 30d retention)
stats:<wallet>Aggregate Hits/Fails/Brier
lessons:<wallet>50 most recent lessons

Platform limits: 10 MB total / app, 128 KB per value (officially) — empirically tested up to 5 MB.

FAQ

[common questions]

IS THIS REAL ML?

No. BankrIQ uses in-context learning — the LLM is called fresh each time with accumulated text lessons as context. No model weights update. The "learning" feeling comes from the growing lesson corpus shaping each new decision.

WHY 5 MINUTES?

Memecoin price action on fresh launches resolves fast. 5min is short enough for rapid feedback (helping calibration) but long enough to capture real momentum vs flash noise.

WHY MC ≥ $30K FOR AUTO-PREDICT?

Tokens below this threshold are statistically more likely to be rugs or stillborn. The filter avoids wasting predictions while still displaying them on FRESH/ACTIVE for manual inspection.

DOES THE AI EVER STOP?

No. Resolution is guaranteed by a force-stale safety net at 15min past deadline — predictions never stay "OPEN · EVALUATING" indefinitely.

CAN I RUN IT ON ANOTHER CHAIN?

Currently Base-only — Bankr deploys exclusively to Base. Adding chains would require swapping V4 PoolManager addresses + GMGN chain param.

⚠️
Disclaimer

BankrIQ is an educational tool. Predictions are illustrative AI outputs, not financial advice. Memecoins are extreme-risk assets — never trade more than you can afford to lose.