{
  "$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
  "title": "Clean Perps testnet market",
  "description": "Converge one Perps testnet market to an unlocked wallet with no matching open position or order.",
  "paramsSchema": {
    "type": "object",
    "additionalProperties": false,
    "required": [
      "market"
    ],
    "properties": {
      "market": {
        "type": "string",
        "default": "ETH",
        "description": "Perps market symbol to clean."
      }
    }
  },
  "workflow": {
    "entry": "ensure-wallet",
    "nodes": {
      "ensure-wallet": {
        "action": "metamask.wallet.ensure_unlocked",
        "intent": "Ensure the wallet is unlocked before cleaning the Perps market",
        "next": "clean-market"
      },
      "clean-market": {
        "action": "metamask.perps.start_state",
        "intent": "Converge Perps to a clean testnet market",
        "profile": "clean_market_testnet",
        "network": "testnet",
        "market": "{{params.market}}",
        "positions": {
          "state": "none",
          "mode": "matching"
        },
        "orders": {
          "state": "none",
          "mode": "matching"
        },
        "next": "done"
      },
      "done": {
        "action": "end",
        "status": "pass"
      }
    }
  }
}
