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
Note: 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:
Verify Everything Works
Run these commands to confirm your setup:
This should print your wallet's public key (a long string of letters and numbers).
This should show the current SOL price. If it does, you're fully set up and ready to trade.
Check a Price
Watch a price live (updates every 5 seconds, press Ctrl+C to stop):
Important Things to Know
Minimum collateral >$10. If you plan to set take-profit or stop-loss on a position, you need more than $10 in collateral after fees. Use at least $11-12 to be safe.
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 at
~/.config/flash/keys/and never leave your machine. All signing happens locally.
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.)
Close a Position
Close the full position:
Close half of it:
Set Take-Profit and Stop-Loss
Place a take-profit:
Place a stop-loss:
View all your orders:
Cancel an order:
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):
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
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 at ~/.config/flash/keys/, protected by file permissions. This is the same approach the official Solana CLI uses.
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
On macOS/Linux, verify permissions:
ls -la ~/.config/flash/keys/should show-rw-------
Last updated
Was this helpful?

