PROJECTS
AI agentFeatured

AlphaPilot

AlphaPilot is a full-stack market operations system built for the Binance Agent OS Mini Hackathon (Track A). It sits between discretionary crypto trading and fully autonomous bots: it discovers opportunities, sizes and validates them with a deterministic risk engine, and exposes a dual-MCP workflow so an allowlisted AI client can execute on Binance while AlphaPilot never holds exchange credentials.

AlphaPilot

TECH STACK

FastAPIUvicornSql AlchemyOpenrouterDocker

DETAILS

AlphaPilot — AI-Assisted Binance Market Operations Agent

Find opportunities. Control risk. Optimize capital.

AlphaPilot is a full-stack market operations system built for the Binance Agent OS Mini Hackathon (Track A). It sits between discretionary crypto trading and fully autonomous bots: it discovers opportunities, sizes and validates them with a deterministic risk engine, and exposes a dual-MCP workflow so an allowlisted AI client can execute on Binance while AlphaPilot never holds exchange credentials.

The problem it solves

Most “AI trading” demos either (a) hand a model a private API key and hope for the best, or (b) stop at a chat recommendation with no path to a real order. Binance’s Agent OS MCP changes the execution surface—but only for a short allowlist of clients (Claude, Cursor, ChatGPT, Codex, VS Code, Grok Bot). Self-built backends are blocked on the OAuth consent screen. AlphaPilot was designed around that constraint rather than fighting it.

Architecture: Option A

AlphaPilot deliberately does not act as a Binance OAuth client. Instead it uses a dual-MCP split:

  • Public Binance REST for market data, scans, RSI/MACD/momentum analysis, Simple Earn APY, and margin eligibility.
  • AlphaPilot MCP (Streamable HTTP) for analysis tools, risk-validated trade proposals, human approval, and fill recording.
  • Binance Agent OS MCP (inside an allowlisted desktop client) for real account reads and order placement.
  • Account context relay — the AI client reads balances on Binance and reports numbers into AlphaPilot via submit_account_context. AlphaPilot stores only those numbers (with a 10-minute freshness window), never a key or token.
  • The result is a clean separation: AlphaPilot owns policy, scoring, and audit trail; Binance owns authorization and execution; the human (or their AI client) owns the approval boundary.

    What the system actually does

    Discovery. Scheduled and on-demand scanners score the USDT universe with three strategy families: gainer hunting, recovery hunting, and a composite “HOT market” score (momentum, volume acceleration, liquidity, spread quality, relative strength, persistence, and a volatility penalty). Margin eligibility is a stricter gate on top of HOT—not “biggest 24h mover equals leverage.”

    Deterministic risk. Every trade intent—whether from a scheduled scan or a chat-driven request—passes through a RiskEngine that reads only RiskPolicy (per-user DB limits) and live account context. Checks include emergency halt, stale data, duplicate position/pending plan, max trade size, max portfolio allocation, leverage ceiling, daily loss, and opportunity-score floor. The LLM never writes a risk limit and never overrides a failed check.

    Trade plans. A validated intent becomes a TradePlan with size, side, stop, profit-target ladder, scores, and an audit trail. Plans can be listed, briefed in plain language, approved, or rejected via UI or MCP. Execution happens on Binance; AlphaPilot learns about fills only when the client calls record_fill (or the matching REST confirm endpoint), after which a Position is opened and the background position monitor evaluates exits every minute.

    Advisory MCP surface. Fifteen tools cover wiring instructions, symbol analysis, Earn and margin scans, account-context relay, proposal building, approval workflow, execution checklist, fill recording, open positions, and a “panic” explainer that re-runs analysis against a live position.

    Tech stack

    | Layer | Stack |

    |-------|--------|

    | API | FastAPI, Uvicorn, SQLAlchemy 2 (async), asyncpg, Alembic, JWT + bcrypt, SlowAPI rate limits |

    | MCP | Official Python MCP SDK (mcp==2.1.1), Streamable HTTP on port 9000 |

    | Data | PostgreSQL (users, risk policies, market sessions/candidates, trade plans, positions, account snapshots, exit signals, audit events) |

    | Market | Public Binance REST only (no Agent OS dependency for scans) |

    | Frontend | Next.js 16, React 19, TypeScript, Tailwind CSS 4 — dashboard, agent, opportunities, positions, risk, margin, earn, activity |

    | Jobs | Background worker: daily market reset (\~00:00 UTC) + continuous position monitor |

    | Deploy | Docker; Render (API, MCP server, scheduler, Postgres); Vercel (frontend) |

    | AI (optional) | OpenRouter for plain-language narration only—never for risk numbers |

    What I owned

    End-to-end design of the Option A dual-MCP architecture; implementation of the risk engine, strategy scorers, coin analysis (RSI/MACD/momentum/regime), margin and Earn modules, account-context service, trade-proposal builder, full MCP tool surface, FastAPI routes, Alembic models, Next.js operator UI, and multi-service Render deployment (including a dedicated MCP web service on Streamable HTTP).

    Outcome

    A production-shaped system where market intelligence and hard risk limits live in AlphaPilot, execution stays inside Binance’s allowlisted Agent OS path, and every sized proposal is explainable, auditable, and rejectable before capital moves.