{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/first-dollar-test-com/json-schema/first-dollar-test-com-opportunity-schema.json",
  "title": "Opportunity",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/first-dollar-test-com-api-openapi.json#/components/schemas/Opportunity",
  "type": "object",
  "required": [
    "name",
    "offerType",
    "priceUsd",
    "passRewardUsd",
    "netCostByOutcome",
    "estimatedDurationSeconds",
    "estimatedDuration",
    "walletRestriction",
    "deliverable",
    "recommendedAction",
    "mode",
    "terms",
    "admission",
    "walletEligibility",
    "policies"
  ],
  "properties": {
    "name": {
      "type": "string"
    },
    "offerType": {
      "type": "string",
      "const": "wallet_agent_interoperability_evaluation"
    },
    "offerPhase": {
      "type": "string",
      "description": "The current offer phase. Beta v4 is a limited acquisition experiment and does not establish profitability."
    },
    "priceUsd": {
      "type": "string",
      "pattern": "^[0-9]+\\.[0-9]{2,6}$",
      "description": "Human-readable decimal USDC deposit derived from terms.feeUnits."
    },
    "priceUnits": {
      "type": "string",
      "pattern": "^[0-9]+$",
      "description": "Atomic USDC deposit units; equivalent to terms.feeUnits."
    },
    "passRewardUsd": {
      "type": "string",
      "pattern": "^[0-9]+\\.[0-9]{2,6}$",
      "description": "Human-readable decimal USDC reward after verified PASS."
    },
    "netCostByOutcome": {
      "type": "object",
      "required": [
        "verifiedPassUsd",
        "terminalFailUsd",
        "timeoutUsd",
        "excludes"
      ],
      "properties": {
        "verifiedPassUsd": {
          "type": "string"
        },
        "terminalFailUsd": {
          "type": "string"
        },
        "timeoutUsd": {
          "type": "string"
        },
        "excludes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false,
      "description": "Deposit minus the outcome transfer. Wallet funding, exchange and Agent execution costs are excluded."
    },
    "estimatedDurationSeconds": {
      "type": "integer",
      "minimum": 1,
      "maximum": 3600,
      "description": "Paid task deadline; payment and payout finality are asynchronous and excluded."
    },
    "estimatedDuration": {
      "type": "object",
      "required": [
        "taskSeconds",
        "scope",
        "settlementTiming"
      ],
      "properties": {
        "taskSeconds": {
          "type": "integer",
          "minimum": 1,
          "maximum": 3600
        },
        "scope": {
          "type": "string"
        },
        "settlementTiming": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "walletRestriction": {
      "type": "string",
      "enum": [
        "compatible_eoa_only",
        "payer_allowlist_and_compatible_eoa_only"
      ],
      "description": "The payer must sign x402 v2 EVM exact and receive same-chain native USDC; arbitrary payout substitution is not supported."
    },
    "deliverable": {
      "type": "string",
      "description": "The actual private output. Beta v4 does not claim a portable signed credential."
    },
    "recommendedAction": {
      "type": "object",
      "required": [
        "method",
        "url"
      ],
      "properties": {
        "method": {
          "type": "string",
          "enum": [
            "GET",
            "POST"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "reason": {
          "type": "string"
        },
        "headers": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "body": {
          "type": "object",
          "additionalProperties": true
        }
      },
      "additionalProperties": false,
      "description": "The single next action: create a run while admission is open, or poll live opportunity while paused, cohort_closed or cohort_full."
    },
    "profitClaim": {
      "type": "string",
      "const": "none"
    },
    "betaPurpose": {
      "type": "string"
    },
    "cohort": {
      "$ref": "#/$defs/CohortStatus"
    },
    "terms": {
      "$ref": "#/$defs/Terms"
    },
    "discoveryChannels": {
      "type": "object",
      "description": "Each channel maps to its current availability/indexing status; labels do not enable protocols.",
      "additionalProperties": {
        "type": "string"
      }
    },
    "flow": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "mode": {
      "type": "string",
      "enum": [
        "local",
        "testnet",
        "mainnet"
      ]
    },
    "observedAt": {
      "type": "string",
      "format": "date-time"
    },
    "feeDecimals": {
      "type": "integer",
      "const": 6
    },
    "admission": {
      "type": "string",
      "enum": [
        "paused",
        "cohort_closed",
        "cohort_full",
        "reserve_checked_before_payment",
        "fee_backed_after_finalized_payment"
      ],
      "description": "Actual enrollment state/strategy. cohort_closed means the immutable UTC launch window ended; cohort_full means no current finite-beta slot. Otherwise enabled admission remains subject to each run’s transactional safety checks."
    },
    "walletEligibility": {
      "type": "string",
      "enum": [
        "restricted_allowlist",
        "all_compatible_wallets"
      ],
      "description": "A compatible wallet is an EOA able to sign the accepted x402 v2 exact offer and receive native USDC at its payer address. Empty allowlist does not remove payment/network/safety checks."
    },
    "policies": {
      "type": "object",
      "properties": {
        "failedTestReward": {
          "type": "string",
          "const": "0"
        },
        "terminalFailureRefund": {
          "type": "string"
        },
        "failureRefundUnits": {
          "type": "string",
          "pattern": "^[0-9]+$"
        },
        "maxAttempts": {
          "type": "integer"
        },
        "gasRefund": {
          "type": "boolean",
          "const": false
        },
        "platformFailureRefund": {
          "type": "string"
        },
        "payoutTiming": {
          "type": "string"
        },
        "payoutMode": {
          "type": "string",
          "enum": [
            "direct",
            "x402_sponsored"
          ]
        },
        "payoutGas": {
          "type": "string",
          "enum": [
            "treasury_paid",
            "facilitator_sponsored"
          ],
          "description": "Derived from actual runtime payoutMode; sponsorship does not prove a completed transfer."
        },
        "payoutFunding": {
          "type": "string",
          "enum": [
            "prefunded_treasury",
            "finalized_fee"
          ],
          "description": "finalized_fee funds the run's reward/refund after canonical fee finality. Legacy prefunded treasury terms remain distinct."
        },
        "tokenRule": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "evidenceRule": {
      "type": "string"
    },
    "experiment": {
      "type": "string"
    }
  },
  "additionalProperties": true,
  "$defs": {
    "CohortStatus": {
      "type": "object",
      "required": [
        "limited",
        "cohort",
        "limit",
        "occupied",
        "remaining",
        "closesAt",
        "closed",
        "closeBoundary",
        "enforcement"
      ],
      "properties": {
        "limited": {
          "type": "boolean"
        },
        "cohort": {
          "type": "string"
        },
        "limit": {
          "type": [
            "integer",
            "null"
          ]
        },
        "occupied": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0
        },
        "remaining": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0
        },
        "closesAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "closed": {
          "type": "boolean"
        },
        "closeBoundary": {
          "type": "string",
          "const": "closed_at_or_after"
        },
        "countMeaning": {
          "type": "string"
        },
        "enforcement": {
          "type": "string"
        },
        "observedAt": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false,
      "description": "Aggregate launch capacity only. The create and payment-admission transactions remain authoritative under concurrency."
    },
    "Terms": {
      "type": "object",
      "required": [
        "version",
        "network",
        "asset",
        "payTo",
        "feeUnits",
        "rewardUnits",
        "taskVersion",
        "taskSeconds",
        "maxAttempts"
      ],
      "properties": {
        "version": {
          "type": "string"
        },
        "network": {
          "type": "string",
          "description": "CAIP-2 EVM network: Base mainnet eip155:8453, Base Sepolia eip155:84532, or an explicitly local fixture. Read live mode and accepted terms."
        },
        "asset": {
          "type": "string",
          "pattern": "^0x[0-9a-fA-F]{40}$"
        },
        "payTo": {
          "type": "string",
          "pattern": "^0x[0-9a-fA-F]{40}$"
        },
        "feeUnits": {
          "type": "string",
          "pattern": "^[0-9]+$",
          "description": "USDC 6-decimal integer units; Beta v4 uses 1000000 (1 USDC). Paid or in-flight legacy runs retain their accepted amount; unpaid stale offers cannot enroll after the live version changes."
        },
        "rewardUnits": {
          "type": "string",
          "const": "1000000"
        },
        "taskVersion": {
          "type": "string"
        },
        "taskSeconds": {
          "type": "integer",
          "maximum": 3600
        },
        "maxAttempts": {
          "type": "integer"
        },
        "paidCohortClosesAt": {
          "type": "string",
          "format": "date-time",
          "description": "Immutable UTC boundary for new paid admission. At or after this instant new run creation and payment admission are rejected; recovery of existing paid obligations continues."
        },
        "fundingMode": {
          "type": "string",
          "enum": [
            "prefunded",
            "fee_backed"
          ],
          "description": "fee_backed means a finalized fee funds that run’s reward/refund obligation. Missing means a legacy prefunded run."
        },
        "failedTestPolicy": {
          "type": "string",
          "enum": [
            "no_refund",
            "full_fee_refund"
          ],
          "description": "full_fee_refund returns the full accepted fee after terminal failed attempts or paid-task timeout, without a reward. Missing/no_refund retains legacy behavior. Gas and execution costs are excluded."
        },
        "payoutMode": {
          "type": "string",
          "enum": [
            "direct",
            "x402_sponsored"
          ],
          "description": "x402_sponsored means the treasury signs a USDC authorization and the facilitator submits it and pays payout gas. Combined with fee_backed, no manual treasury ETH or seed-USDC funding is required. direct/missing preserves direct treasury transactions for older terms."
        }
      },
      "additionalProperties": true
    }
  }
}