ワンクリックで
execute-trade
Executes validated trade signals on Solana via Jupiter, with preflight simulation and slippage protection
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Executes validated trade signals on Solana via Jupiter, with preflight simulation and slippage protection
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Scans arxiv for new papers in crypto, DeFi, MEV, ZK, and AI-agent domains
Generates a structured changelog from git history, PRs, and release notes
Monitors CI/CD pipeline status, build times, failure patterns, and flaky tests
Monitors competitor projects for new releases, partnerships, TVL changes, and strategic moves
Produces a concise daily digest of market activity, research findings, and notable events
Audits project dependencies for vulnerabilities, outdated packages, and license compliance
| name | execute-trade |
| description | Executes validated trade signals on Solana via Jupiter, with preflight simulation and slippage protection |
| tags | ["trading","execution","jupiter","solana","swap","transactions"] |
| agent | executor |
| var | ${var} overrides the default protocol. If set (e.g., "raydium"), route through that protocol instead of Jupiter. If empty, use Jupiter aggregator. |
Priority: P0 (reactive — only runs on trade-signal trigger) Input:
memory/mesh/executor.json(trade-signals from analyst or guardian) Output: Execution reports to analyst + guardian inboxes, tx-log, positions
You are executing the execute-trade skill for the Executor agent.
0a. Check Guardian halt:
Read memory/mesh/executor.json for halt or cooldown messages from Guardian.
If active halt (cooldown_until > now): EXIT IMMEDIATELY.
Exit code: EXEC_HALTED
0b. Check wallet:
Verify SOLANA_PRIVATE_KEY is set. If not: EXIT.
Exit code: EXEC_NO_WALLET
0c. Check RPC:
Verify Solana RPC is reachable: curl -s -X POST "${SOLANA_RPC_URL}" -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1,"method":"getHealth"}'
If not healthy: EXIT.
Exit code: EXEC_RPC_DOWN
Read memory/mesh/executor.json for messages where type = trade-signal.
Sort by: priority = "urgent" first, then by confidence descending.
Process one trade at a time (never batch).
For each trade-signal, check all of the following:
| Check | Pass condition | On fail |
|---|---|---|
| Source | from is "analyst" or "guardian" | Reject: unknown source |
| Confidence | confidence >= ${min_confidence} (from analyst config) | Reject: below threshold |
| Position size | Amount in USD <= ${max_position_usd} | Reject: exceeds limit |
| Exposure | Adding this position keeps single-token exposure < 80% of portfolio | Reject: overexposed |
| Duplicate | No identical trade in memory/tx-log.json within last 1h | Reject: duplicate |
| Balance | Wallet has sufficient SOL (including ~0.01 SOL for gas) | Reject: insufficient balance |
If any check fails: log to memory/tx-log.json with status rejected and skip.
For BUY orders:
# 1. Get quote
curl -s "https://quote-api.jup.ag/v6/quote?\
inputMint=So11111111111111111111111111111111111111112&\
outputMint=${token_address}&\
amount=${amount_in_lamports}&\
slippageBps=${slippage_bps}"
# 2. Get swap transaction
curl -s -X POST "https://quote-api.jup.ag/v6/swap" \
-H "Content-Type: application/json" \
-d '{
"quoteResponse": <from step 1>,
"userPublicKey": "<wallet_pubkey>",
"wrapAndUnwrapSol": true,
"dynamicComputeUnitLimit": true,
"prioritizationFeeLamports": "auto"
}'
# 3. Deserialize, sign, and send
# Use @solana/web3.js VersionedTransaction
# Send with maxRetries: 3, skipPreflight: false
For SELL orders: Reverse inputMint and outputMint.
Preflight simulation (MANDATORY):
Before sending, simulate the transaction with simulateTransaction. If simulation fails or returns an error, ABORT. Log the simulation error.
Slippage guard:
After getting the quote, check otherAmountThreshold. If actual output is more than ${slippage_bps} below expected, ABORT.
After sending:
confirmed, timeout: 60s)(expected_price - actual_price) / expected_price * 10000 bpsOn successful fill, update memory/positions.json:
{
"token": "JUP",
"token_address": "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN",
"entry_price": 1.234,
"amount": 100.5,
"amount_usd": 50.00,
"entry_time": "2026-05-18T12:00:00.000Z",
"stop_loss_pct": -8,
"take_profit_pct": 25,
"strategy": "momentum",
"tx_signature": "5xG7...",
"signal_id": "analyst-1716000000000-a3f2"
}
For SELL orders: remove the position from positions.json and record the exit in tx-log.
Write execution-report to both memory/mesh/analyst.json and memory/mesh/guardian.json:
{
"from": "executor",
"to": ["analyst", "guardian"],
"type": "execution-report",
"id": "exec-{timestamp}",
"timestamp": "{now_iso}",
"data": {
"signal_id": "analyst-...",
"status": "filled | failed | aborted | rejected",
"action": "buy",
"token": "JUP",
"amount": 100.5,
"price": 1.234,
"amount_usd": 50.00,
"slippage_actual_bps": 30,
"tx_signature": "5xG7...",
"error": null
}
}
Append to memory/tx-log.json.
${max_position_usd}. This is a hard limit, not a suggestion.EXEC_FILLED — trade executed successfullyEXEC_PARTIAL — partially filled (log actual fill amount)EXEC_ABORTED — aborted due to slippage, simulation failure, or validationEXEC_REJECTED — signal failed validation checksEXEC_FAILED — transaction sent but failed on-chainEXEC_HALTED — Guardian halt activeEXEC_NO_WALLET — no private key configuredEXEC_RPC_DOWN — RPC unreachableCommit message format: executor: {action} {amount} {token} @ ${price} — {status} tx:{sig_short}
Example: executor: buy 100.5 JUP @ 1.234 — filled tx:5xG7...