Abdr007 /
flash-ui
AI-powered perpetual trading terminal for Solana — 34 markets, natural language commands, built on Flash Trade
Loading repository data…
dmustapha / repository
AI-powered perpetuals trading terminal for Pacifica: 75 live markets, Claude copilot, liquidation courtroom, real-time WebSocket feeds
A trading terminal for Pacifica's perpetual futures exchange with 75 live markets, an AI copilot powered by Elfa AI social intelligence, and a Liquidation Courtroom that detects whether market moves are organic or manufactured.
Perpetual futures are the most traded instruments in crypto, but the tools traders use are basic: a chart, an order form, and nothing else. Traders have no way to tell whether a move against their position is a genuine correction or coordinated manipulation.
AXON connects to Pacifica's REST API (9 endpoints) and WebSocket feed to provide full trading across 75 markets. It adds two layers no other terminal has: an AI copilot that combines Pacifica market data with Elfa AI social intelligence, and a Liquidation Courtroom where an AI judge evaluates whether price moves against your position are organic or manufactured.
| Trading Terminal | Portfolio Dashboard |
|---|---|
| Analytics | AI Copilot |
|---|---|
| Layer | Technology |
|---|---|
| Frontend | Next.js 16.2.3, React 19.2.4, Tailwind v4 |
| Charts | TradingView Lightweight Charts |
| State | TanStack React Query, useSyncExternalStore |
| Real-time | Pacifica WebSocket (prices, orderbook, trades) |
| AI | Claude API (copilot + courtroom), Elfa AI (social intelligence) |
| Wallet | Solana Wallet Adapter (Phantom, Solflare) |
| Signing | tweetnacl Ed25519 + bs58 (server-side) |
| Build | Turbopack, pnpm |
git clone https://github.com/dmustapha/axon.git
cd axon
pnpm install
cp .env.example .env.local
Fill in .env.local with your keys:
PACIFICA_PRIVATE_KEY=your_base58_private_key
PACIFICA_PUBLIC_KEY=your_base58_public_key
ANTHROPIC_API_KEY=your_anthropic_api_key
ELFA_API_KEY=your_elfa_api_key
The Pacifica private key is the base58 private key from the same wallet you used to create your Pacifica account.
pnpm dev
# Open http://localhost:3000
Click "Select Wallet" in the top-right corner and connect the same Phantom or Solflare wallet you used on Pacifica. The WebSocket status indicator (top-right) will show green when live data is streaming.
The left sidebar shows all 75 Pacifica markets. Filter by category (Crypto, Stocks, Forex, Commodities, Spot) or search by name. Markets are sorted by 24h volume. Click any market to load its chart and order book. Prices flash on update.
After the order fills, optionally set Take Profit and Stop Loss prices on the position.
Open positions appear in the bottom panel with real-time mark-to-market PnL. Each position shows: market, side with leverage, size, entry price, current mark price, unrealized PnL, and margin ratio. Positions with margin below 15% are highlighted in red as a liquidation warning.
Switch to the Orders tab to view open orders and order history.
The right panel has two tabs: AI Copilot and Courtroom.
The copilot answers questions about markets by combining live Pacifica data with Elfa AI social intelligence. Example prompts:
Trending tokens appear at the top of the copilot panel, showing up to 6 tokens with the most social activity. Click any token to ask the copilot about it.
When the copilot suggests a trade, it includes entry price, take profit, stop loss, and confidence score. Click the suggestion to auto-populate the order form, then review and submit.
Switch to the Courtroom tab to send any open position to the AI judge. The courtroom runs three independent evaluations:
The judge cross-references these scores. A large price move with no supporting social activity is flagged as a potential manipulation signal. The verdict includes a trust score (0-100%) and a recommendation: hold, hedge, or exit.
Positions with margin below 15% are automatically surfaced as "at-risk" for quick analysis.
Navigate to Portfolio (keyboard shortcut: 2) to see:
Navigate to Analytics (keyboard shortcut: 3) to see:
AXON uses 9 Pacifica REST API endpoints and the WebSocket feed. Every POST request is signed server-side using Ed25519 (tweetnacl + bs58), the same signing scheme Solana uses.
| Method | Endpoint | Description |
|---|---|---|
| GET | /info | Market specs for all 75 markets |
| GET | /account | Account equity, balance, margin, fee level |
| GET | /account/positions | All open positions with PnL |
| GET | /account/orders | Open orders and order history |
| POST | /orders/create_market | Place market orders |
| POST | /orders/create | Place limit and stop orders |
| POST | /orders/cancel | Cancel orders by ID or bulk |
| POST | /account/leverage | Set per-market leverage (1-200x) |
| POST | /positions/tpsl | Configure take profit / stop loss |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/account | Account balance and info |
| GET | /api/positions | Open positions |
| GET | /api/orders | Open orders (add ?history=true for history) |
| GET | /api/info | Market specifications |
| POST | /api/trade | Place order (market/limit/stop) |
| POST | /api/orders/cancel | Cancel order |
| POST | /api/positions/tpsl | Set TP/SL |
| POST | /api/copilot | AI copilot chat |
| POST | /api/courtroom | Liquidation courtroom analysis |
| GET | /api/elfa | Elfa AI social intelligence proxy |
| GET | /api/wallet | Connected wallet info |
Browser (Phantom / Solflare)
|
v
Next.js Frontend (React 19 + Tailwind v4)
|
+---> TradingView Charts (6 timeframes)
|
+---> WebSocket <---- Pacifica WS (prices, orderbook, trades)
|
v
Next.js API Routes (Ed25519 server-side signing)
|
+---> Pacifica REST API (9 endpoints)
| [signed with tweetnacl + bs58]
|
+---> Claude API (copilot + courtroom)
|
+---> Elfa AI (trending tokens, sentiment, mentions)
src/
app/
page.tsx # Main trading terminal (4-column grid layout)
layout.tsx # Root layout with providers
providers.tsx # React Query + WS + Wallet + Price providers
globals.css # Dark terminal theme design system
api/
account/route.ts # Account balance/info
copilot/route.ts # AI copilot (Claude + Elfa)
courtroom/route.ts # Liquidation courtroom AI
elfa/route.ts # Elfa social intelligence proxy
info/route.ts # Market specifications
orders/route.ts # Order list/history
orders/cancel/route.ts # Cancel orders
positions/route.ts # Open positions
positions/tpsl/route.ts # Take profit / stop loss
trade/route.ts # Place orders (market/limit/stop)
wallet/route.ts # Wallet info
components/
price-chart.tsx # TradingView chart (candlestick + lin
Selected from shared topics, language and repository description—not editorial ratings.
Abdr007 /
AI-powered perpetual trading terminal for Solana — 34 markets, natural language commands, built on Flash Trade