analytiq.one – Technical Specification#
1. Overview#
analytiq.one is an API-only crypto analytics service focused on the Base ecosystem.It provides four primary analytics endpoints:1.
Wallet Transaction Analysis – /v1/transaction/analyze
2.
Token Sentiment Analysis – /v1/token/sentiment
3.
Token Technical Analysis – /v1/token/technicals
4.
Trending Token Discovery (Base) – /v1/token/trending
All complex logic is delegated to OpenAI Agents which orchestrate a set of MCP tools exposed by a separate FastMCP server.The service is monetized via a dynamic, usage-based credit system driven by:External API usage (BaseScan, Dexscreener, Binance, CoinGecko, Brightdata)
2. Stack & Core Components#
2.1 Technology Stack#
AI Orchestration: OpenAI Agents SDK with GPT-5
External Providers (via FastMCP tools):BaseScan (Base chain tx data)
Dexscreener (on-chain Base token & pool metrics)
Binance (CEX OHLCV + stats)
CoinGecko (token metadata, socials, trending)
Brightdata / Scrapers (Twitter, Reddit, News, Google)
2.2 High-Level Architecture#
1.
Sends HTTP request with Authorization header containing API key.
Calls one of /v1/... endpoints.
2.
Performs light input validation.
Initiates a corresponding OpenAI Agent run.
After the Agent returns, computes cost based on: Deducts credits in PostgreSQL.
Returns the Agent’s JSON response.
3.
A dedicated system prompt.
A fixed tool set (MCP tools).
A contractually defined JSON output schema.
4.
Exposes tools used by Agents (BaseScan, Dexscreener, Binance, CoinGecko, Brightdata, TA utilities).
Handles all HTTP calls to external APIs and returns normalized data structures.
5.
Request and pricing logs.
Supports dynamic, usage-based billing.
3. Authentication & Authorization#
3.1 API Key#
Header: Authorization: <api-key>
Keys are issued per user and stored hashed in PostgreSQL.
Enabled / disabled (for abuse, non-payment, etc.).
3.2 Request Flow#
1.
Flask middleware extracts Authorization.
2.
Looks up the API key in PostgreSQL:If invalid/inactive → return 401 Unauthorized.
3.
User context is attached to the request (user ID, current balance).
4. Pricing & Credits#
4.1 Pricing Model#
Pricing is dynamic, driven by:2.
Each MCP tool (BaseScan call, Dexscreener call, Brightdata scrape, etc.) has an associated cost weight.
4.2 Usage Accounting Per Request#
1.
Ensure user has at least some positive credit balance (soft check).
2.
Execute Agent with appropriate tools.
Token usage stats (prompt + completion).
FastMCP / tool layer records:Tool calls and counts by tool name.
3.
The formula and weights are configurable.
4.
Deduct total_credits from user’s credit balance.
Insert a usage + billing log row.
5.
Return the Agent’s analytics result to the client.
Optionally include metadata in headers or a separate endpoint (for cost transparency) later.
The FastMCP server exposes tools with clear responsibilities. Agents never see raw HTTP; they only call tools.basescan.txlist
Fetches normal transactions for a wallet on Base.
basescan.tokentx
Fetches ERC-20 token transfers for a wallet on Base.
basescan.balance (optional)
Fetches Base ETH balance for a wallet.
dexscreener.token_pairs
Given a Base token contract, returns pools and metrics (priceUsd, liquidity, volume, txns, priceChange, etc.).
dexscreener.search_pairs
Text or contract search returning matching Base pools.
dexscreener.get_pair
Given a Base pair address, returns detailed current metrics.
dexscreener.scrape_trending_page
Scrapes Dexscreener’s Base trending/hot pools from the website UI.
binance.klines
Returns OHLCV candles for a symbol / interval.
binance.ticker_24h
Returns 24h stats for a symbol (change %, volume, etc.).
coingecko.get_token_by_contract
Given a Base contract, returns:Social links (Twitter/X, Reddit, website, etc.).
coingecko.search_trending
Returns a global trending list (by search interest) from which Base tokens can be extracted.
5.5 Brightdata / Scraper Tools (content)#
scrape_twitter
Fetches tweets based on queries and/or handles.
scrape_reddit
Fetches Reddit posts/comments based on search queries and relevant subreddits.
scrape_news
Fetches news articles matching token-related search queries.
scrape_google
Fetches search results and snippets for token-related queries.
5.6 TA Utilities#
ta.compute_indicators
Accepts OHLCV data and returns EMA, RSI, MACD, Bollinger Bands and any other derived technical metrics required by the agents.
6. Agents & Endpoint Responsibilities#
Each endpoint has a dedicated OpenAI Agent configured with:A system prompt describing:Expected JSON output shape.
A specific tool set (subset of the MCP tools).
A well-defined analytics responsibility.
Below is the conceptual behavior per endpoint.
6.1 POST /v1/transaction/analyze#
Purpose#
Perform transaction analysis for a Base wallet:Trading intensity and style.
Token distribution and top tokens.
Approximate sizing and estimated performance indicators.
Behavioral classification (e.g. “short-term degen”, “swing”, “holder”).
Agent: transaction_agent#
basescan.balance (optional)
dexscreener.token_pairs (for pricing of Base tokens involved)
1.
Fetch Base wallet tx data:Normal txs via basescan.txlist.
ERC-20 transfers via basescan.tokentx.
2.
Filter by requested lookback window (e.g. last 30 days).
3.
Build token-level activity:Group transfers per token contract.
Number of trades per token.
Direction of flow per token (net accumulation vs distribution).
4.
When needed for top tokens:Use dexscreener.token_pairs to get priceUsd and relevant metrics.
5.
Behavioral metrics & profile:Holding-time proxies (time between buys and sells).
style (scalper, swing, degen, holder, etc.)
risk_profile (low/medium/high).
Short summary and descriptive narrative.
The Agent returns a structured JSON document with metrics and a concise interpretation.
6.2 POST /v1/token/sentiment#
Purpose#
Compute token sentiment for a Base token across:Overall sentiment score & label.
Key bullish & bearish reasons.
Agent: sentiment_agent#
coingecko.get_token_by_contract
1.
Use coingecko.get_token_by_contract (Base contract):Get official symbol, name.
Extract social links (Twitter handle, subreddit, website).
2.
"SYMBOL crypto", "TOKEN_NAME base".
Handle-based queries (Twitter, Reddit) if available.
3.
For each included platform:Use respective scrape tool with the queries and time window:time_window_hours defines the freshness.
4.
GPT-5 reads aggregated content (with internal summarization).
Assign numeric score [-1, 1].
Map to label (very_bearish → very_bullish).
Weighted aggregate score & label.
Extract top bullish & bearish narratives.
The Agent outputs a JSON object containing all platform-level scores and a summary.
6.3 POST /v1/token/technicals#
Purpose#
Perform technical analysis on a token:Compute EMA, RSI, MACD, Bollinger Bands.
Derive trend/overbought/oversold states.
Provide a simple narrative and “what’s going on” snapshot.
Supports Base tokens via:Binance (where a CEX symbol exists).
Dexscreener (for Base-only DEX pairs).
Agent: technicals_agent#
1.
If request explicitly chooses source = "binance" and mapping exists:Optionally binance.ticker_24h for 24h context.
Otherwise, source = "dex":Use dexscreener.search_pairs with the Base contract/symbol.
Identify primary Base pool (e.g. highest liquidity).
Use Dexscreener data (and/or chart data pipeline) for candles.
2.
Pass candles to ta.compute_indicators.
Bollinger Bands (middle, upper, lower, bandwidth).
3.
Technical interpretation:RSI (oversold/overbought).
MACD crossovers and histogram.
Bollinger Bands (squeeze, expansion, near upper/lower band).
rsi_state, macd_state, bb_state.
Short summary describing the current technical picture.
trader_takeaway phrased as informational context, not advice.
The Agent returns this analysis as a structured JSON including raw indicator values and symbolic states.
6.4 GET /v1/token/trending#
Purpose#
Return a ranked list of trending Base tokens and a short, metric-based explanation for why each is trending.Agent: trending_agent#
coingecko.search_trending
coingecko.get_token_by_contract (or equivalent coin metadata lookup)
dexscreener.scrape_trending_page
1.
Global interest (search-based trending):Call coingecko.search_trending.
Extract tokens with a Base deployment / Base contract.
These represent coins with high search interest.
2.
On-chain activity (Base DEX trending):Call dexscreener.scrape_trending_page for chain = base.
Gather a list of trending/hot Base pools (pair addresses).
For each, call dexscreener.get_pair to retrieve:1h / 24h volume and transactions.
Dexscreener URL and token info.
3.
Appear in Coingecko trending and
Have strong on-chain metrics on Base.
If fewer than requested limit, fill with purely on-chain trending tokens.
4.
Evaluate recent price change vs volume and txns.
Example labels: breakout, pump, dump, cooldown, reversal_risk.
Generate a concise reason referencing the metrics:E.g., “24h volume up 4x, 1h price +35%, and a sharp increase in transactions.”
The Agent returns a JSON array of tokens with symbol, contract, dexscreener URL, core metrics, and a narrative reason.
7. Non-goals / Out of Scope#
No frontend; API-only service.
No manual dashboard or UI for users in this phase.
No on-chain write operations (purely analytical reads).
No direct trading or trading signals; outputs are informational only.
No fixed, per-endpoint pricing; all pricing is dynamic based on usage.
8. Summary#
analytiq.one is a thin Flask shell in front of:OpenAI Agents (GPT-5) for orchestration.
A FastMCP tool server for all external data.
A PostgreSQL-backed credit system for dynamic, usage-based billing.
The system is intentionally:Stateless at the computation layer (each request is self-contained).
Tool-driven, making it easy to extend with additional data sources or features.
Base-focused, ensuring deep, specific coverage of the Base ecosystem rather than generic cross-chain analytics.
Modified at 2026-03-19 13:34:45