Skip to content

Configuration (.env)

All settings are environment variables. Create a .env file in the directory where you run flash:

bash
touch .env

Flash Terminal loads .env files in this order (later overrides earlier):

  1. ~/.flash/.env (global defaults)
  2. ./.env (project-level)
  3. Shell environment variables (highest priority)

You can also use ~/.flash/config.json for persistent configuration.

Minimal Setup

For simulation mode, you need nothing. For live trading:

bash
# Where your wallet file is
WALLET_PATH=~/.config/solana/id.json

# How the CLI connects to Solana
RPC_URL=https://api.mainnet-beta.solana.com

# false = live trading
SIMULATION_MODE=false

Full Reference

Core

VariableDefaultDescription
RPC_URLhttps://api.mainnet-beta.solana.comSolana RPC endpoint (HTTPS required)
WALLET_PATH~/.config/solana/id.jsonPath to Solana keypair JSON file
SIMULATION_MODEtruetrue = paper trading, false = live
NETWORKmainnet-betaSolana network (mainnet-beta only)

Backup RPC

VariableDefaultDescription
BACKUP_RPC_1First backup RPC endpoint
BACKUP_RPC_2Second backup endpoint

Trading Defaults

VariableDefaultDescription
DEFAULT_POOLCrypto.1Default trading pool
DEFAULT_LEVERAGE2Default leverage (1-100)
DEFAULT_SLIPPAGE_BPS150Slippage tolerance in basis points (150 = 1.5%)

Trade Limits (Signing Guard)

VariableDefaultDescription
MAX_COLLATERAL_PER_TRADE0 (unlimited)Max collateral per trade in USD
MAX_POSITION_SIZE0 (unlimited)Max position size in USD
MAX_LEVERAGE0 (unlimited)Max leverage multiplier
MAX_TRADES_PER_MINUTE10Rate limit: trades per minute
MIN_DELAY_BETWEEN_TRADES_MS3000Minimum milliseconds between trades

Compute Units

VariableDefaultDescription
FLASH_DYNAMIC_CUtrueSimulate each TX to measure actual CU usage
FLASH_CU_BUFFER_PCT20Buffer % added to measured CU
COMPUTE_UNIT_LIMIT220000Static CU limit (when dynamic is off)
COMPUTE_UNIT_PRICE100000Priority fee in micro-lamports
FLASH_LEADER_ROUTINGtrueUse leader scheduling for faster landing
FLASH_REBROADCAST_MS800Rebroadcast interval in milliseconds

DYNAMIC CU

FLASH_DYNAMIC_CU=true (the default) simulates your transaction first to measure actual compute usage, then adds a buffer. This prevents overpaying while avoiding "exceeded CU limit" failures.

Logging

VariableDefaultDescription
LOG_FILELog file path (optional)
SESSION_TIMEOUT_MS900000Keypair inactivity timeout (15 min)

Referral

VariableDefaultDescription
REFERRER_ADDRESSFlash Terminal defaultReferrer wallet for trade rebates

Viewing Active Config

Inside Flash Terminal:

bash
config

Shows all currently loaded settings and their resolved values.

Config File (~/.flash/config.json)

For persistent settings that apply across all projects:

json
{
  "rpc_url": "https://mainnet.helius-rpc.com/?api-key=YOUR_KEY",
  "backup_rpc_urls": ["https://api.mainnet-beta.solana.com"],
  "default_leverage": 2,
  "default_slippage_bps": 150,
  "max_collateral_per_trade": 1000,
  "max_leverage": 50
}

Priority: shell env > .env > config.json > built-in defaults.

Next Steps

Flash Terminal — Professional Trading CLI for Flash Trade on Solana