← Back to Skills Marketplace
fabriziogianni7

LI.FI Skill

by fabriziogianni7 · GitHub ↗ · v2.0.1
cross-platform ✓ Security Clean
2815
Downloads
3
Stars
3
Active Installs
13
Versions
Install in OpenClaw
/install lifi-skill
Description
v4 - Use LI.FI API for cross-chain and same-chain swaps, bridges, and contract calls. Use when quoting routes, validating chains/tokens, building transaction requests, and tracking status.
README (SKILL.md)

LI.FI Agent Skill

CRITICAL RULES (read first)

  1. ONLY use curl to call the LI.FI API. NEVER use web_search, web_fetch, or any other tool.
  2. ONLY use the endpoints documented below. Do NOT guess or invent URLs.
  3. Base URL is https://li.quest/v1/. No other base URL.
  4. ALWAYS include auth header: "x-lifi-api-key: $LIFI_API_KEY" (double quotes, dollar sign — shell expands it).
  5. ALWAYS tell the user the quote is provided by LI.FI.
  6. Default slippage: 10% (0.10). If the user has a custom slippage in their strategy (via defi_get_strategy), use that instead. The agent can also adjust dynamically per-transaction if the user requests it.
  7. Default deadline: 10 minutes.
  8. ALWAYS add &skipSimulation=true to all /v1/quote requests. Our EIP-7702 delegated wallets have on-chain code that breaks LI.FI's simulation.
  9. NEVER construct ERC-20 approve calldata (hex) yourself. ALWAYS use the defi_approve or defi_approve_and_send tools.
  10. ALL swaps, bridges, and DeFi token operations MUST go through LI.FI. No exceptions. No manual DEX interactions.

Transaction Links

After every transaction broadcast, always provide a clickable block explorer link:

  • EVM: [View tx](https://basescan.org/tx/0xHASH) — use the correct explorer (etherscan.io, basescan.org, arbiscan.io, polygonscan.com, optimistic.etherscan.io)
  • Sui: [View tx](https://suiscan.xyz/txblock/{txDigest})

Sui

  • Sui chain ID: 9270000000000000. Use this for fromChain and toChain in LI.FI quote requests when the user wants Sui (e.g. fromChain=9270000000000000&toChain=9270000000000000 for same-chain Sui swap).
  • LI.FI supports Sui for same-chain swaps and bridging to/from EVM and Solana.
  • For Sui quotes, use the user's suiAddress from defi_get_wallet as fromAddress.
  • Execute Sui quotes with defi_send_sui_transaction — pass the transaction bytes (hex) from the LI.FI quote. Do not use defi_send_transaction or defi_approve_and_send for Sui.
  • Sui does not use ERC-20 approvals; there is no approval step for Sui swaps.

Endpoints

GET /v1/chains — List supported chains

curl -s --request GET \
  --url https://li.quest/v1/chains \
  --header "x-lifi-api-key: $LIFI_API_KEY"

Use for: listing chains, testing connectivity. If user asks for a test, use this.

GET /v1/tokens — List tokens on chains

curl -s --request GET \
  --url 'https://li.quest/v1/tokens?chains=8453' \
  --header "x-lifi-api-key: $LIFI_API_KEY"

Params: chains (comma-separated chain IDs).

GET /v1/quote — Get swap/bridge quote with tx data

curl -s --request GET \
  --url 'https://li.quest/v1/quote?fromChain=8453&toChain=8453&fromToken=ETH&toToken=USDC&fromAddress=0xYOUR_ADDRESS&fromAmount=100000000000000&slippage=0.10&skipSimulation=true' \
  --header "x-lifi-api-key: $LIFI_API_KEY"

Params: fromChain, toChain, fromToken, toToken, fromAddress, toAddress (optional), fromAmount (in wei), slippage (decimal, e.g. 0.10 = 10%), skipSimulation=true (ALWAYS include).

Returns: estimate (with toAmount, toAmountMin, approvalAddress) and transactionRequest (ready for wallet submission).

After presenting a quote to the user, always include the estimated output amount, fees, and slippage. Get the user's wallet address with defi_get_wallet and use it as fromAddress in the quote.

Executing the quote

Check if ERC-20 approval is needed: If the quote's transactionRequest.value is "0x0" AND estimate.approvalAddress exists, the swap/bridge is using an ERC-20 token that needs approval first.

  • If approval IS needed: Use defi_approve_and_send with:

    • token: the action.fromToken.address from the quote
    • spender: the estimate.approvalAddress from the quote
    • approveAmount: the action.fromAmount from the quote (or omit for unlimited)
    • to, value, data, gasLimit: from the quote's transactionRequest
  • If approval is NOT needed (native ETH swap, value > 0x0): Use defi_send_transaction with the quote's transactionRequest fields: to, value, data, chainId, and gasLimit (ALWAYS pass gasLimit from the quote).

NEVER construct approve calldata hex yourself. The defi_approve and defi_approve_and_send tools handle ABI encoding correctly.

Sui: For quotes where fromChain or toChain is Sui, use defi_send_sui_transaction with the quote's transaction bytes. No approval step.

POST /v1/advanced/routes — Get multiple route options

curl -s --request POST \
  --url https://li.quest/v1/advanced/routes \
  --header 'Content-Type: application/json' \
  --header "x-lifi-api-key: $LIFI_API_KEY" \
  --data '{
  "fromChainId": 8453,
  "fromAmount": "100000000000000",
  "fromTokenAddress": "0x0000000000000000000000000000000000000000",
  "toChainId": 8453,
  "toTokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "options": {
    "slippage": 0.10,
    "order": "RECOMMENDED"
  }
}'

POST /v1/quote/contractCalls — Multi-step contract calls (BETA)

curl -s --request POST \
  --url https://li.quest/v1/quote/contractCalls \
  --header 'Content-Type: application/json' \
  --header "x-lifi-api-key: $LIFI_API_KEY" \
  --data '{
  "fromChain": 10,
  "fromToken": "0x4200000000000000000000000000000000000042",
  "fromAddress": "0xYOUR_ADDRESS",
  "toChain": 1,
  "toToken": "ETH",
  "toAmount": "100000000000001",
  "contractCalls": []
}'

GET /v1/status — Check transfer status

curl -s --request GET \
  --url 'https://li.quest/v1/status?txHash=0xYOUR_TX_HASH&fromChain=8453' \
  --header "x-lifi-api-key: $LIFI_API_KEY"

Pass fromChain to speed up the lookup.

GET /v1/tools — List available bridges and exchanges

curl -s --request GET \
  --url 'https://li.quest/v1/tools?chains=8453' \
  --header "x-lifi-api-key: $LIFI_API_KEY"

Docs

Usage Guidance
This skill is internally consistent with its purpose, but review these before installing: 1) It requires your LI.FI API key — ensure you trust the agent and that the key has appropriate (minimal) permissions and can be revoked. 2) The skill expects to call other agent DeFi tools (defi_get_wallet, defi_approve_and_send, defi_send_transaction, etc.) — confirm the agent will prompt you before broadcasting or approving on-chain transactions. 3) Default slippage is high (10%) and skipSimulation=true is enforced; both can increase risk of unexpected outcomes — consider setting lower slippage or confirming each trade. 4) Test with small amounts first and verify quoted transactions on LI.FI docs (https://docs.li.fi/). Revoke the API key if you stop using the skill.
Capability Analysis
Type: OpenClaw Skill Name: lifi-skill Version: 2.0.1 The OpenClaw AgentSkills skill bundle for LI.FI is classified as benign. The `SKILL.md` file contains clear, explicit instructions for the AI agent that are highly constraining and security-conscious. It strictly limits the agent to using `curl` only with the `https://li.quest/v1/` API, explicitly forbids `web_search` or `web_fetch`, and mandates the use of trusted OpenClaw tools (`defi_approve`, `defi_send_transaction`, etc.) for on-chain interactions, specifically prohibiting manual construction of critical transaction data. There is no evidence of data exfiltration, malicious execution, persistence, obfuscation, or prompt injection designed to subvert the agent for harmful purposes; instead, the instructions aim to keep the agent's actions within the stated purpose of interacting with the LI.FI API.
Capability Assessment
Purpose & Capability
Name/description match the SKILL.md: the skill is an instruction-only wrapper for LI.FI API calls and only requests LIFI_API_KEY as expected.
Instruction Scope
Instructions are narrowly scoped to LI.FI endpoints and explicitly require using provided agent DeFi tools (defi_get_wallet, defi_approve_and_send, defi_send_transaction, etc.). Two notable operational choices to be aware of: a default slippage of 10% (0.10) and the directive to always add skipSimulation=true to /v1/quote requests — both affect transaction behavior and risk but are within the skill's stated domain.
Install Mechanism
No install spec or code files — instruction-only skill. Nothing is downloaded or written to disk by the skill itself.
Credentials
Only one environment variable (LIFI_API_KEY) is required and it directly corresponds to the LI.FI API usage described in the instructions.
Persistence & Privilege
always is false and the skill has no install that modifies system or other skills. It does rely on other agent tools to access user wallets and send transactions, which is expected for a DeFi integration.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install lifi-skill
  3. After installation, invoke the skill by name or use /lifi-skill
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v2.0.1
LI.FI Skill 2.0.1 Changelog - Major skill rewrite with stricter security and usage rules for all DeFi swaps and bridges. - Default slippage increased to 10%; dynamically adjustable if user requests. - All /v1/quote requests now require &skipSimulation=true to ensure compatibility with delegated wallets. - Explicit support and special instructions for Sui chain swaps and bridging (chain ID 9270000000000000). - Clear separation for handling ERC-20 approval flows, ensuring all approvals use provided tools. - After transaction, always return a clickable block explorer link for easy tracking. - Only documented LI.FI API endpoints may be used; no guessing or external API calls.
v2.0.0
Initial release
v1.0.10
- Major rewrite of SKILL.md to simplify and clarify usage instructions. - Added explicit rules: never use web_search for quotes/routes; always use LI.FI skill and curl; never use external price sources. - Introduced a new "How to use the LIFI API" section with concise, example-driven instructions for every supported endpoint. - Specified user-facing guidance: always state quotes are provided by LI.FI, not the agent. - Provided default slippage (1%) and deadline (10 minutes) when not specified. - Improved endpoint documentation with clear request examples and descriptions.
v1.0.9
**Enforces "curl-only" HTTP requests for all LI.FI API access** - All HTTP requests to LI.FI endpoints must now be executed via curl shell commands; do not use fetch, axios, or other libraries. - Updated documentation to emphasize: always use curl for data retrieval and quotes. - Added bold reminders in API reference sections about the curl execution requirement. - No functional or logic changes to endpoints or wallet execution behavior.
v1.0.8
No user-facing changes in this release.
v1.0.7
lifi-skill 1.0.7 - Added requirement for the "curl" binary in the environment for improved HTTP request handling. - Updated metadata to reflect the new dependency: `"bins": ["curl"]`.
v1.0.6
lifi-skill 1.0.6 - Improved instructions to always use LI.FI endpoints for price quotes and never rely on external sources. - Clarified that router/token addresses and slippage defaults should be taken from LI.FI API responses, not requested from users. - Added detailed wallet execution steps for working with Openclast wallet: quote fetching, address resolution, contract call field mapping, and transaction submission. - Added a "NEVER" warning to reinforce using only LI.FI’s data (not Coinbase, etc.) for quote estimation.
v1.0.5
- Expanded documentation with detailed API endpoint specifications for LI.FI, including request/response examples. - Added a new section describing how to send transactions using a native wallet (e.g., openclast-wallet) with the `wallet_send` tool. - Provided action-oriented guides for the `/chains`, `/tokens`, and `/quote` endpoints, covering expected parameters and key response fields. - Included information about fetching the documentation index and clarified usage of the authoritative OpenAPI spec. - All previous functionality and requirements remain, with improved clarity and step-by-step instructions for developers and users.
v1.0.4
lifi-skill 1.0.4 - Documentation updated to reference the OpenAPI YAML and LLM-specific docs. - Added guidance to use the OpenAPI spec for transaction request construction. - Removed detailed endpoint request/response instructions from the main documentation. - Clarified that the OpenAPI spec is the authoritative source for API interactions.
v1.0.3
**More explicit LI.FI API usage guidance with OpenAPI request templates.** - Clarifies to not use web search tools and instead fetch data directly from LI.FI endpoints via HTTP. - Specifies the use of the `x-lifi-api-key` header for authentication if `LIFI_API_KEY` is set. - Adds detailed HTTP request templates for `/v1/quote` (GET) and `/v1/advanced/routes` (POST) with required/optional parameters and example curl commands. - Directs usage of the OpenAPI specification as the authoritative source for endpoints, parameters, and headers. - Existing functionality for quoting, validation, building transactions, and tracking status remains unchanged.
v1.0.2
- Added support for an optional LIFI_API_KEY environment variable to enable higher rate limits and production usage. - Updated authentication instructions to document API key usage and recommend it for production. - Added "requires" and "primaryEnv" metadata to clarify environment variable support. - Clarified that public access may be subject to rate limiting without an API key.
v1.0.1
Minor update to add skill metadata. - Added skill metadata section to SKILL.md, including name, description, homepage, and emoji. - No changes to behavior, endpoints, or functionality.
v1.0.0
- removed 1 file(s). - Updated SKILL.md and bundle contents.
Metadata
Slug lifi-skill
Version 2.0.1
License
All-time Installs 3
Active Installs 3
Total Versions 13
Frequently Asked Questions

What is LI.FI Skill?

v4 - Use LI.FI API for cross-chain and same-chain swaps, bridges, and contract calls. Use when quoting routes, validating chains/tokens, building transaction requests, and tracking status. It is an AI Agent Skill for Claude Code / OpenClaw, with 2815 downloads so far.

How do I install LI.FI Skill?

Run "/install lifi-skill" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is LI.FI Skill free?

Yes, LI.FI Skill is completely free (open-source). You can download, install and use it at no cost.

Which platforms does LI.FI Skill support?

LI.FI Skill is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created LI.FI Skill?

It is built and maintained by fabriziogianni7 (@fabriziogianni7); the current version is v2.0.1.

💬 Comments