lirium-trading
lirium-trading
Lirium is a modern live trading platform that uses AI to automatically calculate optimal Take Profit (TP) and Stop Loss (SL) levels. Users simply click BUY or SELL, and Claude AI analyzes market conditions to determine the best risk management levels.
Repository Details
README
š Lirium - AI-Powered Live Trading Platform
<div align="center">One-Click Trading with AI-Calculated TP/SL Levels
</div>š Table of Contents
- Overview
- Features
- Tech Stack
- Project Structure
- Setup Instructions
- API Keys Required
- Deployment
- Usage Guide
šÆ Overview
Lirium is a modern live trading platform that uses AI to automatically calculate optimal Take Profit (TP) and Stop Loss (SL) levels. Users simply click BUY or SELL, and Claude AI analyzes market conditions to determine the best risk management levels.
How It Works:
- User selects symbol (EUR/USD or XAU/USD)
- User clicks BUY or SELL
- AI analyzes recent price history, volatility, and trends
- AI calculates optimal TP/SL with minimum 2:1 risk-reward ratio
- Trade executes on MT5 via MetaAPI
- Live price updates via Supabase Realtime
⨠Features
- š¤ AI-Powered TP/SL - Claude AI calculates optimal levels
- š TradingView Charts - Professional lightweight charts
- ā” Real-Time Prices - Live updates via Supabase Realtime
- šØ Beautiful UI - Tailwind CSS + shadcn-vue components
- š MT5 Integration - Execute trades on real MT5 accounts
- š Secure - Row-level security with Supabase
- š± Responsive - Works on desktop and mobile
š ļø Tech Stack
Frontend
- Nuxt.js 4 - Vue 3 framework
- Tailwind CSS - Utility-first styling
- TradingView Lightweight Charts - Financial charts
- shadcn-vue - UI components
- Lucide Icons - Icon library
Backend
- Supabase - PostgreSQL database + real-time + auth
- Supabase Edge Functions - Serverless Deno functions
- MetaAPI - MT5 broker integration
- Anthropic Claude API - AI TP/SL calculation
š Project Structure
lirium-trading/
āāā frontend/ # Nuxt.js 4 application
ā āāā assets/
ā ā āāā css/main.css # Tailwind styles
ā āāā components/
ā ā āāā TradingChart.vue # TradingView chart
ā ā āāā ui/ # shadcn components
ā āāā pages/
ā ā āāā index.vue # Main trading page
ā āāā plugins/
ā ā āāā supabase.client.ts # Supabase plugin
ā āāā nuxt.config.ts
ā āāā tailwind.config.js
ā āāā package.json
ā
āāā backend/ # Supabase backend
ā āāā supabase/
ā ā āāā functions/
ā ā āāā calculate-tpsl/ # AI TP/SL calculator
ā ā āāā execute-trade/ # Trade execution
ā ā āāā price-feed/ # Price updates
ā āāā supabase-schema.sql # Database schema
ā
āāā README.md
š Setup Instructions
Prerequisites
- Node.js 18+ and npm
- Supabase account
- MetaAPI account (for MT5)
- Anthropic API key (for Claude)
Step 1: Clone the Repository
git clone <your-repo>
cd lirium-trading
Step 2: Frontend Setup
cd frontend
npm install
cp .env.example .env
Edit .env:
SUPABASE_URL=your_supabase_project_url
SUPABASE_ANON_KEY=your_supabase_anon_key
METAAPI_TOKEN=your_metaapi_token
METAAPI_ACCOUNT_ID=your_mt5_account_id
Step 3: Supabase Setup
-
Create Supabase Project
- Go to supabase.com
- Create new project
- Copy Project URL and Anon Key
-
Run Database Schema
# In Supabase SQL Editor, run: cd ../backend # Copy contents of supabase-schema.sql and run in Supabase SQL Editor -
Deploy Edge Functions
# Install Supabase CLI npm install -g supabase # Login supabase login # Link project supabase link --project-ref your-project-ref # Set secrets supabase secrets set ANTHROPIC_API_KEY=your_claude_api_key supabase secrets set METAAPI_TOKEN=your_metaapi_token supabase secrets set METAAPI_ACCOUNT_ID=your_account_id # Deploy functions supabase functions deploy calculate-tpsl supabase functions deploy execute-trade supabase functions deploy price-feed -
Setup Realtime
- In Supabase Dashboard ā Database ā Replication
- Enable realtime for
pricestable
-
Setup Cron Job (Price Feed)
- Go to Database ā Cron Jobs (pg_cron extension)
- Add job to run
price-feedevery 2 seconds
Step 4: Get API Keys
MetaAPI (MT5 Integration)
- Go to metaapi.cloud
- Sign up and create account
- Get API token from Dashboard
- Connect your MT5 account (demo recommended for testing)
- Copy Account ID
Anthropic Claude API
- Go to console.anthropic.com
- Create API key
- Copy key (starts with
sk-ant-...)
Step 5: Run the Application
# Frontend
cd frontend
npm run dev
# Open http://localhost:3000
š API Keys Required
| Service | Purpose | Get It From | |---------|---------|-------------| | Supabase URL | Database & Realtime | supabase.com | | Supabase Anon Key | Client auth | Supabase Dashboard | | MetaAPI Token | MT5 connection | metaapi.cloud | | MetaAPI Account ID | Your MT5 account | MetaAPI Dashboard | | Anthropic API Key | Claude AI | console.anthropic.com |
š¦ Deployment
Frontend (Vercel/Netlify)
cd frontend
npm run build
# Deploy to Vercel
vercel
# Or Netlify
netlify deploy
Backend (Supabase)
- Edge Functions auto-deploy via Supabase CLI
- Database hosted on Supabase
š Usage Guide
Making a Trade
- Select Symbol: Click EUR/USD or XAU/USD button
- Adjust Lot Size: Use +/- buttons or type directly
- Review AI Signal: Check AI recommendation (BUY/SELL)
- Click BUY or SELL: Opens confirmation modal
- Review TP/SL: AI-calculated levels shown
- Confirm: Trade executes on MT5
Monitoring Trades
- Live Chart: Real-time price updates every 2 seconds
- Recent Trades: See last 3 trades with P&L
- Balance: Top-right corner shows account balance
Understanding AI Analysis
The AI considers:
- Recent price volatility (ATR)
- Support/Resistance levels
- Risk-Reward ratio (min 2:1)
- Market trend direction
šØ Important Notes
- ā ļø Test First: Use MetaAPI demo account before live trading
- š° Risk Management: AI suggests levels but always review
- š Costs: MetaAPI ~$50/month, Anthropic pay-per-use
- š Security: Never commit
.envfiles - š Regulations: Check local trading platform laws
š Troubleshooting
Price Updates Not Working
- Check Supabase Realtime is enabled for
pricestable - Verify
price-feedEdge Function is deployed - Check cron job is running
Trades Not Executing
- Verify MetaAPI credentials in Supabase secrets
- Check MT5 account is connected in MetaAPI dashboard
- Review Edge Function logs:
supabase functions logs execute-trade
AI Not Calculating TP/SL
- Verify Anthropic API key in Supabase secrets
- Check Edge Function logs:
supabase functions logs calculate-tpsl - Ensure you have API credits
š License
MIT License - See LICENSE file
š¤ Contributing
Pull requests welcome! Please read CONTRIBUTING.md first.
š Support
- š§ Email: support@lirium.trading
- š¬ Discord: Join Server
- š Docs: docs.lirium.trading
<div align="center">
Built with ā¤ļø using Nuxt.js, Supabase, and Claude AI
ā Star this repo if you found it helpful!
</div>