papers

signals: web3 intelligence with on-chain reasoning you can verify

how i built an autonomous trading system that commits its reasoning to the blockchain before executing

bangalore, january 2025. i'm watching a friend lose $400 on a memecoin that rugged 8 minutes after launch. the "signal" he followed was a telegram bot that had zero accountability. no one could verify WHY it said "buy."

and that's the problem with every signal service in crypto: trust me, bro.

no receipts. no reasoning trail. no way to audit what the bot "saw" before it told you to ape in. the signal disappears into chat history, and if it was wrong, nobody is held accountable because nobody can even prove what information the bot had at decision time.

i wanted to build the opposite. a system where every trade decision is cryptographically verifiable. where you can look at a trade that happened 3 months ago and see exactly what the system was thinking, what data it had, and why it pulled the trigger.

the problem

crypto trading signals are broken in five ways:

  • information overload: millions of tokens launch. thousands of data points per token. no human can process this at the speed required.
  • low signal accuracy: most telegram bots have sub-20% hit rates. they make money on volume, not precision.
  • no accountability: signals are just text in a chat. when they're wrong, the evidence vanishes into scroll history.
  • speed disadvantage: manual trading can't compete. by the time you've researched a token, the opportunity window has closed.
  • unverifiable reasoning: no way to know WHY a trade decision was made after the fact. was it based on real data or hallucinated confidence?

the core insight: the problem isn't intelligence. it's accountability. if you can't verify the reasoning, the intelligence is worthless.

the approach

multi-agent AI analysis + deterministic kill-switch + on-chain reasoning hashes.

every trade decision is: analyzed by 3 parallel AI agents, scored on a weighted rubric, and the full reasoning text is hashed and committed to the blockchain BEFORE execution.

you can cryptographically verify what the system was thinking. not after the fact. not retroactively. the hash goes on-chain first, then the trade executes. if the reasoning was fabricated or modified, the hash won't match. immutable accountability.

signal generation pipeline

parallel data fetch

six data sources hit simultaneously: DexScreener (price, volume, liquidity), GeckoTerminal (market data), GoPlus (security audit), RugCheck (contract analysis), Twitter API (social sentiment), GMGN (on-chain activity). all fetched in parallel. total latency: under 3 seconds for complete token intelligence.

TokenFactBook construction

raw data gets assembled into a structured fact sheet. pure data, no LLM interpretation yet. this is the ground truth document. price history, holder distribution, contract flags, social metrics, liquidity depth. everything the agents will reason about, in one place.

deterministic kill-switch

before any LLM call happens, a rule-based filter checks for obvious disqualifiers: honeypot contract, sybil wallet concentration above threshold, unbounded mint function, dev wallet holding more than 20% of supply, liquidity locked for less than 30 days.

this short-circuits before wasting LLM compute on obvious scams. roughly 60% of tokens get filtered here. fast, cheap, deterministic. no AI needed to know that an unbounded mint function is a red flag.

3 parallel agents

tokens that pass the kill-switch get analyzed by three specialized agents running in parallel (Gemini 2.5 Flash, structured output via Pydantic schemas):

  • market agent: price action, volume trends, liquidity depth, buy/sell ratio, market cap trajectory
  • rug-check agent: contract security, holder concentration, developer activity, token economics, unlock schedules
  • social agent: twitter sentiment, influencer mentions, community growth rate, narrative momentum

each agent outputs a structured score (0-100) with reasoning text. no free-form responses. Pydantic schemas enforce output structure. no regex parsing. no "hope the LLM formatted it right."

signal vector scoring

weighted aggregation of all three agent scores. market (40%), rug-check (35%), social (25%). the weights reflect reality: market data matters most, security is critical, social is a leading indicator but unreliable alone.

prediction agent

final synthesis. takes all three agent outputs + the TokenFactBook + the weighted score. produces: BUY/HOLD/SELL decision, confidence level (0-100), risk level (low/medium/high/critical), reasoning summary, and time horizon.

on-chain commitment

the full reasoning text (all agent outputs + final decision + confidence + supporting data) gets stored in SQLite locally. a SHA-256 hash of that reasoning gets committed on-chain. the hash proves what the system was thinking at decision time. if anyone questions a trade later, you can produce the reasoning text that matches the on-chain hash. tamper-proof accountability.

autonomous trading (RL agent)

signals are useful. but executing on signals at machine speed is where the real alpha lives.

OBSERVE, THINK, ACT, REFLECT

the trading agent runs a four-phase loop:

  • OBSERVE: pull current market state, portfolio positions, open signals, account balance
  • THINK: evaluate signals against current positions. should i enter? exit? hold? scale?
  • ACT: execute the decision. place trade via DEX router. or do nothing (holding is a valid action).
  • REFLECT: after execution, evaluate outcome. update internal confidence calibration. learn from hits and misses.

real market adapter

bridges live API data to the agent's expected format. abstracts away the difference between Solana DEXs, EVM DEXs, and centralized exchanges. the agent sees a unified interface regardless of where the trade actually executes.

confidence-scaled position sizing

Kelly-lite approach. higher confidence signals get larger positions. lower confidence gets smaller allocations. never more than 5% of portfolio on a single trade. never more than 20% deployed at once. the sizing is mechanical, not emotional.

epsilon-greedy exploration

prevents HOLD bias. without this, conservative agents learn to never trade (since not trading is never "wrong"). epsilon-greedy forces occasional exploration of lower-confidence signals. this keeps the agent learning and prevents it from collapsing into permanent inaction.

heuristic fallback

when the LLM is unavailable (rate limits, outage, latency spike), the agent falls back to rule-based heuristics. simple momentum + volume rules. not as smart, but never stalls. the system degrades gracefully instead of crashing.

ERC-4626 vault

the vault is how users interact with the system without managing trades themselves.

  • users deposit USDC, receive sVAULT shares proportional to their deposit
  • the agent executes trades via Uniswap V3 on behalf of the vault
  • every TradeExecuted event emits two pieces of data on-chain: reasoningHash and confidence
  • share value appreciates (or depreciates) based on trading performance

the reasoningHash in every trade event creates an immutable audit trail. you can reconstruct the entire decision history of the vault. why every trade was made. what confidence the system had. what data it was working with. this is the accountability layer that every other signal service lacks.

ERC-4626 is a standard vault interface. any frontend, any aggregator, any portfolio tracker that supports 4626 can integrate. no custom contracts to audit. battle-tested standard.

key innovations

on-chain reasoning hashes

accountability, not just performance. most trading bots show you PnL charts. signals shows you WHY every trade happened. and proves it cryptographically. this is new. nobody else is hashing reasoning on-chain before execution.

kill-switch before LLM

saves compute, catches obvious rugs. 60% of tokens never reach the AI agents. deterministic rules handle the obvious cases. LLM compute is reserved for tokens that actually require judgment.

structured AI output

Pydantic schemas enforce output format. no regex parsing. no string manipulation. no "the model sometimes returns JSON and sometimes returns plain text." the output is always structured, typed, and validated. if the model returns invalid output, it retries with the schema as feedback.

pay-per-inference API

x402 HTTP payment protocol. users can access individual signal analyses without a subscription. pay per query. micropayments via the x402 standard. no API keys. no monthly commitments. just pay for what you use.

resilience-first architecture

circuit breakers on every external API call. exponential backoff on failures. graceful degradation (heuristic fallback when LLM unavailable). the system never crashes. it gets less intelligent temporarily, but it never stops functioning.

tech stack

frontend
Next.js 16, React, wagmi (wallet connection)
backend
FastAPI (Python), async throughout
AI
Gemini 2.5 Flash (structured output), LangChain (agent orchestration)
RL
Stable-Baselines3 (reinforcement learning agent)
smart contracts
Solidity, Foundry (testing + deployment), ERC-4626
DEX integration
Uniswap V3 (swaps), DexScreener + GeckoTerminal (data)
vector store
Qdrant (token similarity, historical pattern matching)
chains
Solana (memecoin analysis), EVM (vault + trading)

what i learned

the interesting problem in crypto AI isn't "can AI trade better than humans." it probably can. the interesting problem is: how do you make an AI trading system trustworthy?

the answer isn't "show good returns." returns can be faked, cherry-picked, or lucky. the answer is: make the reasoning verifiable. let anyone audit any decision at any time. commit to your reasoning before you know if you're right.

that's what the on-chain hash does. it's a commitment device. the system says "here's what i think and why" and locks that statement into the blockchain before the outcome is known. you can't retroactively claim you predicted something. the hash either matches or it doesn't.

accountability first. intelligence second. that ordering matters.

share this article

Get in Touch