solana-payments-wallets-trading by solanaguide/solana-cli
npx skills add https://github.com/solanaguide/solana-cli --skill solana-payments-wallets-tradingSol 是一款命令行工具,让你能够以口语化的方式操作 Solana。无需构建交易或管理程序指令,只需说出你的需求:向某人付款、购买代币、质押 SOL。
密钥本地存储在磁盘上——无需在环境变量中存放私钥,也无需配置 API 密钥。
推荐使用带 @latest 的 npx——它始终运行最新版本,无需管理全局安装:
npx @solana-compass/cli@latest config set rpc.url https://your-rpc-endpoint.com
npx @solana-compass/cli@latest wallet create --name my-wallet
如果用户已全局安装(npm install -g @solana-compass/cli),则可以使用更短的 sol 命令:
sol config set rpc.url https://your-rpc-endpoint.com
sol wallet create --name my-wallet
公共 RPC 端点有严格的速率限制。除测试外,请使用专用 RPC——Helius、Triton 和 QuickNode 都提供免费套餐。
需要 Node.js >= 20。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
向钱包地址发送 SOL、USDC 或任何 Solana 代币。
sol token send 50 usdc GkX...abc
sol token send 2 sol 7nY...xyz
sol token send 1000 bonk AgE...def --yes
完整发送命令参考请见 references/trading-commands.md。
浏览 Solana 代币生态系统——热门代币、交易量最高、最近上线等。
sol token browse trending # 当前热门代币
sol token browse top-traded --interval 24h # 24 小时内交易量最高
sol token browse recent --limit 10 # 刚刚上线
sol token browse lst # 流动性质押代币
结果会填充到本地代币缓存中,因此后续的 token info 和 token price 调用会立即解析。
所有类别和标志的完整列表请见 references/trading-commands.md。
将任意代币兑换为其他代币。并行查询 Jupiter 和 DFlow,并自动选择最佳价格。
sol token swap 50 usdc bonk # 购买 BONK——最佳价格胜出
sol token swap 1.5 sol usdc # 卖出 SOL 换取 USDC
sol token swap 50 usdc bonk --quote-only # 仅预览,不执行
sol token swap 50 usdc bonk --router jupiter # 强制使用特定路由器
每次兑换都会记录执行时的价格,以便后续追踪成本基础和盈亏。
滑点、钱包选择等完整信息请见 references/trading-commands.md。
设置随时间自动执行的定期购买。
sol token dca new 500 usdc sol --every day --count 10 # 每日购买 SOL
sol token dca new 1000 usdc bonk --every hour --count 20
sol token dca list # 查看活跃的定投订单
sol token dca cancel <orderKey> # 停止定投
限制条件:总金额最低 $100,至少 2 个订单,每个订单最低 $50。间隔:分钟、小时、天、周、月。
当下单代币达到目标价格时执行订单。
sol token limit new 50 usdc bonk --at 0.000003 # 以 $0.000003 的价格购买 BONK
sol token limit new 0.5 sol usdc --at 0.90 # 以 $0.90 的价格购买 USDC
sol token limit list # 查看活跃订单
sol token limit cancel <orderKey> # 取消订单
使用 --quote-only 预览订单计划而不实际下单。
sol token price sol
sol token price sol usdc bonk eth # 同时查看多个代币价格
sol wallet balance # 所有代币及其美元价值
sol wallet balance trading # 按名称查看特定钱包
sol token list # 仅代币余额
sol wallet list # 你的所有钱包
钱包是位于 ~/.sol/wallets/ 的本地密钥文件——助记词不会存放在环境变量中。
sol wallet create # 新建钱包,自动命名
sol wallet create --name trading # 指定名称
sol wallet import --solana-cli # 从 Solana CLI 导入
sol wallet set-default trading # 切换活动钱包
任何命令都可以通过 --wallet <name> 指定目标钱包。
导入、导出、标签、历史记录等完整信息请见 references/wallet-commands.md。
将 SOL 委托给验证节点并赚取质押奖励。一个命令即可处理整个流程——创建质押账户、注资并委托。
sol stake new 10 # 质押 10 SOL
sol stake list # 你的质押账户 + 可领取的小费
sol stake claim-mev # 复投 MEV 奖励
sol stake withdraw 7gK...abc # 解除质押
验证节点选择、部分提款和强制解除质押等完整信息请见 references/staking-commands.md。
比较五个协议的利率并进行借贷——Kamino、MarginFi、Drift、Jupiter Lend 和 Loopscale。CLI 自动选择最佳利率,或者你可以使用 --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 # 所有协议中的全部头寸
完整细节请见 references/lending-commands.md。
管理 Kamino Earn 和 Loopscale 的收益金库。与原始借贷不同,金库自动处理策略管理——你存入代币,协议优化收益。CLI 自动选择年化收益率最高的金库,或者你可以指定特定协议或金库。
sol earn usdc # 列出带年化收益率的 USDC 金库
sol earn sol # 列出 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
收益头寸会与代币、质押、借贷和 LP 一起显示在 sol portfolio 中。
向 Orca、Raydium、Meteora 和 Kamino 的流动性池添加流动性。按 TVL/年化收益率/交易量浏览流动性池,使用灵活的价格范围存入,追踪带盈亏和无常损失的头寸,并通过耕作获取额外奖励。
sol lp pools sol usdc # 浏览 SOL/USDC 流动性池
sol lp pools --sort apy --type clmm # 年化收益率最高的集中流动性池
sol lp deposit HJPj...abc 100 usdc --range 10 # 以 +/-10% 的价格范围存入
sol lp positions # 所有带盈亏的头寸
sol lp claim 9xK...abc # 领取未领取的费用
sol lp withdraw 9xK...abc # 移除流动性
包括耕作、流动性池创建和协议特定标志在内的完整细节请见 references/lp-commands.md。
通过 Jupiter 浏览和交易来自 Polymarket 和 Kalshi 的预测市场。类别包括加密货币、体育、政治、文化等。
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 # 购买 YES 合约
sol predict positions # 带盈亏的未平仓头寸
sol predict sell <positionPubkey> # 平仓
sol predict claim <positionPubkey> # 领取已结算的奖金
sol predict history # 交易历史
头寸会与未实现盈亏一起显示在 sol portfolio 中。
完整命令参考请见 references/prediction-commands.md。
获取需要通过 x402 协议付费的 URL。工作方式类似于 curl——标准输出是响应体,支付信息输出到标准错误。
sol fetch https://api.example.com/data # 自动支付 402 响应
sol fetch https://api.example.com/data --dry-run # 显示价格但不支付
sol fetch https://api.example.com/data --max 0.05 # 以 USDC 设置消费上限
sol fetch https://api.example.com/rpc \
-X POST -d '{"query":"..."}' \
-H "Accept: application/json" # 带请求头的 POST 请求
如果服务器返回 402 Payment Required,CLI 会签署一笔 USDC 转账并附上支付信息后重试。服务器提交交易——你的钱包仅部分签名。
使用 --dry-run 在支付前检查费用。使用 --max 设置消费上限。默认输出适合管道操作(响应体在标准输出,支付信息在标准错误)。
包括 curl 标志映射和 JSON 输出格式在内的完整参考请见 references/fetch-commands.md。
在一处查看所有信息——代币、质押的 SOL、借贷头寸和未完成订单。
sol portfolio # 完整概览
sol portfolio compare # 与上次快照相比的变化
sol portfolio pnl # 随时间变化的盈亏
投资组合视图包括活跃的定投和限价订单及其成交进度,因此锁定的资金始终可见。每次查看时都会自动拍摄快照(限速为每 5 分钟一次),因此 sol portfolio compare 始终有最新数据。
快照管理请见 references/portfolio-commands.md。
每个命令都支持 --json 以输出结构化数据,但默认的人类可读输出设计得易于阅读和解释——无论对人类还是 LLM 智能体都是如此。除非你在自动化管道中编写脚本或链式调用命令,否则请使用人类可读输出。
人类输出使用格式化表格,提示下一步操作,并显示完整的 ID 和地址,以便你可以将其复制粘贴到后续命令中。示例输出请见每个命令参考。
对于程序化使用,--json 返回一个 CommandResult<T> 信封:{ "ok": true, "data": { ... }, "meta": { "elapsed_ms": 450 } }。完整模式请见 references/json-output-format.md。
sol network # 纪元、TPS、质押年化收益率
sol tx 4xK9...abc # 查询任何交易
sol config set rpc.url <url> # 更改 RPC 端点
1000000 而非 1m,50000 而非 50k。在传递给命令之前,始终将简写扩展为完整数字。sol token info <symbol> 验证其解析结果,或传递铸币地址以明确指定。--quote-only 在提交前预览--wallet <name> 指定特定钱包CLI 通过 ~/.sol/config.toml 支持细粒度权限。当权限设置为 false 时,受限制的命令不会被注册——它们不会出现在 --help 或 sol <group> --help 中,调用它们会返回“未知命令”。
所有权限默认为 true(省略 = 允许)。示例只读配置:
[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
| 权限 | 受限制的子命令 |
|---|---|
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 支付) |
只读命令(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)始终可用,不受权限限制。
CLI 为智能体驱动的工作流提供三层保护:权限(允许哪些操作)、交易限制(可以花费多少)和允许列表(允许哪些地址和代币)。
智能体可以帮助配置安全设置,然后由用户审核并锁定:
# 1. 设置权限
sol config set permissions.canSwap true
sol config set permissions.canTransfer false
# 2. 设置交易限制
sol config set limits.maxTransactionUsd 500
sol config set limits.maxDailyUsd 2000
# 3. 设置允许列表
sol config set allowlist.tokens So11111111111111111111111111111111111111112,EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v,DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263
sol config set allowlist.addresses DRtXHDgC312wpNdNCSb8vCoXDcofCJcPHdAynKGz7Vr,7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
# 4. 审核——在锁定前确认一切正确
sol config status
# 5. 锁定——阻止通过 CLI 进行所有后续更改
sol config lock
锁定后,安全设置只能由用户直接编辑 ~/.sol/config.toml 来更改。
| 设置 | 描述 |
|---|---|
limits.maxTransactionUsd | 每笔交易的最大美元价值。缺失 = 无限制。 |
limits.maxDailyUsd | 滚动 24 小时窗口内的最大总美元支出。缺失 = 无限制。 |
限制适用于:token swap、token send、stake new、lend deposit、lend borrow、DCA 创建和限价订单创建。不适用于向自己钱包的提款、MEV 领取或读取操作。
allowlist.addresses —— 以逗号分隔的钱包地址列表。设置后,向外转账(token send)仅限于列出的地址加上本地钱包数据库中的所有钱包(自己的钱包始终允许)。空或缺失 = 无限制。
allowlist.tokens —— 以逗号分隔的代币符号或铸币地址列表。设置后,兑换、DCA 创建和限价订单的输入和输出代币都必须在列表中。空或缺失 = 允许所有代币。
sol config status # 人类可读的安全概览
sol config status --json # 供智能体使用的结构化输出
显示完整的安全状态:所有权限及其启用状态、交易限制及当前 24 小时使用情况、地址和代币允许列表、设置是否被锁定,以及关于潜在风险的警告(例如未配置限制、使用公共 RPC)。智能体应使用 sol config status 来了解它们被允许执行的操作——而不是直接读取 config.toml。
不要授予智能体对 ~/.sol/ 的读取或写入权限。 此目录包含你的私钥和安全配置。智能体应仅通过 sol CLI 命令与 Solana 交互,绝不应直接读取配置文件或密钥文件。在帮助设置安全配置后,建议用户使用 sol config lock 锁定设置,并限制对 ~/.sol/ 的文件系统访问。
私钥作为文件存储在 ~/.sol/wallets/ 中。CLI 在交易签名时读取它们——它们永远不会作为环境变量暴露或打印到标准输出。使用此工具的 LLM 智能体无法读取原始密钥材料,除非明确打开这些文件,而这在标准权限模式下需要用户批准。
权限、限制和允许列表共同控制 CLI 可以执行的操作。智能体必须启用相应权限,通过限制和允许列表检查,并且 每次 CLI 调用都获得用户批准。
这无法防范的情况: 这些控制在 CLI 和智能体权限级别运行。它们无法阻止同一台机器上的其他软件读取密钥文件。任何在同一操作系统用户账户下运行的工具、MCP 服务器、插件或脚本都可以直接读取 ~/.sol/wallets/。如果你授予智能体访问其他工具的权限——尤其是那些可以读取任意文件或执行 shell 命令的工具——那么无论 Sol CLI 权限如何,这些工具都可以提取你的私钥。
根据风险保持适当的钱包余额:为智能体驱动的工作流使用资金有限的专用钱包,不要在自动化工具可访问的密钥文件中存储大量资产。
常见问题(RPC 速率限制、代币解析、交易超时)请见 references/troubleshooting.md。
每周安装量
338
仓库
GitHub 星标数
4
首次出现
2026 年 2 月 23 日
安全审计
安装于
cursor178
claude-code166
cline116
codex106
gemini-cli103
opencode92
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.
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.
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.
Browse the Solana token ecosystem — trending, most traded, recently launched, and more.
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.
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 # 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.
Set up recurring buys that execute automatically over time.
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.
Place orders that execute when a token hits your target price.
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.
sol token price sol
sol token price sol usdc bonk eth # multiple at once
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
Wallets are local key files in ~/.sol/wallets/ — no seed phrases in environment variables.
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.
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 # 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.
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 # 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.
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 # 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.
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 # 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.
Browse and trade prediction markets from Polymarket and Kalshi via Jupiter. Categories include crypto, sports, politics, culture, and more.
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.
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 # 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.
See everything in one place — tokens, staked SOL, lending positions, and open orders.
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.
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.
sol network # epoch, TPS, staking APY
sol tx 4xK9...abc # look up any transaction
sol config set rpc.url <url> # change RPC endpoint
1000000 not 1m, 50000 not 50k. Always expand shorthand before passing to a command.sol token info <symbol> to verify what it resolves to, or pass a mint address to be explicit.--quote-only on swaps to preview before committing--wallet <name> to target a specific walletThe 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 = 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 |
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.
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).
Agents can help configure security settings, then the user reviews and locks:
# 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.
| 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.
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.
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.
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.
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/.
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.
See references/troubleshooting.md for common issues (RPC rate limits, token resolution, transaction timeouts).
Weekly Installs
338
Repository
GitHub Stars
4
First Seen
Feb 23, 2026
Security Audits
Gen Agent Trust HubWarnSocketPassSnykWarn
Installed on
cursor178
claude-code166
cline116
codex106
gemini-cli103
opencode92
钱包策略生成器 | 为EVM和Solana钱包创建安全策略规则
3,700 周安装
Cloudflare Images 图像托管与转换 API 使用指南 | 支持 AI 人脸裁剪与内容凭证
328 周安装
Swift iOS HomeKit Matter 开发指南:控制智能家居与设备配网
329 周安装
iOS WeatherKit 使用指南:获取天气数据、预报与警报的 Swift 实现
329 周安装
Microsoft Agent Framework 开发指南:统一Semantic Kernel与AutoGen的AI智能体框架
329 周安装
Spring缓存单元测试指南:@Cacheable、@CacheEvict、@CachePut测试方法与内存缓存管理器
329 周安装
React Native 升级指南:使用 upgrade-react-native 技能轻松升级项目版本
329 周安装
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) |