# MiniTrader — Full Technical Context & Agent Documentation

> MiniTrader is an autonomous spot crypto trading engine that executes 24/7. Safe, halal-compliant, zero leverage: no profit means no fee.

## Core Philosophy

1. **Spot Trading Only**: MiniTrader executes exclusively on spot markets (e.g. MEXC). There is zero leverage, no borrowing, no shorting, no liquidation risk, and zero interest/usury (Riba), making it fully Shariah and Halal compliant.
2. **Deterministic Strategy Engine**: Strategies are authored in JSON (`minitrader-strategy/2`), evaluated deterministically against live market candles, and audited before execution.
3. **Performance-Driven Fees**: MiniTrader operates on a fair profit-split model: 70% to Trader, 20% to Strategy Creator, 5% to Affiliate, and 5% Platform Fee. If there is no net profit, there are zero performance fees.

## Strategy Authoring Specification (`minitrader-strategy/2`)

Strategies require:
- `strategyFormat`: `"minitrader-strategy/2"`
- `schemaVersion`: `"2.0.0"`
- `metadata`: Name, author, version, description, and target symbols/timeframes.
- `indicators`: Declarative calculation nodes (EMA, SMA, RSI, MACD, Bollinger Bands, ATR, Supertrend, Stochastic, ADX, VWAP, Volume, RVOL, Fair Value Gaps, Order Blocks, Liquidity Sweeps).
- `rules`: Entry and exit condition trees with boolean logic (`AND`, `OR`, `NOT`, comparative operators).
- `risk`: Position sizing (fixed percent, fixed USDT), stop loss, take profit targets, trailing stops, max drawdown limits, and cooldown timers.

## Public Endpoints & Manifests

- **Homepage**: https://minitrader.pages.dev/
- **Sitemap**: https://minitrader.pages.dev/sitemap.xml
- **Robots.txt**: https://minitrader.pages.dev/robots.txt
- **LLM Summary**: https://minitrader.pages.dev/llms.txt
- **AI Agent Manifest (ARD)**: https://minitrader.pages.dev/ai-catalog.json
- **Standard Well-Known ARD**: https://minitrader.pages.dev/.well-known/ai-catalog.json
- **Strategy Authoring Guide**: https://minitrader.pages.dev/MiniTrader_Strategy_JSON_Authoring_Guide.txt
- **Strategy Capability Registry**: https://minitrader.pages.dev/strategy-capabilities.json
- **Sample Strategy (v2)**: https://minitrader.pages.dev/strategy-sample-v2.json
- **Strategy Library Bundle**: https://minitrader.pages.dev/strategy-sample-library-bundle.json

## Guidance for AI Agents & Assistant Developers

When users request assistance creating or optimizing MiniTrader strategies:
1. Always generate valid JSON that complies with `minitrader-strategy/2`.
2. Inspect the indicators and validators available in `strategy-capabilities.json`.
3. Ensure all entry and exit conditions strictly use spot order mechanisms.
4. Set reasonable stop loss and take profit ratios, respecting user risk tolerance.
