Back to Projects
Blockchain & Trading • Project

RATU Moon Radar

Multi-Chain DEX Pair Scanner and Early Token Detector

Moralis API httpx Multi-Chain Support Connection Pooling Dataclasses
2024 - 2025
Python 3.10
System Prototyping (Multi-Chain)

Overview

RATU Moon Radar is a multi-chain DEX pair scanner and early token detector using the Moralis API. Part of RATUProject (Real-time Automated Trading Unified), it demonstrates real-time token discovery with connection pooling and multi-chain support across Ethereum, BNB Chain, Polygon, and Base.

The system features dynamic pair selection via CLI, allowing users to scan any token pair (ethusdt, wbtcusdc, bnbusdt) with flexible input formats. It includes a moon token scanner that detects tokens with biggest 24h price gains, providing early detection of trending assets.

Built for system prototyping focus, the tool uses httpx connection pooling for reduced API latency and dataclass-based results for type-safe structured data. It supports major DEX exchanges including Uniswap V2, PancakeSwap V2, QuickSwap, and more.

Key Achievement: Built multi-chain DEX scanner with dynamic pair parsing, connection pooling, and type-safe dataclass results demonstrating real-time blockchain data integration

Key Metrics & Results

4
Chains Supported
Dynamic
Pair Parsing
Connection
Pooling
Dataclass
Type Safety

Problem Statement

Traders need to discover DEX liquidity pools across multiple chains quickly. Early token detection requires scanning for biggest price movers. Different chains use different DEX protocols, making unified scanning complex. API latency can slow down discovery workflows.

Business Context

DEX trading opportunities appear across multiple chains. Manual discovery is slow and error-prone. Early detection of trending tokens provides trading advantages. Unified interface for multi-chain scanning improves efficiency.

Technical Challenges

Solution Architecture

A CLI-based architecture: (1) Dynamic pair parser supporting multiple input formats, (2) Multi-chain scanner using Moralis API with connection pooling, (3) Moon token scanner for top gainers detection, (4) Type-safe dataclass results for structured output.

System Components

Dynamic Pair Parser

Flexible CLI parsing supporting multiple formats: ethusdt, eth/usdt, ETH/USDT. Token address mapping per chain. Handles separator variations automatically.

Multi-Chain DEX Scanner

Scans DEX pairs across Ethereum, BNB Chain, Polygon, Base. Supports Uniswap V2, PancakeSwap V2, QuickSwap. Uses Moralis getPairAddress API with connection pooling.

Moon Token Scanner

Detects tokens with biggest 24h price gains using Moralis top-movers endpoint. Ranks by percentage gain with market cap information.

Connection Pooling

httpx connection pooling reduces API latency for repeated requests. Type-safe dataclass results ensure structured output.

Technology Stack Rationale

Moralis API provides unified interface for multi-chain DEX data. httpx connection pooling reduces latency. Dataclasses ensure type safety. CLI interface enables scripting and automation. Dynamic parsing improves user experience.

Implementation Highlights

Key Features

Detailed Code Documentation

Deep dive into the technical implementation with annotated code examples

View Technical Details

Challenges & Solutions

Challenge 1

Supporting multiple blockchain networks with different DEX protocols

Solution

Implemented chain-specific configuration with token address mappings. Uses Moralis API which provides unified interface across chains. Supports major DEX protocols per chain (Uniswap, PancakeSwap, QuickSwap).

Challenge 2

Handling dynamic pair selection with flexible input formats

Solution

Created parse_pair() function supporting multiple formats: no separator (ethusdt), slash separator (eth/usdt), uppercase (ETH/USDT). Token address lookup per chain handles variations.

Challenge 3

Reducing API latency for real-time token discovery

Solution

Implemented httpx connection pooling for repeated API calls. Reuses connections across requests, reducing latency for multi-chain scans.

Results & Impact

Built multi-chain DEX scanner supporting 4 chains (Ethereum, BNB Chain, Polygon, Base) with dynamic pair selection. Moon token scanner detects early movers with 24h price gains. Connection pooling optimizes API performance. CLI interface enables automation.

Production Performance

  • Supports 4 major blockchain networks
  • Dynamic pair parsing with multiple input formats
  • Connection pooling reduces API latency
  • Type-safe dataclass results
  • Moon scanner for early token detection

Lessons Learned

What Worked Well

What I'd Do Differently

Future Enhancements

Related Projects