Loading...
Loading...
Execute token swaps and manage on-chain transactions: list supported swap chains, browse available swap tokens, get swap quotes with price/slippage/route info, build signable swap transactions, estimate gas/transaction fees, and broadcast signed transactions to the blockchain. Trigger words: swap, trade, exchange, buy token, sell token, convert, swap tokens, trade tokens, exchange tokens, buy crypto, sell crypto, get a quote, swap quote, price quote, how much will I get, swap rate, exchange rate, slippage, swap route, best price, execute swap, confirm swap, make a trade, place a trade, transaction, send transaction, broadcast, submit transaction, tx, send tx, gas fee, transaction fee, fee estimate, gas estimate, how much gas, supported chains, swap chains, which chains, available tokens, swap tokens, chain list, token list, build transaction, sign transaction. Chinese: 兑换, 交易, 买入, 卖出, 换币, 代币兑换, 报价, 兑换报价, 价格, 能换多少, 滑点, 路由, 最优价格, 执行交易, 确认交易, 发送交易, 广播交易, 手续费, Gas费, 费用估算, 支持的链, 可用代币, 构建交易, 签名交易. CRITICAL: Always use `--json` flag for structured output. CRITICAL: Swap amounts are in **smallest unit** (e.g. lamports for SOL, wei for ETH). CRITICAL: ALWAYS run `lfi token security` on the target token BEFORE executing a swap. CRITICAL: NEVER execute swap or send transaction without explicit user confirmation. Do NOT use this skill for: - Token search, info, security audit, K-line → use liberfi-token - Trending tokens or new token rankings → use liberfi-market - Wallet holdings, activity, or PnL stats → use liberfi-portfolio - Token holder or trader analysis → use liberfi-token Do NOT activate on vague inputs like "trade" or "buy" without specifying tokens or amounts.
npx skill4agent add liberfi-io/liberfi-skills liberfi-swap| Command | Requires Auth |
|---|---|
| No |
| No |
| No |
| No |
| Yes (JWT, uses TEE wallet) |
| Yes (JWT, uses TEE wallet) |
lfi status --jsonlfi login key --role AGENT --jsonlfi login <email> --jsonlfi verify <otpId> <code> --jsonlfi whoami --jsonlfi swap tokenslfi token search--accountswap execute| If user asks about... | Route to |
|---|---|
| Token search, price, details, security | liberfi-token |
| Token K-line, candlestick chart | liberfi-token |
| Token holders, smart money traders | liberfi-token |
| Trending tokens, market rankings | liberfi-market |
| Newly listed tokens | liberfi-market |
| Wallet holdings, balance, PnL | liberfi-portfolio |
| Wallet activity, transaction history | liberfi-portfolio |
| Command | Description | Auth |
|---|---|---|
| List all supported swap chains | No |
| List available swap tokens | No |
| Command | Description | Auth |
|---|---|---|
| Get a swap quote | No |
| Execute swap via TEE wallet | Yes |
| Build, sign, and broadcast swap in one step via TEE wallet | Yes |
| Estimate transaction fee / gas | No |
| Broadcast a signed transaction | Yes |
--in <address>--out <address>--amount <amount>--chain-family <family>evmsvm--chain-id <id>01--slippage-bps <bps>100--swap-mode <mode>ExactInExactOut--account <address>--quote-result <json>swap quote--chain-family <family>evmsvm--chain-id <id>--data <json>--chain-family <family>evmsvm--chain-id <id>--quote-result <json>lfi swap quote--slippage-bps <bps>--chain-family <family>evmsvm--chain-id <id>--signed-tx <data>lfi swap chains --jsonlfi swap tokens --chain-id <id> --jsonlfi token security <chain> <outputTokenAddress> --jsonlfi swap quote --in <in> --out <out> --amount <amt> --chain-family <fam> --chain-id <id> --jsonlfi status --json # check session
# If not authenticated:
lfi login key --role AGENT --json # agent
# or: lfi login <email> --json → lfi verify <otpId> <code> --json
lfi whoami --json # confirm evmAddress / solAddresslfi token security <chain> <outputTokenAddress> --jsonlfi swap quote --in <in> --out <out> --amount <amt> --chain-family <fam> --chain-id <id> --jsonlfi swap execute --in <in> --out <out> --amount <amt> --chain-family <fam> --chain-id <id> --quote-result '<quoteJson>' --jsonswap executelfi status --json # check session
# If not authenticated:
lfi login key --role AGENT --json # agent
# or: lfi login <email> --json → lfi verify <otpId> <code> --jsonswap quotelfi swap sign-and-send --chain-family <fam> --chain-id <id> --quote-result '<quoteJson>' --jsonsign-and-sendexecutesign-and-sendquote_resultexecutelfi tx estimate --chain-family <fam> --chain-id <id> --data '<txJson>' --jsonlfi status --jsonlfi tx send --chain-family <fam> --chain-id <id> --signed-tx <signedData> --jsonFull flow: auth → token → swap
lfi status --jsonlfi login key --jsonlfi whoami --jsonlfi token search --q "USDC" --chains sol --jsonlfi token security sol <usdcAddress> --jsonlfi swap quote --in So11111111111111111111111111111111111111112 --out <usdcAddress> --amount <amt> --chain-family svm --chain-id 0 --jsonlfi swap execute --in ... --out ... --amount ... --chain-family svm --chain-id 0 --jsonFull flow: auth → market → token → swap
lfi status --jsonlfi login key --jsonlfi ranking trending sol 1h --limit 5 --jsonlfi token security sol <address> --jsonlfi swap quote --in <baseToken> --out <address> --amount <amt> --chain-family svm --chain-id 0 --jsonlfi swap execute --in ... --out ... --jsonFull flow: auth → portfolio → token → swap
lfi status --jsonlfi login key --jsonlfi whoami --jsonlfi wallet holdings sol <solAddress> --jsonlfi token security sol <tokenAddress> --jsonlfi swap quote --in <tokenAddress> --out <baseToken> --amount <halfAmt> --chain-family svm --chain-id 0 --jsonlfi swap execute --in ... --out ... --json| Just completed | Suggest to user |
|---|---|
| Chain list | "Which chain do you want to trade on?" / "想在哪条链上交易?" |
| Token list | "Which tokens do you want to swap?" / "想兑换哪些代币?" |
| Swap quote | "Want to execute this swap?" / "要执行这笔兑换吗?" |
| Swap execute (TEE) | "Swap submitted via your LiberFi TEE wallet!" / "已通过LiberFi TEE钱包提交兑换!" |
| Swap sign-and-send | "Swap built, signed, and broadcast in one step!" / "兑换已一步完成构建、签名并广播!" |
| Fee estimate | "Ready to send?" / "准备好发送了吗?" |
| Tx send | "Transaction submitted! Track it on the block explorer." / "交易已提交!可在区块浏览器上查看。" |
| Not authenticated | "Please log in first: |
lfi wallet holdingsevmsvmsvmevm| Pitfall | Correct Approach |
|---|---|
| Using human-readable amounts (e.g. "1 SOL") | Convert to smallest unit first: 1 SOL = 1,000,000,000 lamports |
| Skipping security check before swap | ALWAYS run |
| Executing swap without user confirmation | ALWAYS show quote summary and wait for explicit "yes" |
| Passing modified quote_result to execute / sign-and-send | Pass the quote_result JSON through WITHOUT any modification |
Calling | Check |
| Assuming a wallet address without checking | Call |
| Retrying failed tx send without checking | The tx may have been submitted; check on-chain status first |
Using | Call |
swap executetx sendtoken securityquote_result