Skip to content

bigmacman1129/solana-trading-platform

Repository files navigation

⚡ Vireonix Trading Platform

A modern Solana arbitrage & trading desktop application built with Python and CustomTkinter. Detects cross-DEX price imbalances in real time using Jupiter's v6 quote API and executes circular arbitrage trades (A → B → A) automatically or on demand.


Demo

Vireonix Demo


Features

Arbitrage Engine

  • Circular arbitrage detection — queries Jupiter v6 for A→B then B→A quotes on every monitored pair simultaneously
  • Cross-DEX coverage — Jupiter routes through Raydium, Orca, Meteora, Phoenix, and more automatically
  • 8 default pairs pre-loaded: SOL/USDC, SOL/USDT, SOL/JUP, SOL/RAY, SOL/BONK, SOL/WIF, USDC/USDT, USDC/RAY
  • Configurable risk controls — min profit %, max position size (SOL), slippage BPS, scan interval
  • Auto-execute mode — engine executes the best opportunity each scan cycle automatically
  • Manual execute — select any detected opportunity and trigger the swap yourself

Dashboard & UI

  • 6-view navigation — Dashboard, Arbitrage Scanner, Portfolio, Trade, History, Settings
  • Live stats cards — total profit, opportunities found, trades executed, scan count
  • Spread monitor — shows price impact and mid-amounts for every scanned pair
  • Portfolio view — live wallet holdings with token logos, balances, and USD estimates
  • Live price chart — real-time price graph with color-coded up/down segments
  • Price change table — 1m / 5m / 15m / 30m / 1h / 6h / 24h changes per token
  • Telegram channel feed — live messages from any Telegram chat/channel inside the app
  • Trade history — separate tabs for arbitrage trades and manual swaps with Solscan links

Notifications

  • Telegram bot alerts — sends a message when an arbitrage trade executes
  • Twilio phone call — calls you when a token hits a configured price target

Tech Stack

Layer Technology
UI Python 3, CustomTkinter, Matplotlib
Blockchain solana-py, solders, Jupiter Python SDK
Arbitrage aiohttp + Jupiter v6 Quote API
Swap execution SolanaTracker DEX aggregator
Notifications Telethon (Telegram), Twilio
Storage SQLite (vireonix.db)
Config python-dotenv

Getting Started

1. Clone the repo

git clone https://github.com/meat29/Solana_trading_platform.git
cd Solana_trading_platform

2. Create a virtual environment

python -m venv venv
# Windows
venv\Scripts\activate
# macOS / Linux
source venv/bin/activate

3. Install dependencies

pip install -r requirements.txt

4. Configure environment variables

Copy .env.example to .env and fill in your values:

cp .env.example .env
# Solana wallet public address (for portfolio display)
wallet_address=YOUR_WALLET_PUBLIC_KEY

# Solana RPC endpoint
solana_endpoint=https://api.mainnet-beta.solana.com

# Optional: QuikNode URL for token price data (faster)
QUIKNODE_URL=https://your-endpoint.quiknode.pro/YOUR_KEY/addon/912

# Telegram feed (get api_id / api_hash from https://my.telegram.org)
api_id=YOUR_TELEGRAM_API_ID
api_hash=YOUR_TELEGRAM_API_HASH
TELEGRAM_BOT_TOKEN=YOUR_BOT_TOKEN
TELEGRAM_USER_ID=YOUR_USER_ID
CHAT_IDENTIFIER=@your_channel

# Twilio (optional, for phone call alerts)
TWILIO_ACCOUNT_SID=TWILIO_ACCOUNT_SID
TWILIO_AUTH_TOKEN=your_auth_token
TWILIO_FROM=+12025550100
TWILIO_TO=+19175550100

Never commit your .env file. It is already in .gitignore.

5. Run the app

python main.py

How Arbitrage Works

1. Engine sends Jupiter v6 quote requests for every monitored pair in parallel

2. For pair SOL → USDC:
   • Quote A→B: how many USDC do I get for 0.05 SOL?
   • Quote B→A: how much SOL do I get back for that USDC?

3. Net profit = output_lamports − input_lamports − tx_fees (~0.000025 SOL)

4. If profit % ≥ threshold → opportunity flagged

5. Jupiter's best-route selection means A→B may route through Raydium
   while B→A routes through Orca, capturing a real price imbalance.

6. Execute: first leg swap via SolanaTracker aggregator

Navigation Guide

View Description
Dashboard Overview stats + recent opportunities table. Start/stop engine here.
Arbitrage Scanner Full scanner controls, pair management, live opportunities, spread monitor
Portfolio Wallet token holdings fetched live from chain
Trade Manual swap by entering input/output mint addresses, with live chart
History All arbitrage trades and manual swaps with Solscan deep-links
Settings Wallet key import, RPC, Telegram/Twilio credentials, risk controls

Database

The app uses a local SQLite database vireonix.db with three tables:

Table Contents
wallet Encrypted-at-rest private key (one row)
token_purchases Manual swap history with weighted avg price
arbitrage_trades Every executed arbitrage: pair, profit, DEX routes, TX id

Security Notes

  • Private key is stored in vireonix.db locally — never pushed to any server
  • Use a dedicated trading wallet with only the funds you intend to trade; never use your main wallet
  • All credentials (Twilio, Telegram, QuikNode) are loaded from .envno secrets in source code
  • Add .env and vireonix.db to .gitignore before committing

Troubleshooting

Problem Fix
aiohttp import error pip install aiohttp
Jupiter quotes returning errors Check your internet connection; Jupiter API has rate limits
Swap fails with "insufficient funds" Ensure wallet has enough SOL for the trade + priority fees (~0.001 SOL)
Telegram feed not loading Verify api_id and api_hash in .env; run python main.py and check the Settings → Telegram Feed tab
Price chart blank Enter the token's mint address and click Chart; requires Raydium to list the token
Private key rejected Must be base58 encoded (Phantom export format)

Project Structure

Solana_trading_platform/
├── main.py              # Desktop UI — 6-view navigation app
├── arbitrage.py         # Async arbitrage engine (Jupiter v6)
├── solanatracker.py     # Swap execution via SolanaTracker aggregator
├── requirements.txt
├── .env.example         # Template — copy to .env
└── vireonix.db          # Auto-created on first run (gitignored)

License

MIT License — see LICENSE for details.



Contributing

Pull requests are welcome. For major changes, open an issue first. Please use a testnet wallet when developing swap-related features.

About

A Python-powered Solana arbitrage trading platform that detects and executes cross-DEX opportunities in real time using Jupiter, with portfolio tracking, live analytics, and automated trading features.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages