lcx-liberty-swap

Installation
SKILL.md

LCX Liberty DEX swap

Return a quote comparison or an exact unsigned LCX Liberty DEX swap plan. LCX Liberty DEX is a non-custodial EVM aggregator that routes through its own pool index and router contract. A quote, a build and a fill are different facts.

Check access first

Every request needs the user's own key, read from LCX_API_KEY and sent as Authorization: Bearer $LCX_API_KEY. Before the first request, check that LCX_API_KEY is set. If it is missing, stop and report: LCX_API_KEY is not set. Create a key at https://dex.lcx.com/dashboard and export LCX_API_KEY before using lcx-liberty-swap. Do not ask the user to paste the key into the conversation, never write it to a file, a query string or a log, and do not create an account on the user's behalf.

A request without a key returns 401 API_KEY_REQUIRED; a present key that does not resolve returns 401 INVALID_API_KEY and is never served anonymously. A key pinned to other origins or IPs returns 403. Only /health and /ready answer without a key.

Read the exact swap

Collect chain ID, sell and buy token addresses, raw sell amount, taker, recipient and the user's slippage or loss limit. Read the chain's row in GET /v1/chains: available, degraded and routerDeployed decide whether a quote can become a transaction, router is the contract the handoff must target, and nativeIsToken decides how the gas coin is named. Where nativeIsToken is false the native coin is the zero address. Where it is true (Arc, whose gas coin is USDC) there is no native placeholder: name the coin by its token contract address, resolved with GET /v1/tokens, and sell it like any ERC-20, with an approval and a value of 0. Price with POST /v1/quote as shown in reads. amountIn is an integer string in the sell token's base units; slippageBps defaults to 50 and is capped at 2000.

Inspect output.amount, output.minimumAmount, gasEstimateWei, gasFeeUSD, priceImpactPct, routes, venues, blockNumber, expiresAt and stale. A missing priceImpactPct means one side cannot be priced from the index: warn instead of proceeding. stale: true will not build, and a degraded chain quotes but refuses builds. no_route, insufficient_liquidity, transfer_tax and transfer_blocked are concrete gaps, not weaker quotes.

Compare on one unit

Compare providers for the same chain, tokens, raw amount and recipient within one block window, on the guaranteed minimum rather than the headline output:

Installs
2
GitHub Stars
11
First Seen
3 days ago