{
  "format": "delx/intent-card/v1",
  "id": "roi-on-margin-api",
  "intent": "ROI on Margin for an agent workflow",
  "title": "ROI on Margin API for agents",
  "description": "Return on margin for a realized or mark PnL. Call when comparing leveraged trades by capital efficiency. Returns roi on posted margin as deterministic JSON for $0.001 USDC via x402 on Base. First-party local math only—no RPC, live market feed, API keys, storage, or mediagen. Advisory only; the caller owns capital, risk, and production controls.",
  "keywords": [
    "ROI on Margin API",
    "ROI on Margin for agents",
    "pay per result API",
    "x402 API",
    "no API key"
  ],
  "updated_at": "2026-08-23",
  "canonical_url": "https://commerce.delx.ai/intents/roi-on-margin-api",
  "machine_url": "https://commerce.delx.ai/intents/roi-on-margin-api.json",
  "recommendation": {
    "tool_name": "util_roi_on_margin",
    "service_name": "ROI on Margin",
    "method": "POST",
    "resource": "https://api.delx.ai/api/v1/x402/roi-on-margin",
    "price_usdc": "0.001",
    "payment_protocols": [
      "x402",
      "mpp"
    ],
    "input_schema": {
      "type": "object",
      "properties": {
        "pnl": {
          "description": "Input field: pnl.",
          "type": "integer"
        },
        "margin": {
          "description": "Input field: margin.",
          "type": "integer"
        }
      },
      "required": [
        "pnl",
        "margin"
      ],
      "additionalProperties": true
    },
    "example_input": {
      "pnl": 50,
      "margin": 500
    },
    "example_output": {
      "schema": "delx/util-roi-on-margin/v1",
      "pnl": 50,
      "margin": 500,
      "roi": 0.1,
      "roi_pct": 10
    },
    "agentcash": {
      "buy": "npx agentcash@latest fetch https://api.delx.ai/api/v1/x402/roi-on-margin -m POST -H 'x-delx-source: intent-card-roi-on-margin-api' --max-amount 0.001 -b '{\"pnl\":50,\"margin\":500}'",
      "max_amount_usdc": "0.001"
    }
  },
  "attribution": {
    "header": "x-delx-source",
    "value": "intent-card-roi-on-margin-api"
  },
  "evidence": {
    "paid_openapi": "https://api.delx.ai/openapi.x402.json",
    "governed_portfolio": "https://api.delx.ai/x402-portfolio.json",
    "live_contract": "https://api.delx.ai/api/v1/x402/roi-on-margin"
  }
}
