{
  "schemaVersion": "1.0",
  "item": {
    "slug": "headless-crypto",
    "name": "Headless  Crypto trading for agents",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/bnbcompanions/headless-crypto",
    "canonicalUrl": "https://clawhub.ai/bnbcompanions/headless-crypto",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/headless-crypto",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=headless-crypto",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "scripts/get_balance.py",
      "scripts/get_price.py",
      "scripts/monitor_pool.py",
      "scripts/pancakeswap_swap.py",
      "scripts/raydium_swap.py"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/headless-crypto"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/headless-crypto",
    "agentPageUrl": "https://openagent3.xyz/skills/headless-crypto/agent",
    "manifestUrl": "https://openagent3.xyz/skills/headless-crypto/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/headless-crypto/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Headless Trading",
        "body": "Autonomous trading toolkit for AI agents on Solana (Raydium) and BNB Chain (PancakeSwap)."
      },
      {
        "title": "1. Token Swaps",
        "body": "Execute swaps on decentralized exchanges without browser interaction:\n\nRaydium (Solana): SOL ↔ SPL tokens\nPancakeSwap (BNB Chain): BNB ↔ BEP20 tokens"
      },
      {
        "title": "2. Price Monitoring",
        "body": "Fetch real-time token prices:\n\nDEX liquidity pool prices\nMultiple pair support\nSlippage calculation"
      },
      {
        "title": "3. Portfolio Management",
        "body": "Check balances and positions:\n\nNative token balances (SOL, BNB)\nToken holdings across wallets\nTransaction history"
      },
      {
        "title": "4. Strategy Execution",
        "body": "Implement automated trading strategies:\n\nLimit orders (via monitoring + execution)\nDCA (Dollar Cost Averaging)\nStop-loss / Take-profit\nArbitrage opportunities"
      },
      {
        "title": "Prerequisites",
        "body": "Private key (environment variable or secure storage)\nRPC endpoint (public or private node)\nPython 3.8+ with dependencies"
      },
      {
        "title": "Installation",
        "body": "pip install solana web3 anchorpy raydium-py base58\npip install web3 pancakeswap-sdk"
      },
      {
        "title": "Basic Swap Example",
        "body": "from scripts.raydium_swap import swap_on_raydium\n\n# Swap 0.1 SOL for USDC\ntx_hash = swap_on_raydium(\n    input_token=\"SOL\",\n    output_token=\"USDC\",\n    amount=0.1,\n    slippage=1.0  # 1% slippage tolerance\n)"
      },
      {
        "title": "Workflow Decision Tree",
        "body": "1. What chain are you trading on?\n\nSolana → Use raydium_* scripts + See references/raydium.md\nBNB Chain → Use pancakeswap_* scripts + See references/pancakeswap.md\n\n2. What operation do you need?\n\nGet token price → get_price.py\nCheck wallet balance → get_balance.py\nExecute swap → swap.py\nMonitor liquidity → monitor_pool.py\n\n3. What strategy are you implementing?\n\nOne-time trade → Direct swap\nAutomated strategy → See references/strategies.md"
      },
      {
        "title": "Get Token Price",
        "body": "from scripts.get_price import get_token_price\n\n# Get current price of a token\nprice = get_token_price(\n    chain=\"solana\",\n    token_address=\"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",  # USDC\n    quote_token=\"SOL\"\n)\nprint(f\"Price: {price} SOL\")"
      },
      {
        "title": "Check Wallet Balance",
        "body": "from scripts.get_balance import get_balance\n\n# Check SOL balance\nbalance = get_balance(\n    chain=\"solana\",\n    wallet_address=\"YOUR_WALLET_ADDRESS\"\n)\nprint(f\"Balance: {balance} SOL\")"
      },
      {
        "title": "Execute Swap",
        "body": "from scripts.swap import execute_swap\n\n# Swap tokens with slippage protection\nresult = execute_swap(\n    chain=\"solana\",\n    input_token=\"SOL\",\n    output_token=\"USDC\",\n    amount=0.5,\n    slippage=1.0,\n    private_key=\"YOUR_PRIVATE_KEY\"  # Use env var in production\n)"
      },
      {
        "title": "Monitor Liquidity Pool",
        "body": "from scripts.monitor_pool import get_pool_info\n\n# Get liquidity pool stats\npool_info = get_pool_info(\n    chain=\"solana\",\n    token_a=\"SOL\",\n    token_b=\"USDC\"\n)\nprint(f\"Liquidity: ${pool_info['liquidity']}\")\nprint(f\"24h Volume: ${pool_info['volume_24h']}\")"
      },
      {
        "title": "1. Private Key Management",
        "body": "NEVER hardcode private keys. Use environment variables or secure vaults:\n\nimport os\n\nPRIVATE_KEY = os.getenv(\"TRADING_PRIVATE_KEY\")\nif not PRIVATE_KEY:\n    raise ValueError(\"TRADING_PRIVATE_KEY not set\")"
      },
      {
        "title": "2. Slippage Protection",
        "body": "Always set reasonable slippage limits:\n\nStablecoins: 0.1-0.5%\nBlue chips: 0.5-1%\nLow liquidity: 1-3% (risky)"
      },
      {
        "title": "3. Transaction Simulation",
        "body": "Test swaps on devnet/testnet first:\n\nresult = execute_swap(\n    chain=\"solana\",\n    input_token=\"SOL\",\n    output_token=\"USDC\",\n    amount=0.01,  # Small test amount\n    slippage=1.0,\n    simulate=True  # Dry run\n)"
      },
      {
        "title": "4. Rate Limiting",
        "body": "Respect RPC rate limits:\n\nPublic RPCs: ~5 req/sec\nPrivate RPCs: Check provider limits"
      },
      {
        "title": "5. Error Handling",
        "body": "Always handle transaction failures:\n\ntry:\n    tx_hash = execute_swap(...)\n    print(f\"Success: {tx_hash}\")\nexcept InsufficientFundsError:\n    print(\"Not enough balance\")\nexcept SlippageExceededError:\n    print(\"Price moved too much\")\nexcept RPCError as e:\n    print(f\"RPC failed: {e}\")"
      },
      {
        "title": "Pattern 1: Price Monitoring Bot",
        "body": "Monitor token prices and execute when conditions are met:\n\nfrom scripts.get_price import get_token_price\nfrom scripts.swap import execute_swap\nimport time\n\nTARGET_PRICE = 100  # USDC per token\nCHECK_INTERVAL = 60  # seconds\n\nwhile True:\n    price = get_token_price(chain=\"solana\", token_address=\"...\", quote_token=\"USDC\")\n    \n    if price <= TARGET_PRICE:\n        execute_swap(\n            chain=\"solana\",\n            input_token=\"USDC\",\n            output_token=\"TARGET_TOKEN\",\n            amount=100,\n            slippage=1.0\n        )\n        break\n    \n    time.sleep(CHECK_INTERVAL)"
      },
      {
        "title": "Pattern 2: DCA (Dollar Cost Averaging)",
        "body": "Buy fixed amounts at regular intervals:\n\nimport schedule\n\ndef dca_buy():\n    execute_swap(\n        chain=\"solana\",\n        input_token=\"SOL\",\n        output_token=\"BTC\",\n        amount=0.1,  # 0.1 SOL every day\n        slippage=1.0\n    )\n\n# Run daily at 9 AM\nschedule.every().day.at(\"09:00\").do(dca_buy)"
      },
      {
        "title": "Pattern 3: Stop-Loss",
        "body": "Sell when price drops below threshold:\n\nENTRY_PRICE = 100\nSTOP_LOSS_PERCENT = 10  # 10% loss\n\nwhile True:\n    current_price = get_token_price(...)\n    loss_percent = ((ENTRY_PRICE - current_price) / ENTRY_PRICE) * 100\n    \n    if loss_percent >= STOP_LOSS_PERCENT:\n        execute_swap(...)  # Sell position\n        break\n    \n    time.sleep(60)"
      },
      {
        "title": "scripts/",
        "body": "Executable Python scripts for trading operations:\n\nget_price.py - Fetch token prices from DEXs\nget_balance.py - Check wallet balances\nswap.py - Execute token swaps\nmonitor_pool.py - Get liquidity pool info\nraydium_swap.py - Raydium-specific swap implementation\npancakeswap_swap.py - PancakeSwap-specific swap implementation"
      },
      {
        "title": "references/",
        "body": "raydium.md - Raydium DEX API reference and pool addresses\npancakeswap.md - PancakeSwap DEX API reference\nstrategies.md - Detailed trading strategy implementations\nrpc_endpoints.md - List of public/private RPC providers"
      },
      {
        "title": "Limitations",
        "body": "Gas fees: Transactions require native tokens (SOL, BNB)\nSlippage: High volatility can cause failed transactions\nRPC reliability: Public RPCs may be slow/unstable\nMEV: Transactions may be frontrun on popular pairs"
      },
      {
        "title": "\"Insufficient funds\"",
        "body": "Check wallet balance with get_balance.py\nEnsure enough native token for gas fees"
      },
      {
        "title": "\"Slippage exceeded\"",
        "body": "Increase slippage tolerance (carefully)\nWait for lower volatility\nSplit large orders into smaller ones"
      },
      {
        "title": "\"Transaction failed\"",
        "body": "Check RPC endpoint is responsive\nVerify token addresses are correct\nEnsure wallet has approval for token spend"
      },
      {
        "title": "\"Rate limited\"",
        "body": "Switch to private RPC\nAdd delays between requests\nUse multiple RPC endpoints"
      }
    ],
    "body": "Headless Trading\n\nAutonomous trading toolkit for AI agents on Solana (Raydium) and BNB Chain (PancakeSwap).\n\nCore Capabilities\n1. Token Swaps\n\nExecute swaps on decentralized exchanges without browser interaction:\n\nRaydium (Solana): SOL ↔ SPL tokens\nPancakeSwap (BNB Chain): BNB ↔ BEP20 tokens\n2. Price Monitoring\n\nFetch real-time token prices:\n\nDEX liquidity pool prices\nMultiple pair support\nSlippage calculation\n3. Portfolio Management\n\nCheck balances and positions:\n\nNative token balances (SOL, BNB)\nToken holdings across wallets\nTransaction history\n4. Strategy Execution\n\nImplement automated trading strategies:\n\nLimit orders (via monitoring + execution)\nDCA (Dollar Cost Averaging)\nStop-loss / Take-profit\nArbitrage opportunities\nQuick Start\nPrerequisites\nPrivate key (environment variable or secure storage)\nRPC endpoint (public or private node)\nPython 3.8+ with dependencies\nInstallation\npip install solana web3 anchorpy raydium-py base58\npip install web3 pancakeswap-sdk\n\nBasic Swap Example\nfrom scripts.raydium_swap import swap_on_raydium\n\n# Swap 0.1 SOL for USDC\ntx_hash = swap_on_raydium(\n    input_token=\"SOL\",\n    output_token=\"USDC\",\n    amount=0.1,\n    slippage=1.0  # 1% slippage tolerance\n)\n\nWorkflow Decision Tree\n\n1. What chain are you trading on?\n\nSolana → Use raydium_* scripts + See references/raydium.md\nBNB Chain → Use pancakeswap_* scripts + See references/pancakeswap.md\n\n2. What operation do you need?\n\nGet token price → get_price.py\nCheck wallet balance → get_balance.py\nExecute swap → swap.py\nMonitor liquidity → monitor_pool.py\n\n3. What strategy are you implementing?\n\nOne-time trade → Direct swap\nAutomated strategy → See references/strategies.md\nTrading Operations\nGet Token Price\nfrom scripts.get_price import get_token_price\n\n# Get current price of a token\nprice = get_token_price(\n    chain=\"solana\",\n    token_address=\"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",  # USDC\n    quote_token=\"SOL\"\n)\nprint(f\"Price: {price} SOL\")\n\nCheck Wallet Balance\nfrom scripts.get_balance import get_balance\n\n# Check SOL balance\nbalance = get_balance(\n    chain=\"solana\",\n    wallet_address=\"YOUR_WALLET_ADDRESS\"\n)\nprint(f\"Balance: {balance} SOL\")\n\nExecute Swap\nfrom scripts.swap import execute_swap\n\n# Swap tokens with slippage protection\nresult = execute_swap(\n    chain=\"solana\",\n    input_token=\"SOL\",\n    output_token=\"USDC\",\n    amount=0.5,\n    slippage=1.0,\n    private_key=\"YOUR_PRIVATE_KEY\"  # Use env var in production\n)\n\nMonitor Liquidity Pool\nfrom scripts.monitor_pool import get_pool_info\n\n# Get liquidity pool stats\npool_info = get_pool_info(\n    chain=\"solana\",\n    token_a=\"SOL\",\n    token_b=\"USDC\"\n)\nprint(f\"Liquidity: ${pool_info['liquidity']}\")\nprint(f\"24h Volume: ${pool_info['volume_24h']}\")\n\nSecurity Best Practices\n1. Private Key Management\n\nNEVER hardcode private keys. Use environment variables or secure vaults:\n\nimport os\n\nPRIVATE_KEY = os.getenv(\"TRADING_PRIVATE_KEY\")\nif not PRIVATE_KEY:\n    raise ValueError(\"TRADING_PRIVATE_KEY not set\")\n\n2. Slippage Protection\n\nAlways set reasonable slippage limits:\n\nStablecoins: 0.1-0.5%\nBlue chips: 0.5-1%\nLow liquidity: 1-3% (risky)\n3. Transaction Simulation\n\nTest swaps on devnet/testnet first:\n\nresult = execute_swap(\n    chain=\"solana\",\n    input_token=\"SOL\",\n    output_token=\"USDC\",\n    amount=0.01,  # Small test amount\n    slippage=1.0,\n    simulate=True  # Dry run\n)\n\n4. Rate Limiting\n\nRespect RPC rate limits:\n\nPublic RPCs: ~5 req/sec\nPrivate RPCs: Check provider limits\n5. Error Handling\n\nAlways handle transaction failures:\n\ntry:\n    tx_hash = execute_swap(...)\n    print(f\"Success: {tx_hash}\")\nexcept InsufficientFundsError:\n    print(\"Not enough balance\")\nexcept SlippageExceededError:\n    print(\"Price moved too much\")\nexcept RPCError as e:\n    print(f\"RPC failed: {e}\")\n\nCommon Patterns\nPattern 1: Price Monitoring Bot\n\nMonitor token prices and execute when conditions are met:\n\nfrom scripts.get_price import get_token_price\nfrom scripts.swap import execute_swap\nimport time\n\nTARGET_PRICE = 100  # USDC per token\nCHECK_INTERVAL = 60  # seconds\n\nwhile True:\n    price = get_token_price(chain=\"solana\", token_address=\"...\", quote_token=\"USDC\")\n    \n    if price <= TARGET_PRICE:\n        execute_swap(\n            chain=\"solana\",\n            input_token=\"USDC\",\n            output_token=\"TARGET_TOKEN\",\n            amount=100,\n            slippage=1.0\n        )\n        break\n    \n    time.sleep(CHECK_INTERVAL)\n\nPattern 2: DCA (Dollar Cost Averaging)\n\nBuy fixed amounts at regular intervals:\n\nimport schedule\n\ndef dca_buy():\n    execute_swap(\n        chain=\"solana\",\n        input_token=\"SOL\",\n        output_token=\"BTC\",\n        amount=0.1,  # 0.1 SOL every day\n        slippage=1.0\n    )\n\n# Run daily at 9 AM\nschedule.every().day.at(\"09:00\").do(dca_buy)\n\nPattern 3: Stop-Loss\n\nSell when price drops below threshold:\n\nENTRY_PRICE = 100\nSTOP_LOSS_PERCENT = 10  # 10% loss\n\nwhile True:\n    current_price = get_token_price(...)\n    loss_percent = ((ENTRY_PRICE - current_price) / ENTRY_PRICE) * 100\n    \n    if loss_percent >= STOP_LOSS_PERCENT:\n        execute_swap(...)  # Sell position\n        break\n    \n    time.sleep(60)\n\nResources\nscripts/\n\nExecutable Python scripts for trading operations:\n\nget_price.py - Fetch token prices from DEXs\nget_balance.py - Check wallet balances\nswap.py - Execute token swaps\nmonitor_pool.py - Get liquidity pool info\nraydium_swap.py - Raydium-specific swap implementation\npancakeswap_swap.py - PancakeSwap-specific swap implementation\nreferences/\nraydium.md - Raydium DEX API reference and pool addresses\npancakeswap.md - PancakeSwap DEX API reference\nstrategies.md - Detailed trading strategy implementations\nrpc_endpoints.md - List of public/private RPC providers\nLimitations\nGas fees: Transactions require native tokens (SOL, BNB)\nSlippage: High volatility can cause failed transactions\nRPC reliability: Public RPCs may be slow/unstable\nMEV: Transactions may be frontrun on popular pairs\nTroubleshooting\n\"Insufficient funds\"\nCheck wallet balance with get_balance.py\nEnsure enough native token for gas fees\n\"Slippage exceeded\"\nIncrease slippage tolerance (carefully)\nWait for lower volatility\nSplit large orders into smaller ones\n\"Transaction failed\"\nCheck RPC endpoint is responsive\nVerify token addresses are correct\nEnsure wallet has approval for token spend\n\"Rate limited\"\nSwitch to private RPC\nAdd delays between requests\nUse multiple RPC endpoints"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/bnbcompanions/headless-crypto",
    "publisherUrl": "https://clawhub.ai/bnbcompanions/headless-crypto",
    "owner": "bnbcompanions",
    "version": "1.0.1",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/headless-crypto",
    "downloadUrl": "https://openagent3.xyz/downloads/headless-crypto",
    "agentUrl": "https://openagent3.xyz/skills/headless-crypto/agent",
    "manifestUrl": "https://openagent3.xyz/skills/headless-crypto/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/headless-crypto/agent.md"
  }
}