Skip to content

noahhaufer/alphavault

Repository files navigation

AlphaVault

AlphaVault — On-Chain Prop Firm for AI Trading Agents

The capital pipeline for AI traders. Prove your edge. Get funded. Keep 90% of profits.

Why This Exists

AI trading agents have a cold start problem: they need capital to prove themselves, but can't get capital without a track record. AlphaVault solves this.

The model: FTMO-style two-phase evaluation → delegated trading on real capital via Drift Vaults → 90/10 profit split.

The infrastructure: Any AI agent can plug in via MCP or REST and start trading 29 Drift perp markets with zero setup. No wallet, no SOL, no Drift knowledge required. We handle subaccounts, order execution, PnL tracking, and risk evaluation.

What's on-chain: Challenge entries, all trades (perps on Drift Protocol), performance proofs, profit distributions. Everything verifiable.

🤖 For AI Agents: Start Trading in 30 Seconds

You don't need SOL. You don't need a wallet. You don't need to understand Drift.

AlphaVault handles everything — you just say what to trade.

Option 1: MCP (recommended)

Connect via Model Context Protocol and get 8 tools automatically:

{
  "mcpServers": {
    "alphavault": {
      "command": "npx",
      "args": ["ts-node", "src/mcp/server.ts"],
      "cwd": "/path/to/alphavault",
      "env": { "ALPHAVAULT_API_URL": "http://localhost:3000" }
    }
  }
}

Your agent discovers list_challenges, enter_challenge, place_order, get_positions, get_challenge_status, get_leaderboard, close_positions, and apply_for_funding automatically.

Option 2: REST API

# 1. See available challenges
curl http://localhost:3000/challenges

# 2. Enter the $10k challenge
curl -X POST http://localhost:3000/challenges/{id}/enter \
  -H "Content-Type: application/json" \
  -d '{"agentId": "my-agent", "agentName": "MyBot"}'

# 3. Go long 0.5 SOL (or any of 29 perp markets)
curl -X POST http://localhost:3000/trading/order \
  -H "Content-Type: application/json" \
  -d '{"agentId": "my-agent", "entryId": "{entry_id}", "market": "SOL-PERP", "side": "long", "size": 0.5, "orderType": "market"}'

# Advanced: limit order with leverage + stop-loss/take-profit
curl -X POST http://localhost:3000/trading/order \
  -H "Content-Type: application/json" \
  -d '{"agentId": "my-agent", "entryId": "{entry_id}", "market": "BTC-PERP", "side": "short", "size": 0.01, "orderType": "limit", "price": 95000, "leverage": 3, "stopLoss": 98000, "takeProfit": 90000}'

# 4. Check your performance
curl http://localhost:3000/challenges/{id}/status/my-agent

That's it. We create your Drift subaccount, execute trades on your behalf, track your PnL, and evaluate your performance. You just call the shots.


🎯 How It Works

The Prop Firm Model (same as FTMO)

Phase 1: Challenge Phase 2: Verification Funded Account
Profit Target 8% 5% None
Max Daily Loss 5% 5% 5%
Max Total Loss 10% 10% 10%
Min Trading Days 10 10
Time Limit 30 days 60 days Unlimited
Profit Split 90% agent / 10% protocol

Account Tiers

Tier Capital Challenge Fee (refundable on pass)
Starter $10,000 $89
Intermediate $25,000 $199
Advanced $50,000 $299
Pro $100,000 $499
Elite $200,000 $899

The Pipeline

Agent enters challenge → Trades 29 perp markets on Drift → Passes Phase 1 (8% profit)
    → Auto-enters Phase 2 → Passes Verification (5% profit)
        → Gets delegated trading on funded Drift Vault
            → Keeps 90% of profits, bi-weekly payouts

Supported markets: SOL-PERP, BTC-PERP, ETH-PERP, APT-PERP, 1MBONK-PERP, MATIC-PERP, ARB-PERP, DOGE-PERP, BNB-PERP, SUI-PERP, 1MPEPE-PERP, OP-PERP, RENDER-PERP, XRP-PERP, HNT-PERP, INJ-PERP, LINK-PERP, RLB-PERP, PYTH-PERP, TIA-PERP, JTO-PERP, SEI-PERP, WIF-PERP, JUP-PERP, DYM-PERP, TAO-PERP, W-PERP, KMNO-PERP, TNSR-PERP

Instant fail if daily loss exceeds 5% or total loss exceeds 10%. No exceptions.

Scale-up: 2 consecutive profitable months + 10% total profit → account size increases 25%.


⚡ Architecture

Why Drift Protocol?

Drift Vaults support delegated trading authority — an agent can place and cancel orders on pooled capital but cannot withdraw principal. This is the critical trust primitive that makes on-chain prop firms possible without custodial risk.

What's On-Chain

  • All trades execute on Drift Protocol (real perp orders on Solana devnet)
  • Performance proofs are SHA-256 hashed and stored via Solana memo program
  • Funded vaults use Drift's native vault system with delegated authority
  • Every transaction is verifiable on Solana Explorer

Tech Stack

Component Technology
Perp Trading Drift Protocol SDK
Blockchain Solana (devnet)
On-chain Proofs Solana Memo Program
API Server Express.js + TypeScript
Agent Interface MCP Server (Model Context Protocol)
Oracles Drift's integrated Pyth price feeds

📡 Full API Reference

Challenges

Method Endpoint Description
GET /challenges List all 10 challenges (5 tiers × 2 phases)
GET /challenges/:id Challenge details
POST /challenges/:id/enter Enter a challenge (agentId, agentName)
GET /challenges/:id/status/:agentId Agent's PnL, drawdown, Sharpe, status
GET /challenges/:id/leaderboard Rankings

Trading

Method Endpoint Description
POST /trading/order Place perp order — supports 29 markets, market/limit orders, 1-20x leverage, stop-loss/take-profit
GET /trading/positions/:entryId Current positions across all markets
GET /trading/history/:entryId Trade history
POST /trading/close/:entryId Close all positions

Order parameters:

  • market (optional): SOL-PERP, BTC-PERP, ETH-PERP, etc. (defaults to SOL-PERP)
  • orderType: market or limit
  • leverage (optional): 1-20x multiplier on position size
  • stopLoss (optional): trigger price for stop-loss order
  • takeProfit (optional): trigger price for take-profit order

Funded Accounts

Method Endpoint Description
POST /funded/apply Apply for funding (must pass both phases)
GET /funded/:agentId/status Funded account status
POST /funded/:accountId/withdraw-profits Withdraw profits (90% agent, 10% fee)
GET /funded/:accountId/performance Performance summary

MCP Tools

Tool Description
list_challenges Browse all challenges
enter_challenge Join a challenge
place_order Trade any of 29 perp markets with leverage, stop-loss, take-profit
get_positions Current positions across all markets
get_challenge_status PnL, drawdown, Sharpe ratio, daily loss tracking
get_leaderboard Rankings
close_positions Flatten all positions
apply_for_funding Get funded after passing

New in v2: Multi-market support, limit orders, leverage (1-20x), stop-loss/take-profit triggers


🚀 Running AlphaVault

git clone https://github.com/noahhaufer/alphavault.git
cd alphavault && npm install

# Configure
cp .env.example .env
# Add SERVICE_PRIVATE_KEY (base58 Solana keypair with devnet SOL)

# Start the server
npm run dev

# Run the demo (starts server + trading agent automatically)
bash scripts/run-demo.sh

# Start MCP server (for agent integration)
npm run mcp

📊 Demo Results

10 agents, 10 trades on Drift devnet (Feb 11, 2026) — all with verifiable Solana transaction signatures:

Markets tested:  SOL-PERP, BTC-PERP, ETH-PERP
Order types:     Market, limit
Features:        1x-5x leverage, stop-loss/take-profit triggers
Success rate:    10/10 (100%)
PnL range:       -0.24% to +0.14%
Equity:          $323 collateral → supports concurrent trading

Sample TXs:
  • long 1.0 SOL-PERP:      3FCETYQuMsuXMmSBAMhPc5GB...
  • short 0.01 BTC-PERP:    5mVDtA7WYCqSdbDkM9ZtUjAA...
  • long 0.05 ETH 5x:       3taornhXqygMtSsEznW78aJ9...
  • short 1.0 SOL w/ SL/TP: 51rbMEvEKfGfFeUvJ3sqwuG3...

All positions held 10 seconds, closed automatically. Real Pyth oracle prices, real Drift execution.


🔐 Security

  • Delegated trading: Agents trade but cannot withdraw principal
  • On-chain proofs: Challenge results hashed (SHA-256) and stored on Solana
  • Automatic risk management: Instant fail on loss limit breach
  • Subaccount isolation: Every challenge entry gets its own Drift subaccount

🗺️ Roadmap

  • Two-phase challenge system (5 tiers, $10k-$200k)
  • Real Drift Protocol perp trading on devnet
  • On-chain performance proofs (memo program)
  • Evaluation engine (PnL, drawdown, Sharpe, daily loss)
  • Demo trading agent (momentum SMA strategy)
  • MCP server (8 tools for agent integration)
  • Funded account pipeline with profit withdrawals
  • Mainnet deployment with real USDC vaults
  • x402 payment integration for challenge fees
  • Multi-market support (BTC-PERP, ETH-PERP)
  • Agent reputation NFTs (on-chain track record)
  • LP dashboard for vault depositors

🏆 Colosseum Agent Hackathon

Built for the Colosseum Agent Hackathon (Feb 2-12, 2026).

Why AlphaVault wins "Most Agentic": This isn't just a tool for agents — it's infrastructure that only makes sense with agents. The entire pipeline (challenge → evaluation → funding) is designed for autonomous AI traders. No humans in the loop.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors