Search projects, hackathons, sponsors and tech

    ← All projects

    Neltrix

    Onchain chart pattern analysis built from Uniswap swap data, sold per call via x402 on Hedera

    Demo

    About

    Neltrix is a market data and pattern intelligence layer built entirely from onchain DEX activity, with no centralised price feed anywhere in the stack. Every trade on a DEX is public, but there is no easy way to ask "give me hourly candles with support levels for this pool." You would have to replay huge numbers of swap events, deal with Uniswap V4 using a completely different schema from V3, and discover for yourself that some pools report negative TVL and that a meaningful share of published candles carry broken wicks. Neltrix does that work for you. It builds OHLCV candles for Uniswap V4, Uniswap V3 and SushiSwap pools from data indexed by The Graph. It then runs a rules-based pattern engine over them: candlestick patterns (engulfing, harami, hammer, shooting star, morning and evening star), chart patterns (double top and bottom, head and shoulders, triangles and wedges) and harmonic patterns (Gartley, Bat, Butterfly, Crab). It also clusters swing highs and lows into support and resistance levels and rolls everything up into a bullish, bearish or neutral verdict with a plain English summary. Onchain data is messy, so the pipeline detects and repairs problems like pool creation artifacts, single bad prints, negative TVL and wash-traded pools, and reports every repair in the response instead of hiding it. Data quality is a signal in itself: on the same pair and week, the thinner ETH/USDC 0.01% pool needed 7 wick repairs while the 0.05% pool needed none, which points to sandwiching. Browsing pools and charts in the web app is free. The full analysis endpoint is priced at 0.1 HBAR per request using x402 on Hedera, so an AI agent with no account, API key or subscription can discover the price from a 402 response, pay for one call and get the result. We included an autonomous agent that does exactly that. Neltrix does not trade or hold positions. The verdict has not been backtested, so its confidence measures how strongly the rules agree, not the chance of being right. The most reliable outputs are the price history, the levels and the data quality findings.

    How it's made

    The backend is Python with FastAPI, httpx and Pydantic. The frontend is Next.js 16 with React 19, Tailwind CSS 4 and Motion, and the candlestick chart is custom SVG. The payment gateway and the buyer agent are Node.js using the x402 SDKs (@x402/core, @x402/express, @x402/hedera) and the Hiero Ledger SDK. The Graph: Uniswap V3 and SushiSwap are both published by Messari on the dex-amm Standardized Subgraph schema, so we send one query string to both through The Graph's decentralized network gateway. Adding another dex-amm protocol only takes one line in a registry. The catch was that the deployments are on different schema versions (v4.0.1 vs v1.3.2), so the shared query can only use fields that exist on both. Uniswap V4 has no Messari deployment, so we wrote a separate adapter of about 250 lines for its native subgraph that produces the same internal shape. A single data source interface hides both schemas from the rest of the app. Uniswap: V4 is our main pool source. Its subgraph publishes real hourly and daily OHLC, so a full year of candles takes one query, and 4h candles are rolled up from hourly ones. Messari's schema has no OHLC, so for those protocols we rebuild candles by replaying raw swap events, capped at 10,000 swaps per request to keep things interactive. The API response always says which of the two paths was used. Pattern engine: everything is deterministic geometry, not machine learning. We find swing points, then match candlestick, chart and harmonic patterns (harmonics use Fibonacci ratio ranges). Raw matches are filtered hard: each category has a confidence floor, candlestick patterns only count if they close near a support or resistance level, and overlapping matches are reduced to the strongest one. In the verdict, repeated patterns with the same name are damped by 1/sqrt(n), because nine Bearish Haramis in one choppy week describe the same chop rather than nine separate signals. More recent patterns are weighted higher. Data cleaning: we drop candles with non-positive prices, zero volume or extreme high/low ratios, clamp bad wicks to a rolling median while keeping the candle body, rank pools by volume instead of TVL (the top V4 USDC/USDT pool reported -$24.7M TVL), and use a major token allowlist to filter out wash-traded pools. Failing indexers are retried with backoff and surface as a 502. Hedera: POST /api/analyse is the only paid route. An Express paywall sidecar returns a 402 with PAYMENT-REQUIRED (exact scheme, hedera:testnet, 10,000,000 tinybars), verifies the agent's partially signed HBAR transfer with the Blocky402 facilitator, forwards the request to FastAPI, then settles on chain and returns a PAYMENT-RESPONSE receipt. The facilitator pays network fees, so the payer's balance moves by exactly the price. Two things cost us real debugging time: x402 v2 uses unprefixed headers (not X-PAYMENT-*), and the client's default spend controls reject native HBAR. Rather than turning the controls off, the agent allows HBAR explicitly with a 0.5 HBAR per-call limit, so it refuses an overpriced 402 before it signs anything. We confirmed three settled payments on Hedera testnet through the mirror node, separately from our own code.