ArithmoAI is your Gen-Z friendly, quant-powered, AI-supercharged crypto trading companion. Built as a Telegram bot, it unifies multi-exchange portfolio management, AI chat, quantitative metrics, technical analysis, and automated futures strategies into a single, easy-to-use interface.
- Demo : https://www.youtube.com/watch?v=N9Xf6F1b_0I
- Presentation : https://docs.google.com/presentation/d/1kzYSd4Zh7j4MuJOomFN1ouMVbSh42LQTVEyTd2r0vW8/edit?usp=sharing
-
Multi-CEX Management
- Connect Binance (and other CEX) via API keys
- View spot & futures balances, open orders, positions
- Place market buy/sell orders directly from Telegram
-
Natural-Language Interface (NLP)
- Classify messages into intents (
portfolio_health,market_sentiment,coin_analysis,should_buy,buy_token,sell_token,replace_coin,portfolio_diversity,tax_implications, etc.) - Extract symbols & amounts automatically
- Classify messages into intents (
-
QuantMetrics Integration
- Fetch Sharpe ratio, volatility, max drawdown, daily return from TokenMetrics
/quantmetricsAPI - Fetch long-form AI analyses via
/ai-reports
- Fetch Sharpe ratio, volatility, max drawdown, daily return from TokenMetrics
-
AI Chat & Summaries
- TokenMetrics AI Chat (
/tmai) for open-ended questions (βnext 100Γ coin?β) - OpenAI GPT for summarization & enrichment
- TokenMetrics AI Chat (
-
Technical Analysis (TA-Lib)
- ATR (Average True Range) β dynamic stop-loss & take-profit
- RSI, MACD, Bollinger Bands, MA (SMA/EMA) for entry/exit signals
- Entry: MA crossovers, volatility breakouts, divergence checks
-
Risk & Money Management
- Stop-Loss:
entry_price β 1.5 Γ ATR - Take-Profit:
entry_price + 2.0 Γ ATR - Position Sizing via Kelly Criterion:
f_star = (win_rate * (avg_win_loss + 1) - 1) / avg_win_loss
- Stop-Loss:
-
Automated Futures Trading
- Trend-following, mean-reversion hooks
- Scheduled checks & market orders
-
Portfolio Analysis & Rebalancing
- Real-time USD valuation via CCXT/Binance
- Allocation %, portfolio Sharpe & volatility, risk score
- Identify weakest Sharpe coin and recommend replacements from top QuantMetrics picks
-
Market Sentiment Dashboard
- Pull headlines from TokenMetrics
sentimentsAPI - Summarize & tag tokens as bullish or bearish
- Pull headlines from TokenMetrics
-
Tax & Compliance Aid
- Generate tailored tax-reporting guidance based on portfolio composition
User β Telegram Bot ββ Intent Classification β OpenAI GPT ββ QuantMetrics APIs β /quantmetrics, /ai-reports, /tmai ββ CCXT Library β Binance spot & futures ββ TA-Lib Library β ATR, RSI, MACD, Bollinger, MAβ¦ ββ OpenAI β Summarization & Q&A enhancements
-
Clone & enter
git clone https://github.com/yourname/arithmoai.git cd arithmoai -
Create & activate virtualenv
python3 -m venv venv source venv/bin/activate -
Install dependencies
pip install -r requirements.txt
-
Environment variables
Copy .env.example to .env and set:
TELEGRAM_BOT_TOKEN=your_telegram_token OPENAI_API_KEY=your_openai_key TOKENMETRICS_API_KEY=your_tokenmetrics_key
-
Run
python bot.py
Connect your Binance account if not already connected.
If already connected, it shows demo queries you can try like:
portfolio healthbuy ETH 10replace weakest coin
List currently connected exchanges and their connection status.
Trigger the automated futures strategy using quant + TA indicators.
Display your current open positions (spot + futures).
| Command | Description |
|---|---|
portfolio health |
π Detailed portfolio analytics & risk assessment |
market sentiment |
π° News summary + per-token bullish/bearish outlook |
analyze BTC |
π Coin-specific Quant & AI analysis |
should I buy SOL? |
β /β Quant signal + metrics breakdown |
which coin to buy |
β¨ Top 5 QuantMetrics picks |
buy ETH 10 |
πΈ Market-buy $10 USDT of ETH |
sell ADA all |
πΈ Market-sell your full ADA position |
replace weakest coin |
π Suggest replacement for lowest Sharpe token |
portfolio diversity |
π HHI concentration score & diversity rating |
tax implications |
π° Custom crypto tax guidance |
/auto |
π€ Run automated futures strategy with dynamic leverage |
/positions |
π€ Show current futures & spot positions |
-
GET /quantmetrics?symbol=...
β Fetches detailed quantitative metrics like Sharpe ratio, volatility, max drawdown, and average daily return. -
GET /ai-reports?symbol=...
β Returns natural-language investment analysis generated by TokenMetrics AI. -
POST /tmai
β Sends user prompts to TokenMetrics AI Chatbot for conversational insights and recommendations. -
GET /trading-signals?symbol=...
β Retrieves AI-generated buy/sell/neutral signals used for auto-futures strategies and short-term trading. -
GET /sentiments
β Provides aggregated market sentiment and recent news summaries with bullish/bearish classifications.
- Intent classification from user input
- Summarization of AI insights
- Binance spot & futures order placement
- Portfolio balance fetching
| Indicator | Technical Role | Strategy Weightage |
|---|---|---|
| ATR | Measures volatility to size stop-loss & take-profit | π’ High (SL/TP calc) |
| RSI | Identifies overbought/oversold momentum zones | π‘ Medium |
| MACD | Confirms trend direction + momentum crossover signals | π’ High (entry logic) |
| Bollinger Bands | Volatility envelopes for breakout & mean-reversion | π‘ Medium |
| SMA/EMA | Defines short/long trend bias and crossover strategies | π’ High (entry logic) |
| Stochastic RSI | Combines RSI + momentum for micro timing | π‘ Medium-Low |
| CCI | Detects price divergence vs mean (momentum filtering) | βͺ Optional |
| WMA | Weighted moving average for smoother trend reactions | βͺ Optional |
| ADX | Measures trend strength to filter weak signals | βͺ Optional |
βοΈ Only high-confidence indicators (like ATR, MACD, SMA/EMA) are directly used in auto-trading entries and stop logic. Others enhance edge in confluence zones.
The Kelly Criterion is a formula used to determine the optimal bet size for maximizing long-term capital growth while minimizing risk. It balances win probability and risk-reward ratio.
Formula:
- f* = (p Γ R - (1 - p)) / R
Where:
f*is the optimal fraction of capital to risk per tradepis the win probability (success rate)Ris the risk-reward ratio (average win / average loss)
In practice:
-
We cap
f*at 25% to reduce overexposure -
If the Kelly fraction is negative, we fallback to a safer default stop-loss (e.g., 5%)
-
Final stop-loss is calculated as:
-
SL = entry_price Γ (1 - f*) if f* > 0 SL = entry_price Γ 0.95 if f* β€ 0
This makes position sizing dynamic and risk-aware, adapting to market volatility and historical performance.
-
Entry Signal:
- Moving average crossover
- Volatility breakout (Bollinger Band spike)
-
Stop-Loss:
- SL = Entry Price - (1.5 Γ ATR)
-
Take-Profit:
- TP = Entry Price + (2.0 Γ ATR)
-
Position Sizing (Kelly Criterion):
win_rate = wins / total_trades
avg_win_loss = avg_profit / avg_loss
f_star = (win_rate * (avg_win_loss + 1) - 1) / avg_win_loss- π₯ Fetch current holdings using CCXT
- π΅ Compute USD value and % allocation of each token
- π Rank tokens by Sharpe Ratio to identify the weakest asset
- π Recommend replacement from the top QuantMetrics picks
- Fork this repository
- Create a feature branch (
git checkout -b feature-name) - Implement & test your changes
- Push your branch (
git push origin feature-name) - Open a Pull Request describing your enhancement
This project is licensed under the MIT License.
Β© Aditya Chaplot β Feel free to use, fork, and build on it.