Payments, Wallets and Trading on Solana
Sol is a command-line tool that lets you work with Solana the way you'd
describe it out loud. Instead of constructing transactions and managing
program instructions, you say what you want: pay someone, buy a token,
stake your SOL.
Keys live locally on disk β no private keys in environment variables,
no API keys to configure.
Get Set Up
Prefer npx with @latest β it always runs the latest version with no
global install to manage:
npx @solana-compass/cli@latest config set rpc.url https://your-rpc-endpoint.com
npx @solana-compass/cli@latest wallet create --name my-wallet
If the user has installed globally (npm install -g @solana-compass/cli),
you can use the shorter sol command instead:
sol config set rpc.url https://your-rpc-endpoint.com
sol wallet create --name my-wallet
The public RPC endpoint rate-limits aggressively. Use a dedicated RPC
for anything beyond testing β Helius, Triton, and QuickNode all offer
free tiers.
Requires Node.js >= 20.
Pay Someone
Send SOL, USDC, or any Solana token to a wallet address.
sol token send 50 usdc GkX...abc
sol token send 2 sol 7nY...xyz
sol token send 1000 bonk AgE...def --yes
See references/trading-commands.md for the full send reference.
Discover Tokens
Browse the Solana token ecosystem β trending, most traded, recently
launched, and more.
sol token browse trending
sol token browse top-traded --interval 24h
sol token browse recent --limit 10
sol token browse lst
Results populate the local token cache, so subsequent token info and
token price calls resolve instantly.
See references/trading-commands.md for all categories and flags.
Buy and Sell Tokens
Swap any token for any other token. Queries Jupiter and DFlow in
parallel and picks the best price automatically.
sol token swap 50 usdc bonk
sol token swap 1.5 sol usdc
sol token swap 50 usdc bonk --quote-only
sol token swap 50 usdc bonk --router jupiter
Every swap records the price at execution time, so you can track
cost basis and P&L later.
See references/trading-commands.md for slippage, wallet selection, etc.
DCA (Dollar-Cost Averaging)
Set up recurring buys that execute automatically over time.
sol token dca new 500 usdc sol --every day --count 10
sol token dca new 1000 usdc bonk --every hour --count 20
sol token dca list
sol token dca cancel <orderKey>
Constraints: $100 total minimum, at least 2 orders, $50/order minimum.
Intervals: minute, hour, day, week, month.
Limit Orders
Place orders that execute when a token hits your target price.
sol token limit new 50 usdc bonk --at 0.000003
sol token limit new 0.5 sol usdc --at 0.90
sol token limit list
sol token limit cancel <orderKey>
Use --quote-only to preview the order plan without placing it.
Check Prices
sol token price sol
sol token price sol usdc bonk eth
See What You Have
sol wallet balance
sol wallet balance trading
sol token list
sol wallet list
Create and Manage Wallets
Wallets are local key files in ~/.sol/wallets/ β no seed phrases
in environment variables.
sol wallet create
sol wallet create --name trading
sol wallet import --solana-cli
sol wallet set-default trading
Any command can target a specific wallet with --wallet <name>.
See references/wallet-commands.md for import, export, labels, history.
Stake SOL
Delegate SOL to a validator and earn staking rewards. One command
handles the entire process β creating the stake account, funding it,
and delegating.
sol stake new 10
sol stake list
sol stake claim-mev
sol stake withdraw 7gK...abc
See references/staking-commands.md for validator selection, partial
withdrawals, and force unstake.
Earn Yield by Lending
Compare rates and lend across five protocols β Kamino, MarginFi,
Drift, Jupiter Lend, and Loopscale. The CLI auto-picks the best
rate, or you can target a specific protocol with --protocol.
sol lend rates usdc
sol lend deposit 100 usdc
sol lend deposit 5 sol --protocol kamino
sol lend borrow 500 usdc --collateral sol
sol lend positions
See references/lending-commands.md for full details.
Earn Yield in Vaults
Managed yield vaults across Kamino Earn and Loopscale. Unlike raw
lending, vaults handle strategy management automatically β you deposit
a token and the protocol optimizes yield. The CLI auto-picks the
highest APY vault, or you can target a specific protocol or vault.
sol earn usdc
sol earn sol
sol earn
sol earn deposit 100 usdc
sol earn deposit 5 sol --protocol kamino
sol earn positions
sol earn withdraw max usdc
sol earn withdraw 50 usdc --protocol loopscale
Earn positions appear in sol portfolio alongside tokens, staking,
lending, and LP.
Provide Liquidity
Add liquidity to pools across Orca, Raydium, Meteora, and Kamino.
Browse pools by TVL/APY/volume, deposit with flexible price ranges,
track positions with P&L and impermanent loss, and farm for extra
rewards.
sol lp pools sol usdc
sol lp pools --sort apy --type clmm
sol lp deposit HJPj...abc 100 usdc --range 10
sol lp positions
sol lp claim 9xK...abc
sol lp withdraw 9xK...abc
See references/lp-commands.md for full details including farming,
pool creation, and protocol-specific flags.
Trade Prediction Markets
Browse and trade prediction markets from Polymarket and Kalshi via
Jupiter. Categories include crypto, sports, politics, culture, and more.
sol predict list crypto
sol predict search "solana"
sol predict event POLY-89525
sol predict market POLY-701571
sol predict buy 5 yes POLY-701571
sol predict positions
sol predict sell <positionPubkey>
sol predict claim <positionPubkey>
sol predict history
Positions appear in sol portfolio with unrealized P&L.
See references/prediction-commands.md for the full reference.
Pay for APIs with x402
Fetch URLs that require payment via the x402 protocol. Works like
curl β stdout is the response body, payment info goes to stderr.
sol fetch https://api.example.com/data
sol fetch https://api.example.com/data --dry-run
sol fetch https://api.example.com/data --max 0.05
sol fetch https://api.example.com/rpc \
-X POST -d '{"query":"..."}' \
-H "Accept: application/json"
If the server returns 402 Payment Required, the CLI signs a USDC
transfer and retries with the payment attached. The server submits
the transaction β your wallet only partially signs.
Use --dry-run to inspect the cost before paying. Use --max to
set a spending cap. Output is pipe-friendly by default (body on
stdout, payment info on stderr).
See references/fetch-commands.md for the full reference including
curl flag mapping and JSON output format.
Track How Your Portfolio Is Doing
See everything in one place β tokens, staked SOL, lending positions,
and open orders.
sol portfolio
sol portfolio compare
sol portfolio pnl
The portfolio view includes active DCA and limit orders with fill
progress, so locked capital is always visible. A snapshot is taken
automatically on each view (rate-limited to every 5 minutes), so
sol portfolio compare always has recent data.
See references/portfolio-commands.md for snapshot management.
Structured Output
Every command supports --json for structured output, but the
default human-readable output is designed to be easy to read and
interpret β both for humans and LLM agents. Use human-readable
output unless you are scripting or chaining commands in an
automation pipeline.
The human output uses formatted tables, signposts next actions,
and shows full IDs and addresses so you can copy-paste them into
follow-up commands. See each command reference for example output.
For programmatic use, --json returns a CommandResult<T> envelope:
{ "ok": true, "data": { ... }, "meta": { "elapsed_ms": 450 } }.
See references/json-output-format.md for the full schema.
Other Useful Commands
sol network
sol tx 4xK9...abc
sol config set rpc.url <url>
Tips
- Keep SOL for gas. Every Solana transaction costs ~0.000005 SOL,
but token account creation costs ~0.002 SOL. Unless the user
specifically asks to drain or close a wallet, keep at least 0.05 SOL
as a reserve so future transactions don't fail.
- Use full numbers, not shorthand. The CLI expects literal
amounts:
1000000 not 1m, 50000 not 50k. Always expand
shorthand before passing to a command.
- Addresses are raw public keys only. The CLI does not resolve
.sol domains, SNS names, or contact labels β pass the full base58
public key for recipients.
- Ambiguous symbols pick the highest-liquidity match. If a symbol
maps to multiple tokens, the CLI picks the one with the most
trading volume on Jupiter. It does not prompt. Use
sol token info <symbol> to verify what it resolves to, or pass a mint address
to be explicit.
- Use
--quote-only on swaps to preview before committing
- Use
--wallet <name> to target a specific wallet
- The transaction log tracks all operations with USD prices at
execution time β useful for cost basis and P&L
Permissions
The CLI supports fine-grained permissions via ~/.sol/config.toml. When a permission is set to false, the gated commands are not registered β they won't appear in --help or sol <group> --help, and invoking them returns "unknown command".
All permissions default to true (omitted = permitted). Example read-only config:
[permissions]
canTransfer = false
canSwap = false
canStake = false
canWithdrawStake = false
canLend = false
canWithdrawLend = false
canBorrow = false
canBurn = false
canCreateWallet = false
canRemoveWallet = false
canExportWallet =