Pay people in SOL or USDC, buy and sell tokens, check prices, discover trending and new tokens, create and manage Solana wallets, stake SOL, earn yield throu...
---
name: solana-payments-wallets-trading
description: >-
Pay people in SOL or USDC, buy and sell tokens, check prices, discover
trending and new tokens, create and manage Solana wallets, stake SOL, earn yield
through lending and managed vaults, borrow against collateral, set up
DCA (dollar-cost averaging) and limit orders, provide liquidity across
multiple DEXes, trade prediction markets, pay for APIs via x402, set up
security permissions and spending limits, and track portfolio performance
— all from the command line. No API keys, no private key env vars. Use
when the user wants to send crypto, swap or trade tokens, browse what's
trending, check balances, earn yield, borrow, set up recurring buys or
limit orders, provide liquidity, bet on predictions, pay for web
resources, or see how their holdings are doing.
license: MIT
metadata:
author: solanaguide
version: 0.3.4
openclaw:
requires:
bins:
- node
- npx
---
# 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:
```bash
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:
```bash
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.
```bash
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.
```bash
sol token browse trending # what's hot right now
sol token browse top-traded --interval 24h # highest volume over 24h
sol token browse recent --limit 10 # just launched
sol token browse lst # liquid staking tokens
```
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.
```bash
sol token swap 50 usdc bonk # buy BONK — best price wins
sol token swap 1.5 sol usdc # sell SOL for USDC
sol token swap 50 usdc bonk --quote-only # preview without executing
sol token swap 50 usdc bonk --router jupiter # force a specific router
```
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.
```bash
sol token dca new 500 usdc sol --every day --count 10 # buy SOL daily
sol token dca new 1000 usdc bonk --every hour --count 20
sol token dca list # see active DCA orders
sol token dca cancel <orderKey> # stop a DCA
```
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.
```bash
sol token limit new 50 usdc bonk --at 0.000003 # buy BONK at $0.000003
sol token limit new 0.5 sol usdc --at 0.90 # buy USDC at $0.90
sol token limit list # see active orders
sol token limit cancel <orderKey> # cancel an order
```
Use `--quote-only` to preview the order plan without placing it.
## Check Prices
```bash
sol token price sol
sol token price sol usdc bonk eth # multiple at once
```
## See What You Have
```bash
sol wallet balance # all tokens with USD values
sol wallet balance trading # specific wallet by name
sol token list # just token balances
sol wallet list # all your wallets
```
## Create and Manage Wallets
Wallets are local key files in `~/.sol/wallets/` — no seed phrases
in environment variables.
```bash
sol wallet create # new wallet, auto-named
sol wallet create --name trading # pick a name
sol wallet import --solana-cli # import from Solana CLI
sol wallet set-default trading # switch active wallet
```
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.
```bash
sol stake new 10 # stake 10 SOL
sol stake list # your stake accounts + claimable tips
sol stake claim-mev # compound MEV rewards
sol stake withdraw 7gK...abc # unstake
```
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`.
```bash
sol lend rates usdc # compare APY across all protocols
sol lend deposit 100 usdc # auto-picks best deposit rate
sol lend deposit 5 sol --protocol kamino
sol lend borrow 500 usdc --collateral sol
sol lend positions # everything across all protocols
```
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.
```bash
sol earn usdc # list USDC vaults with APY
sol earn sol # list SOL vaults
sol earn # all vaults, sorted by APY
sol earn deposit 100 usdc # auto-picks best APY vault
sol earn deposit 5 sol --protocol kamino # target specific protocol
sol earn positions # your vault positions
sol earn withdraw max usdc # full withdrawal
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.
```bash
sol lp pools sol usdc # browse SOL/USDC pools
sol lp pools --sort apy --type clmm # highest APY concentrated pools
sol lp deposit HJPj...abc 100 usdc --range 10 # deposit with +/-10% price range
sol lp positions # all positions with P&L
sol lp claim 9xK...abc # claim unclaimed fees
sol lp withdraw 9xK...abc # remove liquidity
```
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.
```bash
sol predict list crypto # browse crypto events
sol predict search "solana" # search by keyword
sol predict event POLY-89525 # event detail with markets
sol predict market POLY-701571 # prices + orderbook
sol predict buy 5 yes POLY-701571 # buy YES contracts
sol predict positions # open positions with P&L
sol predict sell <positionPubkey> # close a position
sol predict claim <positionPubkey> # claim resolved winnings
sol predict history # transaction 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.
```bash
sol fetch https://api.example.com/data # auto-pays 402 responses
sol fetch https://api.example.com/data --dry-run # show price without paying
sol fetch https://api.example.com/data --max 0.05 # spending cap in USDC
sol fetch https://api.example.com/rpc \
-X POST -d '{"query":"..."}' \
-H "Accept: application/json" # POST with headers
```
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.
```bash
sol portfolio # the full picture
sol portfolio compare # what changed since last snapshot
sol portfolio pnl # profit and loss over time
```
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
```bash
sol network # epoch, TPS, staking APY
sol tx 4xK9...abc # look up any transaction
sol config set rpc.url <url> # change RPC endpoint
```
## 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:
```toml
[permissions]
canTransfer = false
canSwap = false
canStake = false
canWithdrawStake = false
canLend = false
canWithdrawLend = false
canBorrow = false
canBurn = false
canCreateWallet = false
canRemoveWallet = false
canExportWallet = false
canFetch = false
```
| Permission | Gated subcommands |
|---|---|
| `canTransfer` | `token send` |
| `canSwap` | `token swap`, `token close --all`, `token dca new/cancel`, `token limit new/cancel` |
| `canStake` | `stake new` |
| `canWithdrawStake` | `stake withdraw`, `stake claim-mev` |
| `canLend` | `lend deposit`, `earn deposit`, `lp deposit`, `lp farm stake`, `lp create` |
| `canWithdrawLend` | `lend withdraw`, `earn withdraw`, `lp withdraw`, `lp claim`, `lp farm unstake/harvest` |
| `canBorrow` | `lend borrow`, `lend repay` |
| `canBurn` | `token burn`, `token close --burn` |
| `canCreateWallet` | `wallet create`, `wallet import` |
| `canRemoveWallet` | `wallet remove` |
| `canExportWallet` | `wallet export` |
| `canFetch` | `fetch` (x402 payments) |
Read-only commands (`token browse/price/info/list`, `wallet list/balance`, `stake list`, `lend rates/positions`, `earn list/positions`, `lp pools/info/positions/configs/farm list`, `portfolio`, `network`, `tx`) are always available regardless of permissions.
## Security Controls
The CLI provides three layers of protection for agent-driven workflows: **permissions** (what operations are allowed), **transaction limits** (how much can be spent), and **allowlists** (which addresses and tokens are permitted).
### Setting Up Security
Agents can help configure security settings, then the user reviews and locks:
```bash
# 1. Set permissions
sol config set permissions.canSwap true
sol config set permissions.canTransfer false
# 2. Set transaction limits
sol config set limits.maxTransactionUsd 500
sol config set limits.maxDailyUsd 2000
# 3. Set allowlists
sol config set allowlist.tokens So11111111111111111111111111111111111111112,EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v,DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263
sol config set allowlist.addresses DRtXHDgC312wpNdNCSb8vCoXDcofCJcPHdAynKGz7Vr,7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
# 4. Review — confirm everything looks right before locking
sol config status
# 5. Lock — prevents all further changes via CLI
sol config lock
```
After locking, security settings can only be changed by a human editing `~/.sol/config.toml` directly.
### Transaction Limits
| Setting | Description |
|---|---|
| `limits.maxTransactionUsd` | Maximum USD value per transaction. Missing = no limit. |
| `limits.maxDailyUsd` | Maximum total USD spent in a rolling 24h window. Missing = no limit. |
Limits apply to: `token swap`, `token send`, `stake new`, `lend deposit`, `lend borrow`, DCA creation, and limit order creation. They do not apply to withdrawals to own wallet, MEV claims, or read operations.
### Address Allowlist
`allowlist.addresses` — comma-separated list of wallet addresses. When set, outbound transfers (`token send`) are restricted to listed addresses plus all wallets in the local wallet database (own wallets are always allowed). Empty or missing = no restriction.
### Token Allowlist
`allowlist.tokens` — comma-separated list of token symbols or mint addresses. When set, both input and output tokens must be in the list for swaps, DCA creation, and limit orders. Empty or missing = all tokens allowed.
### Checking Security Status
```bash
sol config status # human-readable security overview
sol config status --json # structured output for agents
```
Shows the full security posture: all permissions and whether they're enabled, transaction limits with current 24h usage, address and token allowlists, whether settings are locked, and warnings about potential risks (e.g. no limits configured, public RPC in use). Agents should use `sol config status` to understand what they're allowed to do — not by reading `config.toml` directly.
### Important: Filesystem Access
**Do not grant agents read or write access to `~/.sol/`.** This directory contains your private keys and security configuration. Agents should only interact with Solana through the `sol` CLI commands, never by reading config or key files directly. After helping set up security, recommend the user lock settings with `sol config lock` and restrict filesystem access to `~/.sol/`.
## Security Model
Private keys are stored as files in `~/.sol/wallets/`. The CLI reads them at transaction-signing time — they are never exposed as environment variables or printed to stdout. An LLM agent using this tool cannot read the raw key material without explicitly opening those files, which requires user approval in standard permission modes.
Permissions, limits, and allowlists work together to control what the CLI can do. The agent must have the permission enabled, pass limit and allowlist checks, *and* get user approval for each CLI invocation.
**What this does not protect against:** These controls operate at the CLI and agent-permission level. They do not prevent other software on the same machine from reading the key files. Any tool, MCP server, plugin, or script running under the same OS user account can read `~/.sol/wallets/` directly. If you grant an agent access to additional tools — especially ones that can read arbitrary files or execute shell commands — those tools can extract your private keys regardless of Sol CLI permissions.
Keep wallet balances appropriate to the risk: use dedicated wallets with limited funds for agent-driven workflows, and do not store large holdings in key files accessible to automated tooling.
## Troubleshooting
See references/troubleshooting.md for common issues (RPC rate limits,
token resolution, transaction timeouts).
don't have the plugin yet? install it then click "run inline in claude" again.
sol is a command-line tool for working with Solana. instead of constructing transactions and managing program instructions, you describe what you want: pay someone, buy a token, stake your SOL. keys live locally on disk, never in env vars. use this skill when the user wants to send crypto, swap tokens, browse trending assets, check balances, earn yield, borrow, set up recurring buys or limit orders, provide liquidity, trade predictions, pay for APIs via x402, or view portfolio performance from the command line.
installation and setup:
node --version)rpc endpoint (required):
sol config set rpc.url <url>wallet(s):
~/.sol/wallets/ as encrypted key filesexternal connections (no API keys needed):
configuration file:
~/.sol/config.tomlinputs: Node.js >= 20, npx, RPC endpoint URL (optional, uses public default if omitted)
steps:
a. verify Node.js version:
node --version
if output is < v20.0.0, update Node.js.
b. set RPC endpoint (optional, but recommended to avoid rate limits):
npx @solana-compass/cli@latest config set rpc.url https://your-rpc-endpoint.com
if using public RPC, skip this step. if rate limits occur during trading or staking, return here and configure a paid RPC.
c. create or list wallets:
npx @solana-compass/cli@latest wallet create --name my-wallet
npx @solana-compass/cli@latest wallet list
outputs:
~/.sol/config.toml created with default settings and RPC URL~/.sol/wallets/my-wallet.json created (encrypted, local only)or shorter global install (optional):
npm install -g @solana-compass/cli
sol config set rpc.url https://your-rpc-endpoint.com
sol wallet create --name my-wallet
after global install, use sol instead of npx @solana-compass/cli@latest in all examples.
inputs:
--yes flag to skip confirmationsteps:
a. verify recipient address is correct:
sol wallet list
# copy target address from output
b. send payment:
sol token send 50 usdc GkX...abc
sol token send 2 sol 7nY...xyz
sol token send 1000 bonk AgE...def --yes
c. confirm transaction printed to stdout includes recipient, amount, fee (usually 0.000005 SOL), and transaction signature.
outputs:
transaction log:
~/.sol/transactions.log (human-readable, includes USD price at execution time)inputs: optional category filter or limit
steps:
a. browse trending tokens:
sol token browse trending
b. browse by category (top-traded in last 24h, recently launched, liquid staking tokens, etc.):
sol token browse top-traded --interval 24h
sol token browse recent --limit 10
sol token browse lst
c. results print as table with symbol, mint, price, 24h volume, creator, launch date.
d. to get more details on a specific token:
sol token info bonk
sol token price bonk
outputs:
token info and token price calls resolve instantlyedge case: if a symbol maps to multiple tokens (e.g., "shib" on Solana and Ethereum), CLI picks the highest-liquidity match on Jupiter without prompting. to verify, run sol token info <symbol> before trading.
inputs:
--quote-only to preview without executing--router jupiter or --router dflow to force a specific DEX aggregator--slippage <percent> (default 1%)--wallet <name> to use a specific walletsteps:
a. preview the swap without executing (recommended):
sol token swap 50 usdc bonk --quote-only
output shows input amount, output amount, price impact, and estimated fee.
b. if price looks good, execute:
sol token swap 50 usdc bonk
or skip preview and execute directly.
c. confirm transaction signature and updated balances printed.
outputs:
edge cases:
--slippage or try again later if token is volatile.sol wallet balance.inputs:
--wallet <name>steps:
a. create a DCA order that buys target token automatically:
sol token dca new 500 usdc sol --every day --count 10
this creates 10 orders of 50 USDC each, one per day.
b. list active DCA orders:
sol token dca list
output shows order key, target token, remaining orders, next execution time.
c. if conditions change, cancel:
sol token dca cancel <orderKey>
outputs:
constraints:
sol portfolio to show what's reservedinputs:
--at <price>)--quote-only to preview--wallet <name>steps:
a. preview the order without placing it:
sol token limit new 50 usdc bonk --at 0.000003 --quote-only
output shows order details and number of output tokens if executed at target price.
b. place the order:
sol token limit new 50 usdc bonk --at 0.000003
c. list active orders:
sol token limit list
shows order key, input/output tokens, target price, fill status.
d. cancel if price moves past target:
sol token limit cancel <orderKey>
outputs:
sol portfolio as "pending limit orders"edge case: if price drops below target and order hasn't filled, it remains active indefinitely (or until cancelled). if price spikes above target without triggering, check on-chain liquidity or try a price closer to market.
inputs: optional wallet name (defaults to default wallet)
steps:
a. check all token balances with USD value:
sol wallet balance
sol wallet balance trading
output is formatted table with token, amount, USD value.
b. list only token balances (no USD conversion):
sol token list
c. list all local wallets:
sol wallet list
output shows wallet names, public keys, and flags (default, read-only).
outputs:
inputs: optional wallet name (auto-generated if omitted)
steps:
a. create a new wallet:
sol wallet create
sol wallet create --name trading
output shows new public key and wallet name.
b. import from Solana CLI keystore:
sol wallet import --solana-cli
prompts for keypair path, imports and stores in ~/.sol/wallets/.
c. set a wallet as default for future commands:
sol wallet set-default trading
or use --wallet <name> on any command to target a specific wallet.
d. see transaction history for a wallet:
sol wallet history trading
outputs:
~/.sol/config.toml~/.sol/wallets/<name>.jsonsecurity:
~/.sol/wallets/ filesinputs:
--wallet <name>steps:
a. stake SOL with default validator:
sol stake new 10
creates a new stake account, funds it, and delegates to validator. transaction shows account address.
b. list all stake accounts and claimable MEV:
sol stake list
output shows stake account pubkey, amount, validator, activation status, APY, claimable MEV rewards.
c. claim MEV rewards and compound (reinvest into stake):
sol stake claim-mev
transfers rewards to active stake account balance. if you want to keep rewards separate, withdraw and re-stake manually.
d. unstake (withdraw SOL):
sol stake withdraw 7gK...abc
input is stake account pubkey (from sol stake list). begins unstaking immediately; SOL is claimable after next epoch (about 2-3 days).
outputs:
edge case: if you unstake mid-epoch, rewards are forfeited for that epoch. claim MEV before unstaking if rewards are significant.
inputs:
--protocol <name> to target specific protocol (kamino, marginfi, drift, jupiter-lend, loopscale)--wallet <name>steps:
a. compare lending rates across all protocols:
sol lend rates usdc
sol lend rates sol
output is table with protocol, deposit APY, borrow APY, TVL.
b. deposit to earn yield (auto-picks highest rate unless protocol specified):
sol lend deposit 100 usdc
sol lend deposit 5 sol --protocol kamino
transaction signature and current balance printed.
c. borrow against collateral:
sol lend borrow 500 usdc --collateral sol
deposits SOL as collateral, borrows USDC. output shows collateral ratio and liquidation price.
d. see all lending positions across protocols:
sol lend positions
table shows protocol, token, amount, APY, earned interest, collateral posted.
e. repay a borrow:
sol lend repay 100 usdc
f. withdraw a deposit:
sol lend withdraw 50 usdc --protocol kamino
outputs:
sol portfolio alongside tokens and stakesedge case: if collateral ratio drops below protocol minimum due to market moves, position enters liquidation. borrow less or add more collateral to stay safe. monitor sol portfolio and sol lend positions regularly.
inputs:
--protocol <name> to target specific vault provider (kamino-earn, loopscale)--vault <name> to target specific vault (use from sol earn <token> output)steps:
a. list available vaults for a token, sorted by APY:
sol earn usdc
sol earn sol
sol earn
output shows protocol, vault name, token, current APY, TVL, strategy description.
b. deposit to highest-APY vault (auto-selected):
sol earn deposit 100 usdc
or target specific protocol:
sol earn deposit 5 sol --protocol kamino
c. see all vault positions across protocols:
sol earn positions
table shows vault name, token, balance, current APY, earned interest.
d. withdraw from a vault (partial or full):
sol earn withdraw 50 usdc
sol earn withdraw max usdc --protocol loopscale
outputs:
sol portfolio alongside tokens, staking, and lendingdifference from lending:
inputs:
--sort apy or --sort volume to prioritize pools--wallet <name>steps:
a. browse pools by pair:
sol lp pools sol usdc
output is table with DEX, pair, TVL, APY, 24h volume, fee tier.
b. filter by APY or type (concentrated vs. constant product):
sol lp pools --sort apy --type clmm
c. deposit liquidity with price range:
sol lp deposit HJPj...abc 100 usdc --range 10
input is pool ID (from sol lp pools output), amount, and range in percent (e.g., +/-10% around current price). transaction shows LP token address.
d. see all LP positions with P&L and impermanent loss:
sol lp positions
table shows pool, your liquidity amount, earned fees, impermanent loss, APY realized.
e. claim unclaimed fees:
sol lp claim 9xK...abc
input is LP token address. fees withdrawn to wallet.
f. withdraw liquidity:
sol lp withdraw 9xK...abc
removes all liquidity and claims fees. returns your tokens and earned fees.
outputs:
advanced:
sol lp farm stake <pool-id> to lock LP tokens and earn additional incentivessol lp create <token1> <token2> --fee 0.3 (requires canLend permission)sol lp farm listedge case: concentrated liquidity (clmm) pools can incur impermanent loss if price moves far from your range. if price moves outside range, your liquidity stops earning fees. adjust range or withdraw and re-deposit at new price.
inputs:
steps:
a. browse prediction markets by category:
sol predict list crypto
sol predict list sports
sol predict list politics
output shows category, event title, resolution date, available markets.
b. search for specific events:
sol predict search "solana"
c. see details of an event:
sol predict event POLY-89525
output shows markets within that event (e.g., "will price exceed $X?"), current prices, orderbook depth.
d. check a specific market:
sol predict market POLY-701571
shows bid/ask prices, volume, open interest.
e. buy contracts (e.g., "yes" for an outcome):
sol predict buy 5 yes POLY-701571
purchases 5 YES contracts at current ask price. transaction shows cost in USDC.
f. see all open positions:
sol predict positions
table shows market, contracts owned (yes/no), entry price, current price, unrealized P&L.
g. sell a position to close:
sol predict sell <positionPubkey>
h. claim resolved winnings:
sol predict claim <positionPubkey>
i. see transaction history:
sol predict history
outputs:
sol portfolio with profit/loss summaryedge case: markets resolve on specific dates. if market is unresolved, you cannot claim. check event date before buying. if market moves against you, selling at a loss is possible; orders executed immediately at current market price.
inputs:
--dry-run to show cost without paying--max <usdc> to set spending capsteps:
a. fetch a URL that requires x402 payment:
sol fetch https://api.example.com/data
if server returns 402 Payment Required, CLI signs a USDC transfer, attaches it, and retries. response body printed to stdout, payment info to stderr.
b. preview cost without paying:
sol fetch https://api.example.com/data --dry-run
output shows price in USDC and what would be sent.
c. set a spending cap:
sol fetch https://api.example.com/data --max 0.05
if server asks for more than 0.05 USDC, request fails. prevents overpaying for data.
d. POST with headers:
sol fetch https://api.example.com/rpc \
-X POST -d '{"query":"..."}' \
-H "Accept: application/json"
curl-like syntax supported. response body is JSON or text, printed to stdout.
outputs:
edge cases:
--max, request fails and no payment sent--max too highinputs: none required
steps:
a. see full portfolio snapshot (tokens, staking, lending, LP, open orders):
sol portfolio
output shows all positions with current balances, USD values, and total net worth.
b. compare portfolio to previous snapshot:
sol portfolio compare
shows what changed since last view (buys, sells, price moves, interest earned).
c. see profit/loss over time:
sol portfolio pnl
table shows realized gains/losses from closed trades, unrealized gains from open positions, interest earned, fees paid.
outputs:
portfolio compare always has recent reference data)edge case: if portfolio has not been viewed twice, portfolio compare returns "no previous snapshot." run again later.
inputs: any command with --json flag
steps:
a. append --json to any command:
sol wallet balance --json
sol token swap 50 usdc bonk --json
sol portfolio --json
outputs:
{
"ok": true,
"data": { ... command-specific payload ... },
"meta": {
"elapsed_ms": 450,
"rpc_calls": 3,
"timestamp": "2024-01-15T10:30:00Z"
}
}
use cases:
inputs: optional transaction signature
steps:
a. check network status (epoch, TPS, staking APY):
sol network
output shows current epoch, slots/second, average staking APY, SOL price.
b. look up any transaction:
sol tx 4xK9...abc
input is transaction signature. output shows sender, recipient(s), tokens, amounts, status (success/failed), block height.
outputs:
inputs: RPC URL (https://... or ws://...)
steps:
a. change RPC endpoint:
sol config set rpc.url https://your-rpc-endpoint.com
b. verify current RPC: