Flash Trade CLI
Trade on Flash Trade directly from your terminal — open positions, manage orders, provide liquidity, and check prices without touching a browser.
The CLI signs all transactions locally. Your private keys never leave your machine.
Source: GitHub
Install Rust (macOS)
The CLI is built with Rust. If you don't have Rust installed yet:
Open Terminal (press Cmd+Space, type "Terminal", hit Enter)
Paste this command and hit Enter:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shWhen prompted, type
1and hit Enter to proceed with the default installationWhen it finishes, close Terminal and reopen it (this loads the new Rust tools into your shell)
Verify it worked:
rustc --versionYou should see something like rustc 1.XX.X. If you see "command not found", close and reopen Terminal again.
Install Rust (Windows)
Go to https://rustup.rs
Click the download link — this downloads
rustup-init.exeRun
rustup-init.exeWhen prompted, type
1and hit Enter for the default installationIt may ask you to install Visual Studio C++ Build Tools — follow the link it gives you, download and install them (this is required for Rust on Windows)
When it finishes, close and reopen your terminal (Command Prompt or PowerShell)
Verify it worked:
Install Rust (Linux)
Open your terminal
Paste this command and hit Enter:
Type
1and hit Enter for the default installationClose and reopen your terminal
Verify it worked:
Install Git
You need Git to download the Flash Trade CLI code. You may already have it.
Check if Git is installed:
If you see a version number, skip ahead to Download and Build the CLI.
If you see "command not found":
macOS: A popup may ask to install Xcode Command Line Tools. Click Install and wait for it to finish. Then try
git --versionagainWindows: Download from https://git-scm.com, run the installer, accept all defaults. Close and reopen your terminal
Linux: Run
sudo apt install git(Ubuntu/Debian) orsudo dnf install git(Fedora)
Download and Build the CLI
The Flash Trade SDK is in a private GitHub repository. You need to be granted access to flash-trade/flash-contracts-closed before the build will work. Contact the Flash Trade team if you get a permission error during the build step.
Open your terminal
Choose where you want to put the code. Your home folder works fine:
Download the code:
Go into the CLI folder:
Build the CLI (this takes a few minutes the first time — it's downloading and compiling dependencies):
When it finishes, the CLI is ready at
target/release/flash. Test it:
You should see a list of commands. If you do, the build worked.
Make the CLI Easy to Run
Right now you have to type the full path every time. You can make flash available from anywhere:
macOS / Linux:
Now you can type flash from any folder.
Windows:
Copy target\release\flash.exe to a folder that's in your system PATH, or add the target\release folder to your PATH through System Settings → Environment Variables.
Set Up Your Wallet
The CLI needs a Solana wallet to sign transactions. You have two options:
Option A — Import an Existing Solana Wallet
If you already use the Solana CLI and have a keypair file:
Option B — Generate a New Wallet
If you don't have a Solana wallet yet:
This creates a new random wallet and saves it. The CLI will print the public key (your wallet address). Fund this wallet with SOL and USDC before trading.
Set Your Active Wallet
Tell the CLI which wallet to use:
(Replace main with whatever name you used in the previous step — trading if you went with Option B.)
Set Up Your RPC (Optional but Recommended)
An RPC is how the CLI talks to the Solana network. The default public RPC works but is slow and rate-limited. For a better experience, use a dedicated provider like Helius, Triton, or QuickNode. Most have free tiers.
Once you have an RPC URL:
The CLI has RPC failover enabled by default — if your primary RPC goes down, it automatically falls back to the Solana Labs public RPC and warns you once. To add additional fallback endpoints:
To disable failover (strict single-endpoint mode):
flash config set rpc_url https://... saves the URL (including any API key) into settings.json with 0o600 permissions. The URL also lands in your shell history. After setting an RPC URL that contains a secret, consider clearing the history entry:
bash:
history -d $(history 1)zsh: run
fc -pto push a clean history stack for the current session
Verify Everything Works
Run these commands in order to confirm your setup:
Confirms the binary is installed.
This should print your wallet's public key (a long string of letters and numbers).
This should show the current SOL price.
This should list all available trading markets.
This should show your open positions (or "No open positions"). This is the first command that actually hits your RPC — if it errors but flash price SOL worked, your RPC is the issue. See Troubleshooting below.
Troubleshooting — RPC Errors
The CLI talks to Solana through your configured RPC endpoint. If that endpoint is misconfigured, dead, or rate-limited, commands that read/write on-chain data will fail — even though flash price SOL (which pulls from Pyth's Hermes service, not your RPC) keeps working.
401 Unauthorized
RPC API key is invalid, expired, or revoked
Rotate the key at your provider's dashboard, then flash config set rpc_url <new-url>
403 Forbidden
RPC key is valid but not allowed to call getProgramAccounts (some free tiers restrict this)
Upgrade the plan or switch providers
429 Too Many Requests
Public RPC rate limit hit
Set a dedicated RPC URL
Failed to fetch program accounts with no HTTP code
Network outage or DNS failure
Check your internet connection and provider status page
Keypair 'X' not found in keystore
active_key refers to a key you haven't imported
Run flash keys list to see what's there, then flash keys use <name>
Important Things to Know
Minimum collateral >$10. Limit orders, take-profit, and stop-loss all require more than $10 in collateral after fees. If you open a $10 position and try to attach a TP/SL later, it will fail because fees have already eaten the collateral below $10. Use at least $11-12.
Mainnet only for prices. The price feeds come from Pyth and only work on mainnet. Devnet will show stale or zero prices.
SOL positions use JitoSOL as the underlying collateral on-chain. This is automatic — you don't need to do anything different.
Every trade asks for confirmation. The CLI always shows you a preview and asks you to type
ybefore submitting. You can always cancel.Your keys stay local. Private keys are stored in your platform's config directory and never leave your machine. All signing happens locally.
RPC failover is on by default. If your primary RPC fails, the CLI automatically tries fallback endpoints. You'll see a one-time warning on the first failover.
Check a Price
Watch a price live (updates every 5 seconds, press Ctrl+C to stop):
Open a Position
The CLI will show you a preview of the trade (entry price, fees, leverage, liquidation price) and ask you to confirm before sending anything.
View Your Positions
This shows all your open positions with live PnL, leverage, entry price, and liquidation price.
To see details on one specific position:
(Replace <PUBKEY> with the position's public key from the positions list.)
For an aggregated summary across all your open positions (total notional, total collateral, PnL):
Close a Position
Close the full position:
To close part of a position, use perps decrease with a USD size to remove:
Set Take-Profit and Stop-Loss
Place a take-profit:
Place a stop-loss:
View all your orders:
Cancel an order (specify --type tp or --type sl):
Cancel all trigger orders for a market:
Place a Limit Order
This places an order to go 3x long SOL with $50 when the price hits $120.
Adjust Your Position
Add more size:
Remove size:
Add collateral (makes your position safer — moves liquidation price further away):
Remove collateral (increases your leverage — moves liquidation price closer):
Amount is in the position's collateral token, not USD. For a short or a */USDC position, the token is USDC, so 5 means 5 USDC. For a SOL/SOL long the token is SOL, so 5 means 5 SOL. Check flash perps position <PUBKEY> to see what currency the position is margined in. The CLI's preview screen will show the token symbol on the "Amount" line so you can confirm before submitting.
Provide Liquidity
See available pools:
Deposit USDC into a pool:
Withdraw from a pool:
Stake FLP
Stake your FLP tokens to earn rewards:
Unstake (instant, pays a fee):
Collect staking rewards:
View All Markets
See details on a specific market:
Change Settings
View your current settings:
Change a setting:
Reset everything to defaults:
cluster
mainnet-beta
Which Solana network to use
rpc_url
(auto)
Your RPC endpoint
default_slippage_bps
100
Slippage tolerance (100 = 1%)
priority_fee
100000
Transaction priority fee in microlamports
output_format
table
table for readable output, json for scripts
rpc_failover
on
Auto-fallback to backup RPCs when primary fails
rpc_fallbacks
(none)
Comma-separated list of backup RPC URLs
Manage Wallets
List all saved wallets:
Show a wallet's public key:
Delete a wallet:
Switch to a different wallet:
Wallet Security
Your wallets are stored as unencrypted JSON files in a platform-specific config directory, protected by file permissions. This is the same approach the official Solana CLI uses.
settings.json is in that directory; keypairs are under keys/<name>.json with 0o600 permissions (and the keys/ directory with 0o700).
Recommendations:
Use a dedicated wallet with limited funds for trading — don't import your main wallet
For large amounts, use a hardware wallet with the Flash Trade web UI instead
Verify permissions on the keys directory:
macOS:
ls -la "$HOME/Library/Application Support/flash/keys/"— should show-rw-------Linux:
ls -la ~/.config/flash/keys/— should show-rw-------
macOS
~/Library/Application Support/flash/
Linux
~/.config/flash/ (or $XDG_CONFIG_HOME/flash/ if set)
Windows
%APPDATA%\flash\
Last updated
Was this helpful?

