maiga
  • Intro to Maiga.ai
    • Maiga litepaper
  • Maiga Intro
    • 🤖What is Maiga.ai?
    • ❓Why Maiga.ai?
    • ⏳Market gap
    • 🦸Use case
  • Maiga Tech
    • 🦾AI Agent
    • 👷How it works?
      • Features
      • Examples
      • 🆚Comparison
    • 🦿Technology
      • Architecture
      • Key Elements
      • LLM model
      • 👻AI Abstraction
      • TEEs, MCP & Multimodal
      • Multi venue MCP
    • 🚀Launchpad
    • 🚆Roadmap
  • MAIGA token
    • 🙌Introduction
      • PoT whitepaper link
    • 🍯“Proof of Trading”
      • Math formula
    • 🗝️Option token
    • ℹ️Token utility
    • 🚀Tokenomics
    • 🥧Allocation
    • 🎰Game Theory 3,3
    • 🤑Incentives
    • 🦄Public sale
  • 🔐Audit
  • 📓Disclaimer
  • Incentives
    • 🤑Boost XP
      • 🎁Reward Hash
      • ➡️How to Boost XP?
      • FAQ
    • 🚀Pre-TGE campaign
  • Maiga links
    • 🔗Official links
Powered by GitBook
On this page
  • 1. Connector Layer: CEX & AMM Adapters
  • 2. MCP Server: Context Aggregation & Normalization
  • 3. Agent Inference: Signal Processing & Analysis
  • 4. Execution: Automated Trade & Swap Calls
  • 5. Reporting & Post-Trade Analysis
  • 6. End-to-End Automation Loop
  1. Maiga Tech
  2. Technology

Multi venue MCP

MaigaXBT’s AI agent leverages a multi-venue MCP Server

1. Connector Layer: CEX & AMM Adapters

Each venue (Binance, OKX, Uniswap, Hyperliquid, etc.) is fronted by a Connector microservice that implements a unified interface

  • CEX adapters talk REST/WebSocket APIs, handle rate-limits, and parse order-book, trade, and funding-rate endpoints.

  • AMM adapters poll on-chain subgraphs or use direct RPC calls to fetch get_pool_state (reserves, fees, token balances) and assemble “virtual order books” by inverting the constant-product curve.

All connectors register themselves with the MCP Server’s service registry, advertising capabilities (supports_order_book, supports_swap, etc.).

2. MCP Server: Context Aggregation & Normalization

The MCP Server performs:

  1. Fan-Out Fetch

    • In parallel, calls each Connector’s get_order_book, get_trades, and, for AMMs, get_pool_state.

  2. Normalization

    • Maps CEX bids/asks and AMM “swap curve samples” into a unified OrderBook object

    • Embeds pool reserves & implied price tiers under amm_markets.

  3. Delta Tracking

    • If since is provided, only deltas (new/updated price levels, trades, pool changes) are included to minimize payload.

  4. Merge & Return

    • Aggregates all venue data into one MCP Context Packet

3. Agent Inference: Signal Processing & Analysis

Inside a TEE-protected enclave, the MaigaXBT agent:

  1. Ingests the MCP Context Packet (JSON) and:

    • Converts order books into time-series arrays.

    • Transforms AMM reserves into marginal price curves.

    • Extracts funding-rate trends and volume aggregates.

  2. Feature Engineering

    • Computes cross-venue liquidity imbalances, price spreads, funding deviations, and on-chain flow ratios.

    • Applies sliding-window volatility measures and social-sentiment embeddings (if multimodal inputs are provided).

  3. Model Inference

    • Passes engineered features into a neural network (e.g., Llama-based or custom MLP) to output

  4. Risk Check (in-enclave)

    • Verifies aggregate exposure limits (e.g., max 10 BTC open across venues).

    • Applies position-size caps based on current volatilities.

4. Execution: Automated Trade & Swap Calls

The agent then posts its orders to the MCP Server:

  1. Smart Routing

    • For CEX orders: may further split a large 2.5 BTC buy across Binance and OKX based on real-time depth.

    • For AMM swaps: calculates optimal path and slippage tolerances.

  2. Atomic Execution

    • Uses either native OCO/ICEBERG features on CEXs or bundling via Flashbots (for AMM swaps) to ensure either all legs succeed or are rolled back.

  3. Fill Reporting

    • Streams back a combined FillReport with per-venue fills, average fill prices, and gas/fee breakdowns.

5. Reporting & Post-Trade Analysis

All context packets, signal decisions, and fill reports are logged to a time-series store. Downstream “Reporting Services” can:

  • Generate PnL Dashboards

    • Query aggregate fills vs. average execution price across CEX+AMM.

  • Collateral & Fee Reports

    • Break down gas spent on AMM swaps vs. CEX taker fees.

  • Performance Analytics

    • Compare model confidence vs. actual profit, refine model hyperparameters.

6. End-to-End Automation Loop

  1. Loop Scheduling

    • A cron-style scheduler inside the agent enclave triggers every minute (or on event hooks) to fetch a new MCP context.

  2. Continuous Learning

    • Execution and outcome data feed back into an on-chain “Proof-of-Trading” smart contract; later batch-pulled for model retraining.

  3. Failover & Alerts

    • If a venue connector fails, the MCP Server signals the agent, which can either pause or reroute orders automatically.

  4. Audit & Compliance

    • All requests/responses are signed inside the enclave; an off-chain auditor can verify the chain of custody before funds are unlocked in PoT.

PreviousTEEs, MCP & MultimodalNextLaunchpad

Last updated 2 days ago

🦿