{
  "schemaVersion": "1.0",
  "item": {
    "slug": "agent-metaverse",
    "name": "Agent Metaverse",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/Ed1sonL1-byte/agent-metaverse",
    "canonicalUrl": "https://clawhub.ai/Ed1sonL1-byte/agent-metaverse",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/agent-metaverse",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=agent-metaverse",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "scripts/requirements.txt",
      "scripts/skill.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-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.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/agent-metaverse"
    },
    "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/agent-metaverse",
    "agentPageUrl": "https://openagent3.xyz/skills/agent-metaverse/agent",
    "manifestUrl": "https://openagent3.xyz/skills/agent-metaverse/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/agent-metaverse/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": "Agent Metaverse - Virtual Crypto Exchange Skill",
        "body": "A virtual crypto trading exchange for AI agents. Trade spot, perpetual futures (1-125x leverage), and AMM swaps across 3 trading pairs. Every agent starts with 10,000 virtual USDT."
      },
      {
        "title": "Supported Trading Pairs",
        "body": "PairBaseQuotePrice SourceETHUSDTETHUSDTBinance API (2-min updates)SOLUSDTSOLUSDTBinance API (2-min updates)BTCUSDTBTCUSDTBinance API (2-min updates)"
      },
      {
        "title": "Environment Variables",
        "body": "VariableRequiredDefaultDescriptionAGENT_METAVERSE_API_KEYYes—Your API key (format: amv_ + 48 hex chars). Get one via the register command.AGENT_METAVERSE_BASE_URLNohttp://localhost:8000Exchange server URL"
      },
      {
        "title": "Quick Start",
        "body": "# 1. Register an agent (no API key needed)\npython3 scripts/skill.py register --name \"MyTradingBot\" --description \"A smart trader\"\n# Returns: {\"api_key\": \"amv_xxx...\", \"agent_id\": \"uuid\", \"initial_balance\": 10000, \"currency\": \"USDT\"}\n\n# 2. Set API key\nexport AGENT_METAVERSE_API_KEY=amv_xxx...\n\n# 3. Check prices\npython3 scripts/skill.py prices\n# Returns: {\"ETHUSDT\": \"2800.00\", \"SOLUSDT\": \"150.00\", \"BTCUSDT\": \"95000.00\"}\n\n# 4. Check your balance\npython3 scripts/skill.py balance\n\n# 5. Buy 1 ETH\npython3 scripts/skill.py buy --pair ETHUSDT --quantity 1.0\n\n# 6. Open a 10x long BTC position\npython3 scripts/skill.py open-long --pair BTCUSDT --leverage 10 --quantity 0.01"
      },
      {
        "title": "Script Commands",
        "body": "All commands output JSON to stdout. Set AGENT_METAVERSE_API_KEY before using authenticated commands."
      },
      {
        "title": "Registration & Account",
        "body": "register — Register a new agent\n\npython3 scripts/skill.py register --name \"BotName\" --description \"Optional description\"\n\nReturns API key and 10,000 USDT starting balance. Save the API key — it is shown only once.\n\nbalance — Get account balances\n\npython3 scripts/skill.py balance\n\nReturns balances for all 4 currencies (USDT, ETH, SOL, BTC) with available and locked amounts.\n\nportfolio — Full portfolio summary\n\npython3 scripts/skill.py portfolio\n\nReturns balances, open positions, current prices, and a summary with total USD value and unrealized PnL."
      },
      {
        "title": "Price Data",
        "body": "prices — Get current prices\n\npython3 scripts/skill.py prices\n\nReturns current prices for all 3 pairs.\n\nprice-history — Get historical prices\n\npython3 scripts/skill.py price-history --pair BTCUSDT --limit 50\n\nReturns array of {\"price\": \"...\", \"timestamp\": \"ISO8601\"} records, newest first."
      },
      {
        "title": "Spot Trading",
        "body": "Fee: 0.1% of trade value.\n\nbuy — Market buy\n\npython3 scripts/skill.py buy --pair ETHUSDT --quantity 0.5\n\nBuys 0.5 ETH at current market price. Cost = quantity * price + 0.1% fee.\n\nsell — Market sell\n\npython3 scripts/skill.py sell --pair ETHUSDT --quantity 0.5\n\nlimit-buy — Limit buy order\n\npython3 scripts/skill.py limit-buy --pair BTCUSDT --quantity 0.01 --price 90000\n\nOrder queues until price reaches the limit. Status: pending until filled.\n\nlimit-sell — Limit sell order\n\npython3 scripts/skill.py limit-sell --pair BTCUSDT --quantity 0.01 --price 100000\n\norders — List all spot orders\n\npython3 scripts/skill.py orders\n\ncancel-order — Cancel a pending order\n\npython3 scripts/skill.py cancel-order --id <order_uuid>"
      },
      {
        "title": "Perpetual Futures",
        "body": "Leverage range: 1x to 125x. Maintenance margin rate: 0.5%.\n\nopen-long — Open long position\n\npython3 scripts/skill.py open-long --pair BTCUSDT --leverage 10 --quantity 0.01\n\nResponse includes entry_price, margin, liquidation_price, and unrealized_pnl.\n\nopen-short — Open short position\n\npython3 scripts/skill.py open-short --pair ETHUSDT --leverage 5 --quantity 1.0\n\npositions — List open positions\n\npython3 scripts/skill.py positions\n\nReturns all open positions with live unrealized PnL.\n\nclose-position — Close a position\n\npython3 scripts/skill.py close-position --id <position_uuid>\n\nReturns the closed position with final PnL. Margin + PnL returned to available balance."
      },
      {
        "title": "AMM (Automated Market Maker)",
        "body": "Swap fee: 0.3%. Uses Uniswap V2 constant product formula (x * y = k).\n\nswap-buy — Buy base token with USDT via AMM\n\npython3 scripts/skill.py swap-buy --pair ETHUSDT --amount 100\n\nSpends 100 USDT to buy ETH from the AMM pool.\n\nswap-sell — Sell base token for USDT via AMM\n\npython3 scripts/skill.py swap-sell --pair ETHUSDT --amount 0.5\n\nSells 0.5 ETH into the AMM pool for USDT.\n\npools — List AMM pool info\n\npython3 scripts/skill.py pools\n\nReturns pool reserves, k-value, and fee rate. No auth required."
      },
      {
        "title": "Full API Reference",
        "body": "Base URL: Value of AGENT_METAVERSE_BASE_URL (default http://localhost:8000).\nAuthentication: X-API-Key: amv_xxx header for all authenticated endpoints."
      },
      {
        "title": "Agent Registration",
        "body": "POST /api/sdk/agents/register\nAuth: None\nBody: {\"name\": \"string\", \"description\": \"string\"}\nResponse: {\n  \"api_key\": \"amv_...\",\n  \"agent_id\": \"uuid\",\n  \"initial_balance\": 10000.0,\n  \"currency\": \"USDT\"\n}"
      },
      {
        "title": "Prices",
        "body": "GET /api/prices\nAuth: None\nResponse: {\"ETHUSDT\": \"2800.00\", \"SOLUSDT\": \"150.00\", \"BTCUSDT\": \"95000.00\"}\n\nGET /api/prices/{pair}/history?limit=100\nAuth: None\nResponse: [{\"price\": \"95000.00\", \"timestamp\": \"2026-02-22T10:00:00\"}]"
      },
      {
        "title": "Account",
        "body": "GET /api/account/balance\nAuth: Required\nResponse: [\n  {\"currency\": \"USDT\", \"available\": \"10000.00000000\", \"locked\": \"0.00000000\"},\n  {\"currency\": \"ETH\", \"available\": \"0.00000000\", \"locked\": \"0.00000000\"},\n  {\"currency\": \"SOL\", \"available\": \"0.00000000\", \"locked\": \"0.00000000\"},\n  {\"currency\": \"BTC\", \"available\": \"0.00000000\", \"locked\": \"0.00000000\"}\n]\n\nGET /api/account/positions\nAuth: Required\nResponse: [<position objects>]"
      },
      {
        "title": "Spot Trading",
        "body": "POST /api/spot/order\nAuth: Required\nBody: {\n  \"pair\": \"ETHUSDT\",\n  \"side\": \"buy\" | \"sell\",\n  \"order_type\": \"market\" | \"limit\",\n  \"quantity\": 1.0,\n  \"price\": null           // required for limit orders\n}\nResponse: {\n  \"id\": \"uuid\",\n  \"pair\": \"ETHUSDT\",\n  \"side\": \"buy\",\n  \"order_type\": \"market\",\n  \"price\": \"2800.00\",\n  \"quantity\": \"1.00000000\",\n  \"filled_quantity\": \"1.00000000\",\n  \"status\": \"filled\"\n}\n\nGET /api/spot/orders\nAuth: Required\nResponse: [<order objects>]\n\nDELETE /api/spot/orders/{order_id}\nAuth: Required\nResponse: {\"status\": \"cancelled\"}"
      },
      {
        "title": "Perpetual Futures",
        "body": "POST /api/futures/open\nAuth: Required\nBody: {\n  \"pair\": \"BTCUSDT\",\n  \"side\": \"long\" | \"short\",\n  \"leverage\": 10,           // 1-125\n  \"quantity\": 0.01\n}\nResponse: {\n  \"id\": \"uuid\",\n  \"pair\": \"BTCUSDT\",\n  \"side\": \"long\",\n  \"leverage\": 10,\n  \"entry_price\": \"95000.00\",\n  \"quantity\": \"0.01\",\n  \"margin\": \"95.000\",\n  \"liquidation_price\": \"86070.00\",\n  \"unrealized_pnl\": \"0\",\n  \"status\": \"open\"\n}\n\nPOST /api/futures/close/{position_id}\nAuth: Required\nResponse: {<position with status: \"closed\", final PnL>}\n\nGET /api/futures/positions\nAuth: Required\nResponse: [<position objects with live unrealized_pnl>]"
      },
      {
        "title": "AMM",
        "body": "POST /api/amm/swap\nAuth: Required\nBody: {\n  \"pair\": \"ETHUSDT\",\n  \"side\": \"buy\" | \"sell\",    // buy = USDT->base, sell = base->USDT\n  \"amount\": 100.0\n}\nResponse: {<swap result with amount_in, amount_out, fee>}\n\nGET /api/amm/pools\nAuth: None\nResponse: [\n  {\"pair\": \"ETHUSDT\", \"reserve_base\": \"100.0\", \"reserve_quote\": \"280000.0\", \"k_value\": \"28000000.0\", \"fee_rate\": \"0.003\"}\n]\n\nPOST /api/amm/mint\nAuth: Required (market_maker role only)\nBody: {\"currency\": \"ETH\", \"amount\": 100.0}\nResponse: {\"status\": \"minted\", \"currency\": \"ETH\", \"amount\": 100.0}\n\nPOST /api/amm/add-liquidity\nAuth: Required (market_maker role only)\nBody: {\"pair\": \"ETHUSDT\", \"base_amount\": 10.0, \"quote_amount\": 28000.0}\nResponse: {\"status\": \"added\", \"pair\": \"ETHUSDT\", \"reserve_base\": \"...\", \"reserve_quote\": \"...\"}"
      },
      {
        "title": "WebSocket",
        "body": "WS /ws/prices\nMessage format: {\"type\": \"price_update\", \"data\": {\"ETHUSDT\": \"2800.00\", \"SOLUSDT\": \"150.00\", \"BTCUSDT\": \"95000.00\"}}\nFrequency: Every ~2 minutes"
      },
      {
        "title": "Health Check",
        "body": "GET /health\nResponse: {\"status\": \"ok\"}"
      },
      {
        "title": "Spot Trading",
        "body": "Market orders execute immediately at current price\nLimit orders queue and fill when price matches\nFee: 0.1% of trade value, deducted from USDT\nBuy: need quantity * price * 1.001 USDT available\nSell: need the base token (ETH/SOL/BTC) in your balance"
      },
      {
        "title": "Perpetual Futures",
        "body": "Leverage: 1x to 125x\nMargin = (entry_price * quantity) / leverage — locked from your USDT\nLong PnL = (current_price - entry_price) * quantity\nShort PnL = (entry_price - current_price) * quantity\nLiquidation price (long) = entry_price * (1 - 1/leverage + 0.005)\nLiquidation price (short) = entry_price * (1 + 1/leverage - 0.005)\nMaintenance margin rate: 0.5%\nPositions are checked for liquidation on every price update (every 2 minutes)\nOn close: margin + PnL returned to available USDT balance"
      },
      {
        "title": "AMM (Uniswap V2)",
        "body": "Constant product formula: x * y = k\namount_out = (reserve_out * amount_in_after_fee) / (reserve_in + amount_in_after_fee)\nSwap fee: 0.3%\nLarger swaps relative to pool size cause more slippage\nPools must be funded by a market maker before swaps are possible"
      },
      {
        "title": "Strategy 1: Spot Dollar-Cost Averaging",
        "body": "Every price update cycle:\n  1. python3 scripts/skill.py prices\n  2. If ETHUSDT < 2500:\n       python3 scripts/skill.py buy --pair ETHUSDT --quantity 0.1\n  3. python3 scripts/skill.py balance  (confirm purchase)"
      },
      {
        "title": "Strategy 2: Momentum Futures",
        "body": "1. python3 scripts/skill.py price-history --pair BTCUSDT --limit 10\n2. Calculate trend from price history\n3. If trending up:\n     python3 scripts/skill.py open-long --pair BTCUSDT --leverage 5 --quantity 0.01\n4. If trending down:\n     python3 scripts/skill.py open-short --pair BTCUSDT --leverage 5 --quantity 0.01\n5. Monitor: python3 scripts/skill.py positions\n6. Close when target PnL reached:\n     python3 scripts/skill.py close-position --id <position_id>"
      },
      {
        "title": "Strategy 3: Heartbeat Loop",
        "body": "loop every 120 seconds:\n  1. python3 scripts/skill.py portfolio  (get everything in one call)\n  2. Evaluate: prices, balances, open positions, unrealized PnL\n  3. Decide: open/close positions, buy/sell spot\n  4. Execute trades\n  5. Sleep until next price update"
      },
      {
        "title": "Strategy 4: AMM Arbitrage",
        "body": "1. python3 scripts/skill.py prices  (get spot price)\n2. python3 scripts/skill.py pools   (get AMM reserves)\n3. Calculate AMM implied price = reserve_quote / reserve_base\n4. If spot_price < amm_price:\n     Buy spot, sell on AMM\n5. If spot_price > amm_price:\n     Buy on AMM, sell spot"
      },
      {
        "title": "Risk Management",
        "body": "Never risk more than 20% of total balance on a single trade\nStart futures with low leverage (2-5x) before increasing\nAlways check balance before placing orders\nMonitor liquidation_price on all open positions\nUse portfolio for a holistic view before making decisions\nAMM swaps on thin pools have high slippage — check pools first\nDiversify across pairs rather than concentrating on one"
      },
      {
        "title": "Error Handling",
        "body": "StatusMeaningCommon Cause400Bad RequestInsufficient balance, invalid pair, or price not available yet401UnauthorizedMissing or invalid API key403ForbiddenTrying market_maker operations without market_maker role404Not FoundInvalid order/position ID422Validation ErrorMissing or invalid request fields\n\nAll monetary values are returned as strings for decimal precision (e.g., \"2800.00000000\")."
      },
      {
        "title": "Troubleshooting",
        "body": "\"Price not available yet\"\nThe price engine needs ~2 minutes after server start for its first fetch. Wait and retry.\n\n\"Insufficient USDT\"\nFor spot buys: need quantity * price * 1.001 (includes 0.1% fee).\nFor futures: need (quantity * price) / leverage as margin.\nCheck with python3 scripts/skill.py balance.\n\n\"No liquidity available\"\nAMM pools need a market maker to add liquidity. Check python3 scripts/skill.py pools. If empty, swap is not available yet.\n\nEmpty prices {}\nServer just started and hasn't fetched from Binance yet. The system has seed fallback prices that activate within ~2 minutes.\n\nConnection refused\nEnsure the exchange is running. Start with docker-compose up or uvicorn app.main:app --port 8000 in the backend directory."
      }
    ],
    "body": "Agent Metaverse - Virtual Crypto Exchange Skill\n\nA virtual crypto trading exchange for AI agents. Trade spot, perpetual futures (1-125x leverage), and AMM swaps across 3 trading pairs. Every agent starts with 10,000 virtual USDT.\n\nSupported Trading Pairs\nPair\tBase\tQuote\tPrice Source\nETHUSDT\tETH\tUSDT\tBinance API (2-min updates)\nSOLUSDT\tSOL\tUSDT\tBinance API (2-min updates)\nBTCUSDT\tBTC\tUSDT\tBinance API (2-min updates)\nEnvironment Variables\nVariable\tRequired\tDefault\tDescription\nAGENT_METAVERSE_API_KEY\tYes\t—\tYour API key (format: amv_ + 48 hex chars). Get one via the register command.\nAGENT_METAVERSE_BASE_URL\tNo\thttp://localhost:8000\tExchange server URL\nQuick Start\n# 1. Register an agent (no API key needed)\npython3 scripts/skill.py register --name \"MyTradingBot\" --description \"A smart trader\"\n# Returns: {\"api_key\": \"amv_xxx...\", \"agent_id\": \"uuid\", \"initial_balance\": 10000, \"currency\": \"USDT\"}\n\n# 2. Set API key\nexport AGENT_METAVERSE_API_KEY=amv_xxx...\n\n# 3. Check prices\npython3 scripts/skill.py prices\n# Returns: {\"ETHUSDT\": \"2800.00\", \"SOLUSDT\": \"150.00\", \"BTCUSDT\": \"95000.00\"}\n\n# 4. Check your balance\npython3 scripts/skill.py balance\n\n# 5. Buy 1 ETH\npython3 scripts/skill.py buy --pair ETHUSDT --quantity 1.0\n\n# 6. Open a 10x long BTC position\npython3 scripts/skill.py open-long --pair BTCUSDT --leverage 10 --quantity 0.01\n\nScript Commands\n\nAll commands output JSON to stdout. Set AGENT_METAVERSE_API_KEY before using authenticated commands.\n\nRegistration & Account\nregister — Register a new agent\npython3 scripts/skill.py register --name \"BotName\" --description \"Optional description\"\n\n\nReturns API key and 10,000 USDT starting balance. Save the API key — it is shown only once.\n\nbalance — Get account balances\npython3 scripts/skill.py balance\n\n\nReturns balances for all 4 currencies (USDT, ETH, SOL, BTC) with available and locked amounts.\n\nportfolio — Full portfolio summary\npython3 scripts/skill.py portfolio\n\n\nReturns balances, open positions, current prices, and a summary with total USD value and unrealized PnL.\n\nPrice Data\nprices — Get current prices\npython3 scripts/skill.py prices\n\n\nReturns current prices for all 3 pairs.\n\nprice-history — Get historical prices\npython3 scripts/skill.py price-history --pair BTCUSDT --limit 50\n\n\nReturns array of {\"price\": \"...\", \"timestamp\": \"ISO8601\"} records, newest first.\n\nSpot Trading\n\nFee: 0.1% of trade value.\n\nbuy — Market buy\npython3 scripts/skill.py buy --pair ETHUSDT --quantity 0.5\n\n\nBuys 0.5 ETH at current market price. Cost = quantity * price + 0.1% fee.\n\nsell — Market sell\npython3 scripts/skill.py sell --pair ETHUSDT --quantity 0.5\n\nlimit-buy — Limit buy order\npython3 scripts/skill.py limit-buy --pair BTCUSDT --quantity 0.01 --price 90000\n\n\nOrder queues until price reaches the limit. Status: pending until filled.\n\nlimit-sell — Limit sell order\npython3 scripts/skill.py limit-sell --pair BTCUSDT --quantity 0.01 --price 100000\n\norders — List all spot orders\npython3 scripts/skill.py orders\n\ncancel-order — Cancel a pending order\npython3 scripts/skill.py cancel-order --id <order_uuid>\n\nPerpetual Futures\n\nLeverage range: 1x to 125x. Maintenance margin rate: 0.5%.\n\nopen-long — Open long position\npython3 scripts/skill.py open-long --pair BTCUSDT --leverage 10 --quantity 0.01\n\n\nResponse includes entry_price, margin, liquidation_price, and unrealized_pnl.\n\nopen-short — Open short position\npython3 scripts/skill.py open-short --pair ETHUSDT --leverage 5 --quantity 1.0\n\npositions — List open positions\npython3 scripts/skill.py positions\n\n\nReturns all open positions with live unrealized PnL.\n\nclose-position — Close a position\npython3 scripts/skill.py close-position --id <position_uuid>\n\n\nReturns the closed position with final PnL. Margin + PnL returned to available balance.\n\nAMM (Automated Market Maker)\n\nSwap fee: 0.3%. Uses Uniswap V2 constant product formula (x * y = k).\n\nswap-buy — Buy base token with USDT via AMM\npython3 scripts/skill.py swap-buy --pair ETHUSDT --amount 100\n\n\nSpends 100 USDT to buy ETH from the AMM pool.\n\nswap-sell — Sell base token for USDT via AMM\npython3 scripts/skill.py swap-sell --pair ETHUSDT --amount 0.5\n\n\nSells 0.5 ETH into the AMM pool for USDT.\n\npools — List AMM pool info\npython3 scripts/skill.py pools\n\n\nReturns pool reserves, k-value, and fee rate. No auth required.\n\nFull API Reference\n\nBase URL: Value of AGENT_METAVERSE_BASE_URL (default http://localhost:8000). Authentication: X-API-Key: amv_xxx header for all authenticated endpoints.\n\nAgent Registration\nPOST /api/sdk/agents/register\nAuth: None\nBody: {\"name\": \"string\", \"description\": \"string\"}\nResponse: {\n  \"api_key\": \"amv_...\",\n  \"agent_id\": \"uuid\",\n  \"initial_balance\": 10000.0,\n  \"currency\": \"USDT\"\n}\n\nPrices\nGET /api/prices\nAuth: None\nResponse: {\"ETHUSDT\": \"2800.00\", \"SOLUSDT\": \"150.00\", \"BTCUSDT\": \"95000.00\"}\n\nGET /api/prices/{pair}/history?limit=100\nAuth: None\nResponse: [{\"price\": \"95000.00\", \"timestamp\": \"2026-02-22T10:00:00\"}]\n\nAccount\nGET /api/account/balance\nAuth: Required\nResponse: [\n  {\"currency\": \"USDT\", \"available\": \"10000.00000000\", \"locked\": \"0.00000000\"},\n  {\"currency\": \"ETH\", \"available\": \"0.00000000\", \"locked\": \"0.00000000\"},\n  {\"currency\": \"SOL\", \"available\": \"0.00000000\", \"locked\": \"0.00000000\"},\n  {\"currency\": \"BTC\", \"available\": \"0.00000000\", \"locked\": \"0.00000000\"}\n]\n\nGET /api/account/positions\nAuth: Required\nResponse: [<position objects>]\n\nSpot Trading\nPOST /api/spot/order\nAuth: Required\nBody: {\n  \"pair\": \"ETHUSDT\",\n  \"side\": \"buy\" | \"sell\",\n  \"order_type\": \"market\" | \"limit\",\n  \"quantity\": 1.0,\n  \"price\": null           // required for limit orders\n}\nResponse: {\n  \"id\": \"uuid\",\n  \"pair\": \"ETHUSDT\",\n  \"side\": \"buy\",\n  \"order_type\": \"market\",\n  \"price\": \"2800.00\",\n  \"quantity\": \"1.00000000\",\n  \"filled_quantity\": \"1.00000000\",\n  \"status\": \"filled\"\n}\n\nGET /api/spot/orders\nAuth: Required\nResponse: [<order objects>]\n\nDELETE /api/spot/orders/{order_id}\nAuth: Required\nResponse: {\"status\": \"cancelled\"}\n\nPerpetual Futures\nPOST /api/futures/open\nAuth: Required\nBody: {\n  \"pair\": \"BTCUSDT\",\n  \"side\": \"long\" | \"short\",\n  \"leverage\": 10,           // 1-125\n  \"quantity\": 0.01\n}\nResponse: {\n  \"id\": \"uuid\",\n  \"pair\": \"BTCUSDT\",\n  \"side\": \"long\",\n  \"leverage\": 10,\n  \"entry_price\": \"95000.00\",\n  \"quantity\": \"0.01\",\n  \"margin\": \"95.000\",\n  \"liquidation_price\": \"86070.00\",\n  \"unrealized_pnl\": \"0\",\n  \"status\": \"open\"\n}\n\nPOST /api/futures/close/{position_id}\nAuth: Required\nResponse: {<position with status: \"closed\", final PnL>}\n\nGET /api/futures/positions\nAuth: Required\nResponse: [<position objects with live unrealized_pnl>]\n\nAMM\nPOST /api/amm/swap\nAuth: Required\nBody: {\n  \"pair\": \"ETHUSDT\",\n  \"side\": \"buy\" | \"sell\",    // buy = USDT->base, sell = base->USDT\n  \"amount\": 100.0\n}\nResponse: {<swap result with amount_in, amount_out, fee>}\n\nGET /api/amm/pools\nAuth: None\nResponse: [\n  {\"pair\": \"ETHUSDT\", \"reserve_base\": \"100.0\", \"reserve_quote\": \"280000.0\", \"k_value\": \"28000000.0\", \"fee_rate\": \"0.003\"}\n]\n\nPOST /api/amm/mint\nAuth: Required (market_maker role only)\nBody: {\"currency\": \"ETH\", \"amount\": 100.0}\nResponse: {\"status\": \"minted\", \"currency\": \"ETH\", \"amount\": 100.0}\n\nPOST /api/amm/add-liquidity\nAuth: Required (market_maker role only)\nBody: {\"pair\": \"ETHUSDT\", \"base_amount\": 10.0, \"quote_amount\": 28000.0}\nResponse: {\"status\": \"added\", \"pair\": \"ETHUSDT\", \"reserve_base\": \"...\", \"reserve_quote\": \"...\"}\n\nWebSocket\nWS /ws/prices\nMessage format: {\"type\": \"price_update\", \"data\": {\"ETHUSDT\": \"2800.00\", \"SOLUSDT\": \"150.00\", \"BTCUSDT\": \"95000.00\"}}\nFrequency: Every ~2 minutes\n\nHealth Check\nGET /health\nResponse: {\"status\": \"ok\"}\n\nTrading Concepts\nSpot Trading\nMarket orders execute immediately at current price\nLimit orders queue and fill when price matches\nFee: 0.1% of trade value, deducted from USDT\nBuy: need quantity * price * 1.001 USDT available\nSell: need the base token (ETH/SOL/BTC) in your balance\nPerpetual Futures\nLeverage: 1x to 125x\nMargin = (entry_price * quantity) / leverage — locked from your USDT\nLong PnL = (current_price - entry_price) * quantity\nShort PnL = (entry_price - current_price) * quantity\nLiquidation price (long) = entry_price * (1 - 1/leverage + 0.005)\nLiquidation price (short) = entry_price * (1 + 1/leverage - 0.005)\nMaintenance margin rate: 0.5%\nPositions are checked for liquidation on every price update (every 2 minutes)\nOn close: margin + PnL returned to available USDT balance\nAMM (Uniswap V2)\nConstant product formula: x * y = k\namount_out = (reserve_out * amount_in_after_fee) / (reserve_in + amount_in_after_fee)\nSwap fee: 0.3%\nLarger swaps relative to pool size cause more slippage\nPools must be funded by a market maker before swaps are possible\nTrading Strategy Examples\nStrategy 1: Spot Dollar-Cost Averaging\nEvery price update cycle:\n  1. python3 scripts/skill.py prices\n  2. If ETHUSDT < 2500:\n       python3 scripts/skill.py buy --pair ETHUSDT --quantity 0.1\n  3. python3 scripts/skill.py balance  (confirm purchase)\n\nStrategy 2: Momentum Futures\n1. python3 scripts/skill.py price-history --pair BTCUSDT --limit 10\n2. Calculate trend from price history\n3. If trending up:\n     python3 scripts/skill.py open-long --pair BTCUSDT --leverage 5 --quantity 0.01\n4. If trending down:\n     python3 scripts/skill.py open-short --pair BTCUSDT --leverage 5 --quantity 0.01\n5. Monitor: python3 scripts/skill.py positions\n6. Close when target PnL reached:\n     python3 scripts/skill.py close-position --id <position_id>\n\nStrategy 3: Heartbeat Loop\nloop every 120 seconds:\n  1. python3 scripts/skill.py portfolio  (get everything in one call)\n  2. Evaluate: prices, balances, open positions, unrealized PnL\n  3. Decide: open/close positions, buy/sell spot\n  4. Execute trades\n  5. Sleep until next price update\n\nStrategy 4: AMM Arbitrage\n1. python3 scripts/skill.py prices  (get spot price)\n2. python3 scripts/skill.py pools   (get AMM reserves)\n3. Calculate AMM implied price = reserve_quote / reserve_base\n4. If spot_price < amm_price:\n     Buy spot, sell on AMM\n5. If spot_price > amm_price:\n     Buy on AMM, sell spot\n\nRisk Management\nNever risk more than 20% of total balance on a single trade\nStart futures with low leverage (2-5x) before increasing\nAlways check balance before placing orders\nMonitor liquidation_price on all open positions\nUse portfolio for a holistic view before making decisions\nAMM swaps on thin pools have high slippage — check pools first\nDiversify across pairs rather than concentrating on one\nError Handling\nStatus\tMeaning\tCommon Cause\n400\tBad Request\tInsufficient balance, invalid pair, or price not available yet\n401\tUnauthorized\tMissing or invalid API key\n403\tForbidden\tTrying market_maker operations without market_maker role\n404\tNot Found\tInvalid order/position ID\n422\tValidation Error\tMissing or invalid request fields\n\nAll monetary values are returned as strings for decimal precision (e.g., \"2800.00000000\").\n\nTroubleshooting\n\n\"Price not available yet\" The price engine needs ~2 minutes after server start for its first fetch. Wait and retry.\n\n\"Insufficient USDT\" For spot buys: need quantity * price * 1.001 (includes 0.1% fee). For futures: need (quantity * price) / leverage as margin. Check with python3 scripts/skill.py balance.\n\n\"No liquidity available\" AMM pools need a market maker to add liquidity. Check python3 scripts/skill.py pools. If empty, swap is not available yet.\n\nEmpty prices {} Server just started and hasn't fetched from Binance yet. The system has seed fallback prices that activate within ~2 minutes.\n\nConnection refused Ensure the exchange is running. Start with docker-compose up or uvicorn app.main:app --port 8000 in the backend directory."
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/Ed1sonL1-byte/agent-metaverse",
    "publisherUrl": "https://clawhub.ai/Ed1sonL1-byte/agent-metaverse",
    "owner": "Ed1sonL1-byte",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/agent-metaverse",
    "downloadUrl": "https://openagent3.xyz/downloads/agent-metaverse",
    "agentUrl": "https://openagent3.xyz/skills/agent-metaverse/agent",
    "manifestUrl": "https://openagent3.xyz/skills/agent-metaverse/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/agent-metaverse/agent.md"
  }
}