solana-payments-wallets-trading

GitHub 作者 solanaguide

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.

安装 / 下载方式

TotalClaw CLI推荐
totalclaw install github:LeoYeAI~openclaw-master-skills~solana-payments-wallets-trading
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/github%3ALeoYeAI~openclaw-master-skills~solana-payments-wallets-trading/file -o solana-payments-wallets-trading.md
# 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-comma