/candle:candle-tradefrom candle
Executes buy/sell/swap trades and limit orders for Candle-launched tokens on Solana. Handles trade timeouts, idempotent retries, and deferred execution with quotes.
Ships in candle. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
For detailed per-token signals and wallet intelligence, call GET https://api.hacc.fun/v1/signals?asset=<mint>&chain=solana&limit=50 with Authorization: Bearer <your cndl_live_ key> (production only, rows filtered to your plan); see Data and strategy API.
Executes a buy or sell through Candle's trade rail. The payer is the account's own embedded (main) wallet, executed server-side via delegation. Amounts are always decimal, the tool converts to raw base units itself.
Do NOT call candle_trade again to find out what happened. Every result carries a
clientTradeId, including the error a timeout produces, and candle_get_operation looks the trade
up by it:
{ "kind": "trade", "clientId": "<the clientTradeId from the failed call>" }
confirmed or failed means it is over. built means it is still in flight, so wait and ask
again. A 404 means no record under that id yet. That does not prove the trade did not run: a build
that is still starting has no record yet. Send the same request again with the same
clientTradeId. It returns the stored outcome or reports the trade still running, and it never
trades twice. If that resend is refused (a conflict or a limit), the refusal is about the resend,
not about the trade: ask candle_get_operation again before reporting an outcome.
Retrying candle_trade with the SAME clientTradeId is also safe, because the rail replays rather
than trading twice. Retrying with a NEW id is a second trade.
Needs an agent API key carrying the swap:write scope. If you followed the candle-setup skill's
device flow (candle auth login with --scopes omitted), you already have it: that flow's default
is a Read:Write key, swap:write included, and the browser approval screen names each scope
explicitly before you approve. swap:write is never granted silently, only ever named on that
screen or asked for by hand. A key minted with an explicit --scopes list (on candle auth login or candle keys create) that leaves swap:write out cannot trade; mint one with candle keys create --access read-write (or read-write-transfer)
instead. There is no keyless path for trading: this always moves funds. Point the
MCP server anywhere: the CLI and MCP default to the alpha API host
(https://api.alpha.candle.tv), where the trade routes run today. Set CANDLE_API_URL only to
point at a different deployment.
candle_trade takes deferExecution: true: it builds the trade and returns the quote with
status: "built", and nothing is signed or spent. To go ahead, call candle_trade_execute with the same
clientTradeId within 30 minutes; after that it is QUOTE_EXPIRED and you build again. There is no cancel,
so let an unwanted build expire. It cannot be combined with paper. Executing twice never trades twice.
candle_trade takes paper: true. The request runs through every admission rule a live trade runs
through, the same planner, the same spend gate, the same key cap, the same loss limits, and records
what it was quoted. Nothing is broadcast and no funds move.
Use it before the first live trade of a new strategy, and any time you are unsure a trade would be admitted at all. Finding out that a key cap or a loss limit refuses you is much cheaper this way than by having the live call fail halfway.
Two things to hold onto about a paper fill:
Candle's activity bar and Discord show trades from published agents under the agent's name. To keep
one order out, send hide: true on that order (CLI --hide, candle_trade hide); it is set when
you place the order and can never be edited after.
paper.candle swap <from> <to> --hide; MCP candle_trade). Base-asset
swaps, bridges, --dry-run and MCP candle_swap refuse it for now. A client release that
carries hide is needed; an older one cannot send it.hide: true, do not sign or execute: the server
did not accept it and the order would be public. While the feature is off the server refuses a
request carrying hide and places nothing; resend without it to trade publicly.If the user gave you only a contract address, call candle_resolve_token with it first.
It returns the token and its chain, read off the address's own shape, so you never have to ask
which chain an address is on or guess. If you are unsure the key can trade at all, or a previous
call failed on authorization, candle_execution_status answers that in one call (wallets, tier,
and this key's own spend limits) rather than leaving you to infer it from a failed trade.
Call candle_trade with mint, side ("buy" or "sell"), and exactly one of amount or
percent.
amount is denominated in the token's OWN quote asset, whatever it was launched
against (SOL for a SOL-launched token, USDC or CNDL for those quote pairs). The tool reads the
market first and converts against its quoteDecimals, so you never compute raw base units.amount is denominated in the token itself, and converts against the market's own
decimals. Or pass percent (an integer 1-100) to sell a slice of the wallet's
current holding; the MCP resolves the balance for you.quoteAsset only matters for an arbitrary Solana mint Candle never launched, the path traded
through Jupiter (buying and selling work on any plan). It changes nothing for a Candle-launched token.maxSlippageBps overrides the API's default slippage tolerance.Every call carries a clientTradeId, auto-generated and echoed back when omitted.
Retry a timed-out or uncertain call with the SAME id and the same body: it replays the
original result instead of trading twice. A new id (including the auto-generated default, if
you did not capture and reuse the one you got back) is a second, independent trade.
Attribute it: once the trade confirms, call candle_report_activity with { "chain": "solana", "signature": "<the trade's signature>" } (or chain: "hood" for a Hood trade) so Candle records
and verifies it under your account's activity, the same signal that feeds attribution elsewhere
on Candle. This is a separate call from the trade itself; it needs activity:write, which is in
the default key scope set either way you got your key.
Candle can watch a price and flip an order to triggered server-side, but it does not fill
unattended: an order only fills while your agent is online to react to the trigger and complete
the trade. This is honest by design, not a limitation to work around. The trigger itself is
pushed as an order.triggered webhook (see the candle-webhooks skill), with polling as the
fallback. It requires Max tier and a linked wallet (the account's main embedded wallet cannot
place one), and it is not exposed as an MCP tool today: it is a REST-only surface your agent's
own online loop has to drive directly.
Trading on Hood spends from the account's embedded evm wallet, and launching on Hood does too. If
that wallet is empty, nothing on hood can succeed, and the trade rail cannot fill it: candle_trade
moves a token against its quote asset, it does not convert one base asset into another.
candle_swap is that conversion. It takes from and to as base-asset keys (SOL, USDC, CNDL
on the Solana side; ETH, USDG on the Hood side), plus amount as a decimal, the same as the trade
tool (e.g. "0.5"; amountRaw still accepts raw base units for older callers). A pair spanning the two sides routes through the bridge,
so {from: "SOL", to: "ETH"} is how a Hood wallet gets funded out of Solana holdings. The swap rail
charges no platform fee at any tier and is not subject to the spend cap, though the swap:write
scope and the per-key rate limit apply exactly as they do to a trade.
Two things to know before calling it. A cross-chain fill settles as more than one transaction, so
the result carries a hashes array and statusChecks URLs to poll: the Solana leg confirming does
not mean the Hood side has landed. And clientSwapId is a durable idempotency key: the same id
with the same body, including effective slippage, replays the stored result. A timeout is unknown
until you retry that same id: an indeterminate first leg comes back as SWAP_FAILED, retryable
false, with the signature in the message, so verify it on-chain before a new id. A different body
is rejected. Omitting the id never coalesces. A confirmed first leg is replayed with its hash and
retryable false if a later leg did not finish. retryable: true on the first LEG2_FAILED means
send leg 2 as a new request.
When your agent signs from a linked wallet, which a limit order's completing trade always does, the relay signs only transactions Candle itself built: at build time Candle hashes the unsigned artifact and stamps it onto a single-use claim, and the relay only signs a request whose hash matches an unconsumed claim scoped to that same account and wallet. A stolen key cannot get an arbitrary, hand-rolled transaction signed through it this way.
Spend limits are the account owner's own opt-in ceiling, unlimited by default. Once set, every buy's total outflow (amount plus fee) is checked against it before the trade begins, and exceeding it rejects the trade, naming the cap. A key can also carry its own per-asset spend cap, which replaces the account's cap for that asset rather than adding to it.
swap:write is never granted silently: the device-flow approval screen (see candle-setup) names it
as its own fund-moving grant before any key exists, and a key minted with a narrower scope list,
whether through an explicit --scopes on candle auth login or via candle keys create without
--access read-write, leaves it out unless you ask for it.
"Buy 0.5 SOL of this token."
{ "mint": "<mint>", "side": "buy", "amount": "0.5" }
"Sell 25% of my position."
{ "mint": "<mint>", "side": "sell", "percent": 25 }
If a call times out or the connection drops, retry with the exact clientTradeId the first
attempt echoed back, never a fresh one.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub candledottv/agentic --plugin candle23 skills in this plugin
/candle-agent-operations[OPERATIONS] Run long-lived trading workers and data collectors so they recover from crashes without losing state, never extend their own run, report health truthfully, and hand over cleanly to the next agent session. Use when deploying a trading worker or collector that runs for hours or days, when a worker has crashed, hung or restarted, and when ending a session that leaves workers running./candle-book-limits[RISK CONTROL] Size and audit the lifetime caps, slot counts and wallet reserves of an autonomous trading book so they bound risk without silently stopping the book or blocking its exits. Use when designing a book's limits, when a running book has gone quiet, when an order is stuck unresolved, and when two books share one wallet./candle-