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: GitHubarrow-up-right


Install Rust (macOS)

The CLI is built with Rust. If you don't have Rust installed yet:

  1. Open Terminal (press Cmd+Space, type "Terminal", hit Enter)

  2. Paste this command and hit Enter:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  1. When prompted, type 1 and hit Enter to proceed with the default installation

  2. When it finishes, close Terminal and reopen it (this loads the new Rust tools into your shell)

  3. Verify it worked:

rustc --version

You should see something like rustc 1.XX.X. If you see "command not found", close and reopen Terminal again.


Install Rust (Windows)

  1. Click the download link — this downloads rustup-init.exe

  2. Run rustup-init.exe

  3. When prompted, type 1 and hit Enter for the default installation

  4. It 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)

  5. When it finishes, close and reopen your terminal (Command Prompt or PowerShell)

  6. Verify it worked:


Install Rust (Linux)

  1. Open your terminal

  2. Paste this command and hit Enter:

  1. Type 1 and hit Enter for the default installation

  2. Close and reopen your terminal

  3. Verify it worked:


Install Git

You need Git to download the Flash Trade CLI code. You may already have it.

  1. Check if Git is installed:

If you see a version number, skip ahead to Download and Build the CLI.

  1. 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 --version again

    • Windows: Download from https://git-scm.comarrow-up-right, run the installer, accept all defaults. Close and reopen your terminal

    • Linux: Run sudo apt install git (Ubuntu/Debian) or sudo 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-closedarrow-up-right before the build will work. Contact the Flash Trade team if you get a permission error during the build step.

  1. Open your terminal

  2. Choose where you want to put the code. Your home folder works fine:

  1. Download the code:

  1. Go into the CLI folder:

  1. Build the CLI (this takes a few minutes the first time — it's downloading and compiling dependencies):

  1. 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.)


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 Heliusarrow-up-right, Tritonarrow-up-right, or QuickNodearrow-up-right. 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):


circle-info

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 y before 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:

Setting
Default
What It Does

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:


triangle-exclamation

Wallet Security

Last updated

Was this helpful?