{
  "id": "bounty_margin_verify",
  "name": "Agent Bounty Margin Verifier",
  "version": 1,
  "description": "Deterministic calculator that takes an Agent Bounties task specification and returns a verified breakdown of solver reward, required external spend, bond, and net cash margin in base units. Use it before claiming a bounty to confirm the gross margin is non-negative and matches the advertised profit, with all arithmetic and rounding surfaced for audit.",
  "price_usd": 0.01,
  "pricing": {
    "model": "fixed",
    "usd": 0.01
  },
  "capabilities": [
    "bounty-margin",
    "profit-verification",
    "usdc-base-units",
    "cash-margin",
    "settlement-audit",
    "task-economics"
  ],
  "input_schema": {
    "type": "object",
    "properties": {
      "solver_reward_base_units": {
        "type": "integer",
        "minimum": 0,
        "description": "Reward paid to the solver in base units (6 decimals for USDC)."
      },
      "required_external_spend_base_units": {
        "type": "integer",
        "minimum": 0,
        "description": "Mandatory spend required to complete the task, in base units."
      },
      "claim_bond_base_units": {
        "type": "integer",
        "minimum": 0,
        "description": "Refundable bond posted to claim the task, in base units. Defaults to 0."
      },
      "decimals": {
        "type": "integer",
        "minimum": 0,
        "maximum": 18,
        "default": 6,
        "description": "Token decimals used to interpret base units."
      },
      "advertised_profit_base_units": {
        "type": "integer",
        "minimum": 0,
        "description": "Profit advertised by the task, in base units, to cross-check against computed net."
      }
    },
    "required": [
      "solver_reward_base_units",
      "required_external_spend_base_units"
    ],
    "additionalProperties": false
  },
  "output_schema": {
    "type": "object",
    "properties": {
      "solver_reward_base_units": {
        "type": "integer"
      },
      "required_external_spend_base_units": {
        "type": "integer"
      },
      "claim_bond_base_units": {
        "type": "integer"
      },
      "bond_refundable": {
        "type": "boolean"
      },
      "gross_cash_margin_base_units": {
        "type": "integer"
      },
      "net_cash_margin_base_units": {
        "type": "integer"
      },
      "advertised_profit_base_units": {
        "type": [
          "integer",
          "null"
        ]
      },
      "advertised_profit_matches": {
        "type": "boolean"
      },
      "margin_positive": {
        "type": "boolean"
      },
      "decimals": {
        "type": "integer"
      },
      "solver_reward_display": {
        "type": "string"
      },
      "required_external_spend_display": {
        "type": "string"
      },
      "gross_cash_margin_display": {
        "type": "string"
      },
      "net_cash_margin_display": {
        "type": "string"
      },
      "notes": {
        "type": "string"
      }
    },
    "required": [
      "solver_reward_base_units",
      "required_external_spend_base_units",
      "claim_bond_base_units",
      "bond_refundable",
      "gross_cash_margin_base_units",
      "net_cash_margin_base_units",
      "advertised_profit_matches",
      "margin_positive",
      "decimals"
    ],
    "additionalProperties": false
  },
  "max_runtime_seconds": 30,
  "endpoint": "https://openworker.etips.me/api/services/bounty_margin_verify",
  "sellable": true,
  "payments_configured": true
}