{
  "commands": [
    {
      "type": "config.apply_document",
      "document": {
        "schema": "orishare.config/v2",
        "resources": [
          {
            "kind": "currency",
            "key": "xp",
            "definition": {
              "version": 1,
              "code": "xp",
              "name": "XP",
              "precision": 0,
              "expiration_policy": {
                "type": "never"
              },
              "negative_balance": "forbid",
              "capabilities": {
                "spendable": false,
                "transferable": false,
                "qualification": "xp",
                "expiry_policy": {
                  "type": "none"
                }
              }
            }
          },
          {
            "kind": "currency",
            "key": "coins",
            "definition": {
              "version": 1,
              "code": "coins",
              "name": "Coins",
              "precision": 0,
              "expiration_policy": {
                "type": "never"
              },
              "negative_balance": "forbid",
              "capabilities": {
                "spendable": true,
                "transferable": false,
                "qualification": "none",
                "expiry_policy": {
                  "type": "none"
                }
              }
            }
          },
          {
            "kind": "event_definition",
            "key": "match.completed",
            "definition": {
              "description": "A finished match. score: the final score; won: whether the player won (true or false). Sent by your game server through POST /v1/match_results (players[].won) or as an event.",
              "client_allowed": true,
              "confirmed_schema": {
                "score": "number",
                "won": "boolean"
              },
              "schema_enforcement": "warn",
              "minimum_trust": "customer_claim",
              "fact_policy": null,
              "time_policy": null
            }
          },
          {
            "kind": "event_definition",
            "key": "level.completed",
            "definition": {
              "description": "A finished level. level: the level number.",
              "client_allowed": true,
              "confirmed_schema": {
                "level": "number"
              },
              "schema_enforcement": "warn",
              "minimum_trust": "customer_claim",
              "fact_policy": null,
              "time_policy": null
            }
          },
          {
            "kind": "event_definition",
            "key": "session.started",
            "definition": {
              "description": "The player opened the game (one per play session).",
              "client_allowed": true,
              "confirmed_schema": null,
              "schema_enforcement": "off",
              "minimum_trust": "customer_claim",
              "fact_policy": null,
              "time_policy": null
            }
          },
          {
            "kind": "event_definition",
            "key": "referral.qualified",
            "definition": {
              "description": "Sent by your backend when an invited player has really played (for example reached level 3). Server only.",
              "client_allowed": false,
              "confirmed_schema": {
                "player_id": "string",
                "amount_minor": "string",
                "currency": "string"
              },
              "schema_enforcement": "warn",
              "minimum_trust": "merchant_asserted",
              "fact_policy": {
                "object_type": "player",
                "key": ["player_id"],
                "owner": "merchant"
              },
              "time_policy": null
            }
          }
        ],
        "programs": [],
        "seasons": [],
        "rules": [
          {
            "key": "xp_per_match",
            "name": "XP for every match",
            "campaign": null,
            "priority": 0,
            "status": "published",
            "head": {
              "version": 1,
              "digest": "46c20b3082a73f7c56ffea27c101f4f89717af2d682e4645bc5835490e358507"
            },
            "draft": null,
            "draft_bindings": [],
            "versions": [
              {
                "version": 1,
                "digest": "46c20b3082a73f7c56ffea27c101f4f89717af2d682e4645bc5835490e358507",
                "definition": {
                  "schema": "orishare.rule/v2",
                  "trigger": {
                    "kind": "customer_event",
                    "event": "match.completed"
                  },
                  "trust": {
                    "minimum": "customer_claim"
                  },
                  "actions": [
                    {
                      "type": "points.award",
                      "currency": "xp",
                      "amount": 20,
                      "reason": "Match played"
                    }
                  ]
                },
                "bindings": []
              }
            ]
          },
          {
            "key": "xp_per_win",
            "name": "Bonus XP for a win",
            "campaign": null,
            "priority": 0,
            "status": "published",
            "head": {
              "version": 1,
              "digest": "2308d15708ee8354b16a05e1c60f2685e017cd69b2f8a9636fc958e71031888e"
            },
            "draft": null,
            "draft_bindings": [],
            "versions": [
              {
                "version": 1,
                "digest": "2308d15708ee8354b16a05e1c60f2685e017cd69b2f8a9636fc958e71031888e",
                "definition": {
                  "schema": "orishare.rule/v2",
                  "trigger": {
                    "kind": "customer_event",
                    "event": "match.completed"
                  },
                  "conditions": {
                    "path": "event.properties.won",
                    "op": "eq",
                    "value": true
                  },
                  "trust": {
                    "minimum": "customer_claim"
                  },
                  "actions": [
                    {
                      "type": "points.award",
                      "currency": "xp",
                      "amount": 30,
                      "reason": "Match won"
                    }
                  ]
                },
                "bindings": []
              }
            ]
          },
          {
            "key": "coins_per_win",
            "name": "Coins for a win (backend)",
            "campaign": null,
            "priority": 0,
            "status": "published",
            "head": {
              "version": 1,
              "digest": "87e2e40bb0b1901aec5e1c8ca8930f2cccf725909ecd23c7925fe22cd36834ec"
            },
            "draft": null,
            "draft_bindings": [],
            "versions": [
              {
                "version": 1,
                "digest": "87e2e40bb0b1901aec5e1c8ca8930f2cccf725909ecd23c7925fe22cd36834ec",
                "definition": {
                  "schema": "orishare.rule/v2",
                  "trigger": {
                    "kind": "customer_event",
                    "event": "match.completed"
                  },
                  "conditions": {
                    "path": "event.properties.won",
                    "op": "eq",
                    "value": true
                  },
                  "trust": {
                    "minimum": "merchant_asserted"
                  },
                  "actions": [
                    {
                      "type": "points.award",
                      "currency": "coins",
                      "amount": 10,
                      "reason": "Match won"
                    }
                  ]
                },
                "bindings": []
              }
            ]
          },
          {
            "key": "coins_per_win_app",
            "name": "Coins for a win (player app, daily limit)",
            "campaign": null,
            "priority": 0,
            "status": "published",
            "head": {
              "version": 1,
              "digest": "499f20913571f0b01cda23961d6bb8af9b1c601d57e1429a4f171378e8e568a0"
            },
            "draft": null,
            "draft_bindings": [],
            "versions": [
              {
                "version": 1,
                "digest": "499f20913571f0b01cda23961d6bb8af9b1c601d57e1429a4f171378e8e568a0",
                "definition": {
                  "schema": "orishare.rule/v2",
                  "trigger": {
                    "kind": "customer_event",
                    "event": "match.completed"
                  },
                  "conditions": {
                    "all": [
                      {
                        "path": "event.properties.won",
                        "op": "eq",
                        "value": true
                      },
                      {
                        "path": "source.trust",
                        "op": "eq",
                        "value": "customer_claim"
                      }
                    ]
                  },
                  "limits": [
                    {
                      "id": "app_wins_per_day",
                      "scope": ["customer"],
                      "window": "day",
                      "max": 20
                    }
                  ],
                  "trust": {
                    "minimum": "customer_claim"
                  },
                  "actions": [
                    {
                      "type": "points.award",
                      "currency": "coins",
                      "amount": 10,
                      "reason": "Match won"
                    }
                  ]
                },
                "bindings": []
              }
            ]
          },
          {
            "key": "xp_per_level",
            "name": "XP for a completed level",
            "campaign": null,
            "priority": 0,
            "status": "published",
            "head": {
              "version": 1,
              "digest": "2f881b89fe1fe88daa845eed8569c89ce4875eaa67e588fa70365ca5f782e8c6"
            },
            "draft": null,
            "draft_bindings": [],
            "versions": [
              {
                "version": 1,
                "digest": "2f881b89fe1fe88daa845eed8569c89ce4875eaa67e588fa70365ca5f782e8c6",
                "definition": {
                  "schema": "orishare.rule/v2",
                  "trigger": {
                    "kind": "customer_event",
                    "event": "level.completed"
                  },
                  "trust": {
                    "minimum": "customer_claim"
                  },
                  "actions": [
                    {
                      "type": "points.award",
                      "currency": "xp",
                      "amount": 50,
                      "reason": "Level completed"
                    }
                  ]
                },
                "bindings": []
              }
            ]
          },
          {
            "key": "daily_play_session",
            "name": "A session counts toward the daily streak",
            "campaign": null,
            "priority": 0,
            "status": "published",
            "head": {
              "version": 1,
              "digest": "761005b5f13c34eed4b1e6135fa6faf42ec103bdb313bc536096974f56d2c35f"
            },
            "draft": null,
            "draft_bindings": [],
            "versions": [
              {
                "version": 1,
                "digest": "761005b5f13c34eed4b1e6135fa6faf42ec103bdb313bc536096974f56d2c35f",
                "definition": {
                  "schema": "orishare.rule/v2",
                  "trigger": {
                    "kind": "customer_event",
                    "event": "session.started"
                  },
                  "trust": {
                    "minimum": "customer_claim"
                  },
                  "actions": [
                    {
                      "type": "streak.contribute",
                      "streak": "daily_play",
                      "value": 1
                    }
                  ]
                },
                "bindings": []
              }
            ]
          },
          {
            "key": "wins_badge",
            "name": "A win counts toward the wins badge",
            "campaign": null,
            "priority": 0,
            "status": "published",
            "head": {
              "version": 1,
              "digest": "e083fec0e519235a05384c0d4304365c8e707187368acff9be05ba5f066d125a"
            },
            "draft": null,
            "draft_bindings": [],
            "versions": [
              {
                "version": 1,
                "digest": "e083fec0e519235a05384c0d4304365c8e707187368acff9be05ba5f066d125a",
                "definition": {
                  "schema": "orishare.rule/v2",
                  "trigger": {
                    "kind": "customer_event",
                    "event": "match.completed"
                  },
                  "conditions": {
                    "path": "event.properties.won",
                    "op": "eq",
                    "value": true
                  },
                  "trust": {
                    "minimum": "customer_claim"
                  },
                  "actions": [
                    {
                      "type": "badge.contribute",
                      "badge": "wins",
                      "value": 1
                    }
                  ]
                },
                "bindings": []
              }
            ]
          },
          {
            "key": "warm_up_play",
            "name": "Warm up: play matches",
            "campaign": null,
            "priority": 0,
            "status": "published",
            "head": {
              "version": 1,
              "digest": "2c13b9a5b6a0ebfecb65fac07d62ad28929f74465606fedd7a73fef154b3b290"
            },
            "draft": null,
            "draft_bindings": [],
            "versions": [
              {
                "version": 1,
                "digest": "2c13b9a5b6a0ebfecb65fac07d62ad28929f74465606fedd7a73fef154b3b290",
                "definition": {
                  "schema": "orishare.rule/v2",
                  "trigger": {
                    "kind": "customer_event",
                    "event": "match.completed"
                  },
                  "trust": {
                    "minimum": "customer_claim"
                  },
                  "actions": [
                    {
                      "type": "quest.contribute",
                      "quest": "warm_up",
                      "step": "play_matches",
                      "value": 1
                    }
                  ]
                },
                "bindings": []
              }
            ]
          },
          {
            "key": "warm_up_win",
            "name": "Warm up: win a match",
            "campaign": null,
            "priority": 0,
            "status": "published",
            "head": {
              "version": 1,
              "digest": "323e1bcc6c689f4c2dc0542506cff6ad67c95e731e2d8cbc8ac352601c67748e"
            },
            "draft": null,
            "draft_bindings": [],
            "versions": [
              {
                "version": 1,
                "digest": "323e1bcc6c689f4c2dc0542506cff6ad67c95e731e2d8cbc8ac352601c67748e",
                "definition": {
                  "schema": "orishare.rule/v2",
                  "trigger": {
                    "kind": "customer_event",
                    "event": "match.completed"
                  },
                  "conditions": {
                    "path": "event.properties.won",
                    "op": "eq",
                    "value": true
                  },
                  "trust": {
                    "minimum": "customer_claim"
                  },
                  "actions": [
                    {
                      "type": "quest.contribute",
                      "quest": "warm_up",
                      "step": "win_match",
                      "value": 1
                    }
                  ]
                },
                "bindings": []
              }
            ]
          },
          {
            "key": "warm_up_level",
            "name": "Warm up: complete a level",
            "campaign": null,
            "priority": 0,
            "status": "published",
            "head": {
              "version": 1,
              "digest": "5e1002fb89ea9ad6707f3ac00d539b660e4009f597a0a202f49d9cb91664a812"
            },
            "draft": null,
            "draft_bindings": [],
            "versions": [
              {
                "version": 1,
                "digest": "5e1002fb89ea9ad6707f3ac00d539b660e4009f597a0a202f49d9cb91664a812",
                "definition": {
                  "schema": "orishare.rule/v2",
                  "trigger": {
                    "kind": "customer_event",
                    "event": "level.completed"
                  },
                  "trust": {
                    "minimum": "customer_claim"
                  },
                  "actions": [
                    {
                      "type": "quest.contribute",
                      "quest": "warm_up",
                      "step": "complete_level",
                      "value": 1
                    }
                  ]
                },
                "bindings": []
              }
            ]
          }
        ],
        "catalogues": [],
        "offers": [],
        "inventories": [],
        "code_pools": [],
        "assets": [],
        "presentation": null,
        "trust_policy": {
          "monetary_currencies": ["coins"],
          "caps": [
            {
              "trust": "customer_claim",
              "currency": "xp",
              "scope": "customer",
              "window": "day",
              "maximum_minor": 1000
            },
            {
              "trust": "customer_claim",
              "currency": "coins",
              "scope": "customer",
              "window": "day",
              "maximum_minor": 400
            }
          ]
        },
        "context": null
      }
    },
    {
      "type": "program.create",
      "kind": "tier",
      "key": "player_level",
      "name": "Player level"
    },
    {
      "type": "program.publish_definition",
      "key": "player_level",
      "definition": {
        "schema": "orishare.program/v2",
        "kind": "tier",
        "semantics": "native_v2",
        "definition": {
          "kind": "tier",
          "currency": "xp",
          "basis": {
            "type": "lifetime_earned"
          },
          "downgrade_check": "never",
          "levels": [
            {
              "key": "level_1",
              "threshold": "0",
              "display": {
                "title": "Level 1"
              }
            },
            {
              "key": "level_2",
              "threshold": "100",
              "display": {
                "title": "Level 2"
              }
            },
            {
              "key": "level_3",
              "threshold": "220",
              "display": {
                "title": "Level 3"
              }
            },
            {
              "key": "level_4",
              "threshold": "360",
              "display": {
                "title": "Level 4"
              }
            },
            {
              "key": "level_5",
              "threshold": "520",
              "display": {
                "title": "Level 5"
              }
            },
            {
              "key": "level_6",
              "threshold": "700",
              "display": {
                "title": "Level 6"
              }
            },
            {
              "key": "level_7",
              "threshold": "900",
              "display": {
                "title": "Level 7"
              }
            },
            {
              "key": "level_8",
              "threshold": "1120",
              "display": {
                "title": "Level 8"
              }
            },
            {
              "key": "level_9",
              "threshold": "1360",
              "display": {
                "title": "Level 9"
              }
            },
            {
              "key": "level_10",
              "threshold": "1620",
              "display": {
                "title": "Level 10"
              }
            },
            {
              "key": "level_11",
              "threshold": "1900",
              "display": {
                "title": "Level 11"
              }
            },
            {
              "key": "level_12",
              "threshold": "2200",
              "display": {
                "title": "Level 12"
              }
            },
            {
              "key": "level_13",
              "threshold": "2520",
              "display": {
                "title": "Level 13"
              }
            },
            {
              "key": "level_14",
              "threshold": "2860",
              "display": {
                "title": "Level 14"
              }
            },
            {
              "key": "level_15",
              "threshold": "3220",
              "display": {
                "title": "Level 15"
              }
            },
            {
              "key": "level_16",
              "threshold": "3600",
              "display": {
                "title": "Level 16"
              }
            },
            {
              "key": "level_17",
              "threshold": "4000",
              "display": {
                "title": "Level 17"
              }
            },
            {
              "key": "level_18",
              "threshold": "4420",
              "display": {
                "title": "Level 18"
              }
            },
            {
              "key": "level_19",
              "threshold": "4860",
              "display": {
                "title": "Level 19"
              }
            },
            {
              "key": "level_20",
              "threshold": "5320",
              "display": {
                "title": "Level 20"
              }
            },
            {
              "key": "level_21",
              "threshold": "5800",
              "display": {
                "title": "Level 21"
              }
            },
            {
              "key": "level_22",
              "threshold": "6300",
              "display": {
                "title": "Level 22"
              }
            },
            {
              "key": "level_23",
              "threshold": "6820",
              "display": {
                "title": "Level 23"
              }
            },
            {
              "key": "level_24",
              "threshold": "7360",
              "display": {
                "title": "Level 24"
              }
            },
            {
              "key": "level_25",
              "threshold": "7920",
              "display": {
                "title": "Level 25"
              }
            },
            {
              "key": "level_26",
              "threshold": "8500",
              "display": {
                "title": "Level 26"
              }
            },
            {
              "key": "level_27",
              "threshold": "9100",
              "display": {
                "title": "Level 27"
              }
            },
            {
              "key": "level_28",
              "threshold": "9720",
              "display": {
                "title": "Level 28"
              }
            },
            {
              "key": "level_29",
              "threshold": "10360",
              "display": {
                "title": "Level 29"
              }
            },
            {
              "key": "level_30",
              "threshold": "11020",
              "display": {
                "title": "Level 30"
              }
            },
            {
              "key": "level_31",
              "threshold": "11700",
              "display": {
                "title": "Level 31"
              }
            },
            {
              "key": "level_32",
              "threshold": "12400",
              "display": {
                "title": "Level 32"
              }
            },
            {
              "key": "level_33",
              "threshold": "13120",
              "display": {
                "title": "Level 33"
              }
            },
            {
              "key": "level_34",
              "threshold": "13860",
              "display": {
                "title": "Level 34"
              }
            },
            {
              "key": "level_35",
              "threshold": "14620",
              "display": {
                "title": "Level 35"
              }
            },
            {
              "key": "level_36",
              "threshold": "15400",
              "display": {
                "title": "Level 36"
              }
            },
            {
              "key": "level_37",
              "threshold": "16200",
              "display": {
                "title": "Level 37"
              }
            },
            {
              "key": "level_38",
              "threshold": "17020",
              "display": {
                "title": "Level 38"
              }
            },
            {
              "key": "level_39",
              "threshold": "17860",
              "display": {
                "title": "Level 39"
              }
            },
            {
              "key": "level_40",
              "threshold": "18720",
              "display": {
                "title": "Level 40"
              }
            },
            {
              "key": "level_41",
              "threshold": "19600",
              "display": {
                "title": "Level 41"
              }
            },
            {
              "key": "level_42",
              "threshold": "20500",
              "display": {
                "title": "Level 42"
              }
            },
            {
              "key": "level_43",
              "threshold": "21420",
              "display": {
                "title": "Level 43"
              }
            },
            {
              "key": "level_44",
              "threshold": "22360",
              "display": {
                "title": "Level 44"
              }
            },
            {
              "key": "level_45",
              "threshold": "23320",
              "display": {
                "title": "Level 45"
              }
            },
            {
              "key": "level_46",
              "threshold": "24300",
              "display": {
                "title": "Level 46"
              }
            },
            {
              "key": "level_47",
              "threshold": "25300",
              "display": {
                "title": "Level 47"
              }
            },
            {
              "key": "level_48",
              "threshold": "26320",
              "display": {
                "title": "Level 48"
              }
            },
            {
              "key": "level_49",
              "threshold": "27360",
              "display": {
                "title": "Level 49"
              }
            },
            {
              "key": "level_50",
              "threshold": "28420",
              "display": {
                "title": "Level 50"
              }
            },
            {
              "key": "level_51",
              "threshold": "29500",
              "display": {
                "title": "Level 51"
              }
            },
            {
              "key": "level_52",
              "threshold": "30600",
              "display": {
                "title": "Level 52"
              }
            },
            {
              "key": "level_53",
              "threshold": "31720",
              "display": {
                "title": "Level 53"
              }
            },
            {
              "key": "level_54",
              "threshold": "32860",
              "display": {
                "title": "Level 54"
              }
            },
            {
              "key": "level_55",
              "threshold": "34020",
              "display": {
                "title": "Level 55"
              }
            },
            {
              "key": "level_56",
              "threshold": "35200",
              "display": {
                "title": "Level 56"
              }
            },
            {
              "key": "level_57",
              "threshold": "36400",
              "display": {
                "title": "Level 57"
              }
            },
            {
              "key": "level_58",
              "threshold": "37620",
              "display": {
                "title": "Level 58"
              }
            },
            {
              "key": "level_59",
              "threshold": "38860",
              "display": {
                "title": "Level 59"
              }
            },
            {
              "key": "level_60",
              "threshold": "40120",
              "display": {
                "title": "Level 60"
              }
            },
            {
              "key": "level_61",
              "threshold": "41400",
              "display": {
                "title": "Level 61"
              }
            },
            {
              "key": "level_62",
              "threshold": "42700",
              "display": {
                "title": "Level 62"
              }
            },
            {
              "key": "level_63",
              "threshold": "44020",
              "display": {
                "title": "Level 63"
              }
            },
            {
              "key": "level_64",
              "threshold": "45360",
              "display": {
                "title": "Level 64"
              }
            },
            {
              "key": "level_65",
              "threshold": "46720",
              "display": {
                "title": "Level 65"
              }
            },
            {
              "key": "level_66",
              "threshold": "48100",
              "display": {
                "title": "Level 66"
              }
            },
            {
              "key": "level_67",
              "threshold": "49500",
              "display": {
                "title": "Level 67"
              }
            },
            {
              "key": "level_68",
              "threshold": "50920",
              "display": {
                "title": "Level 68"
              }
            },
            {
              "key": "level_69",
              "threshold": "52360",
              "display": {
                "title": "Level 69"
              }
            },
            {
              "key": "level_70",
              "threshold": "53820",
              "display": {
                "title": "Level 70"
              }
            },
            {
              "key": "level_71",
              "threshold": "55300",
              "display": {
                "title": "Level 71"
              }
            },
            {
              "key": "level_72",
              "threshold": "56800",
              "display": {
                "title": "Level 72"
              }
            },
            {
              "key": "level_73",
              "threshold": "58320",
              "display": {
                "title": "Level 73"
              }
            },
            {
              "key": "level_74",
              "threshold": "59860",
              "display": {
                "title": "Level 74"
              }
            },
            {
              "key": "level_75",
              "threshold": "61420",
              "display": {
                "title": "Level 75"
              }
            },
            {
              "key": "level_76",
              "threshold": "63000",
              "display": {
                "title": "Level 76"
              }
            },
            {
              "key": "level_77",
              "threshold": "64600",
              "display": {
                "title": "Level 77"
              }
            },
            {
              "key": "level_78",
              "threshold": "66220",
              "display": {
                "title": "Level 78"
              }
            },
            {
              "key": "level_79",
              "threshold": "67860",
              "display": {
                "title": "Level 79"
              }
            },
            {
              "key": "level_80",
              "threshold": "69520",
              "display": {
                "title": "Level 80"
              }
            },
            {
              "key": "level_81",
              "threshold": "71200",
              "display": {
                "title": "Level 81"
              }
            },
            {
              "key": "level_82",
              "threshold": "72900",
              "display": {
                "title": "Level 82"
              }
            },
            {
              "key": "level_83",
              "threshold": "74620",
              "display": {
                "title": "Level 83"
              }
            },
            {
              "key": "level_84",
              "threshold": "76360",
              "display": {
                "title": "Level 84"
              }
            },
            {
              "key": "level_85",
              "threshold": "78120",
              "display": {
                "title": "Level 85"
              }
            },
            {
              "key": "level_86",
              "threshold": "79900",
              "display": {
                "title": "Level 86"
              }
            },
            {
              "key": "level_87",
              "threshold": "81700",
              "display": {
                "title": "Level 87"
              }
            },
            {
              "key": "level_88",
              "threshold": "83520",
              "display": {
                "title": "Level 88"
              }
            },
            {
              "key": "level_89",
              "threshold": "85360",
              "display": {
                "title": "Level 89"
              }
            },
            {
              "key": "level_90",
              "threshold": "87220",
              "display": {
                "title": "Level 90"
              }
            },
            {
              "key": "level_91",
              "threshold": "89100",
              "display": {
                "title": "Level 91"
              }
            },
            {
              "key": "level_92",
              "threshold": "91000",
              "display": {
                "title": "Level 92"
              }
            },
            {
              "key": "level_93",
              "threshold": "92920",
              "display": {
                "title": "Level 93"
              }
            },
            {
              "key": "level_94",
              "threshold": "94860",
              "display": {
                "title": "Level 94"
              }
            },
            {
              "key": "level_95",
              "threshold": "96820",
              "display": {
                "title": "Level 95"
              }
            },
            {
              "key": "level_96",
              "threshold": "98800",
              "display": {
                "title": "Level 96"
              }
            },
            {
              "key": "level_97",
              "threshold": "100800",
              "display": {
                "title": "Level 97"
              }
            },
            {
              "key": "level_98",
              "threshold": "102820",
              "display": {
                "title": "Level 98"
              }
            },
            {
              "key": "level_99",
              "threshold": "104860",
              "display": {
                "title": "Level 99"
              }
            },
            {
              "key": "level_100",
              "threshold": "106920",
              "display": {
                "title": "Level 100"
              }
            }
          ],
          "occurrence": {
            "type": "lifetime"
          }
        },
        "qualification": {
          "sources": []
        },
        "calendar": {
          "schema": "orishare.calendar/v1",
          "period": "none",
          "run_per_period": false,
          "timezone_source": "environment",
          "ambiguous_local_time": "earlier",
          "nonexistent_local_time": "next_valid",
          "event_time": {
            "merchant": "occurred_at",
            "client": "received_at"
          },
          "after_finalization": "correction_only"
        },
        "trust": {
          "minimum_trust": "merchant_asserted",
          "allowed_sources": ["publishable_event", "secret_key_event"],
          "on_insufficient": "progress_without_reward",
          "liability_caps": [],
          "recognition_caps": [],
          "allow_legacy_unknown": false
        },
        "correction": {
          "spendable": "reverse"
        },
        "reward": {
          "on": {
            "level:level_2": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_3": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_4": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_5": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_6": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_7": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_8": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_9": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_10": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_11": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_12": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_13": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_14": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_15": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_16": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_17": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_18": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_19": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_20": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_21": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_22": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_23": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_24": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_25": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_26": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_27": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_28": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_29": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_30": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_31": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_32": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_33": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_34": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_35": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_36": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_37": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_38": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_39": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_40": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_41": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_42": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_43": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_44": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_45": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_46": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_47": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_48": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_49": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_50": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_51": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_52": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_53": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_54": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_55": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_56": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_57": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_58": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_59": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_60": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_61": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_62": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_63": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_64": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_65": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_66": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_67": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_68": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_69": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_70": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_71": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_72": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_73": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_74": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_75": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_76": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_77": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_78": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_79": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_80": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_81": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_82": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_83": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_84": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_85": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_86": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_87": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_88": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_89": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_90": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_91": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_92": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_93": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_94": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_95": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_96": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_97": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_98": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_99": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ],
            "level:level_100": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 25,
                "effect_key": "coins"
              }
            ]
          }
        },
        "display": {
          "title": "Player level",
          "description": "Earn XP from matches and levels to level up."
        },
        "enrollment": {
          "mode": "automatic"
        }
      }
    },
    {
      "type": "program.create",
      "kind": "streak",
      "key": "daily_play",
      "name": "Daily play"
    },
    {
      "type": "program.publish_definition",
      "key": "daily_play",
      "definition": {
        "schema": "orishare.program/v2",
        "kind": "streak",
        "semantics": "native_v2",
        "definition": {
          "kind": "streak",
          "qualification": {
            "aggregation": "count",
            "minimum": "1"
          },
          "freezes": {
            "ceiling": 2,
            "auto_use": true,
            "purchase": {
              "currency": "coins",
              "amount_minor": "100"
            }
          },
          "milestones": [
            {
              "key": "three_days",
              "threshold": 3,
              "occurrence": "lifetime"
            },
            {
              "key": "seven_days",
              "threshold": 7,
              "occurrence": "lifetime"
            }
          ],
          "repair": {
            "price": {
              "currency": "coins",
              "amount_minor": "50"
            },
            "window_periods": 3,
            "maximum_per_days": {
              "count": 2,
              "days": 30
            }
          }
        },
        "qualification": {
          "sources": [
            {
              "event": "session.started"
            }
          ]
        },
        "calendar": {
          "schema": "orishare.calendar/v1",
          "period": "day",
          "run_per_period": false,
          "timezone_source": "environment",
          "ambiguous_local_time": "earlier",
          "nonexistent_local_time": "next_valid",
          "event_time": {
            "merchant": "occurred_at",
            "client": "received_at"
          },
          "after_finalization": "correction_only"
        },
        "trust": {
          "minimum_trust": "customer_claim",
          "allowed_sources": ["publishable_event", "secret_key_event", "operator_command"],
          "on_insufficient": "ignore",
          "liability_caps": [
            {
              "trust": "customer_claim",
              "currency": "coins",
              "scope": "customer",
              "window": "day",
              "maximum_minor": 100
            }
          ],
          "recognition_caps": [
            {
              "trust": "customer_claim",
              "per": "day",
              "contributions": 1
            }
          ],
          "allow_legacy_unknown": false
        },
        "correction": {
          "spendable": "reverse"
        },
        "reward": {
          "on": {
            "milestone:three_days": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 20,
                "effect_key": "coins",
                "liability": {
                  "currency": "coins",
                  "amount_minor": 20
                }
              }
            ],
            "milestone:seven_days": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 50,
                "effect_key": "coins",
                "liability": {
                  "currency": "coins",
                  "amount_minor": 50
                }
              }
            ]
          }
        },
        "display": {
          "title": "Daily play",
          "description": "Play every day to keep your streak."
        },
        "enrollment": {
          "mode": "automatic"
        }
      }
    },
    {
      "type": "program.create",
      "kind": "badge",
      "key": "wins",
      "name": "Wins"
    },
    {
      "type": "program.publish_definition",
      "key": "wins",
      "definition": {
        "schema": "orishare.program/v2",
        "kind": "badge",
        "semantics": "native_v2",
        "definition": {
          "kind": "badge",
          "qualification": {
            "aggregation": "count"
          },
          "ranks": [
            {
              "key": "first_win",
              "threshold": "1",
              "display": {
                "title": "First win"
              }
            },
            {
              "key": "ten_wins",
              "threshold": "10",
              "display": {
                "title": "10 wins"
              }
            },
            {
              "key": "hundred_wins",
              "threshold": "100",
              "display": {
                "title": "100 wins"
              }
            }
          ],
          "visibility": "visible",
          "repeatable": false,
          "occurrence": {
            "type": "lifetime"
          }
        },
        "qualification": {
          "sources": [
            {
              "event": "match.completed"
            }
          ]
        },
        "calendar": {
          "schema": "orishare.calendar/v1",
          "period": "none",
          "run_per_period": false,
          "timezone_source": "environment",
          "ambiguous_local_time": "earlier",
          "nonexistent_local_time": "next_valid",
          "event_time": {
            "merchant": "occurred_at",
            "client": "received_at"
          },
          "after_finalization": "correction_only"
        },
        "trust": {
          "minimum_trust": "customer_claim",
          "allowed_sources": ["publishable_event", "secret_key_event"],
          "on_insufficient": "ignore",
          "liability_caps": [],
          "recognition_caps": [
            {
              "trust": "customer_claim",
              "per": "day",
              "contributions": 30
            }
          ],
          "allow_legacy_unknown": false
        },
        "correction": {
          "spendable": "reverse"
        },
        "reward": {
          "on": {}
        },
        "display": {
          "title": "Wins",
          "description": "Win matches to rank up this badge."
        },
        "enrollment": {
          "mode": "automatic"
        }
      }
    },
    {
      "type": "program.create",
      "kind": "quest",
      "key": "warm_up",
      "name": "Warm up"
    },
    {
      "type": "program.publish_definition",
      "key": "warm_up",
      "definition": {
        "schema": "orishare.program/v2",
        "kind": "quest",
        "semantics": "native_v2",
        "definition": {
          "kind": "quest",
          "steps": [
            {
              "key": "play_matches",
              "aggregation": "count",
              "target": "3",
              "display": {
                "title": "Play 3 matches"
              }
            },
            {
              "key": "win_match",
              "aggregation": "count",
              "target": "1",
              "display": {
                "title": "Win a match"
              }
            },
            {
              "key": "complete_level",
              "aggregation": "count",
              "target": "1",
              "display": {
                "title": "Complete a level"
              }
            }
          ],
          "prerequisites": [],
          "collection": "auto_collect",
          "repeatable": false
        },
        "qualification": {
          "sources": [
            {
              "event": "match.completed",
              "step": "play_matches"
            },
            {
              "event": "match.completed",
              "step": "win_match"
            },
            {
              "event": "level.completed",
              "step": "complete_level"
            }
          ]
        },
        "calendar": {
          "schema": "orishare.calendar/v1",
          "period": "none",
          "run_per_period": false,
          "timezone_source": "environment",
          "ambiguous_local_time": "earlier",
          "nonexistent_local_time": "next_valid",
          "event_time": {
            "merchant": "occurred_at",
            "client": "received_at"
          },
          "after_finalization": "correction_only"
        },
        "trust": {
          "minimum_trust": "customer_claim",
          "allowed_sources": ["publishable_event", "secret_key_event"],
          "on_insufficient": "ignore",
          "liability_caps": [
            {
              "trust": "customer_claim",
              "currency": "coins",
              "scope": "customer",
              "window": "day",
              "maximum_minor": 100
            }
          ],
          "recognition_caps": [
            {
              "trust": "customer_claim",
              "per": "day",
              "contributions": 30
            }
          ],
          "allow_legacy_unknown": false
        },
        "correction": {
          "spendable": "reverse"
        },
        "reward": {
          "on": {
            "completion": [
              {
                "type": "points.award",
                "currency": "coins",
                "amount": 100,
                "effect_key": "coins",
                "liability": {
                  "currency": "coins",
                  "amount_minor": 100
                }
              }
            ]
          }
        },
        "display": {
          "title": "Warm up",
          "description": "Play 3 matches, win one and complete a level."
        },
        "enrollment": {
          "mode": "automatic"
        }
      }
    },
    {
      "type": "program.create",
      "kind": "leaderboard",
      "key": "weekly_xp",
      "name": "Weekly XP"
    },
    {
      "type": "program.publish_definition",
      "key": "weekly_xp",
      "definition": {
        "schema": "orishare.program/v2",
        "kind": "leaderboard",
        "semantics": "native_v2",
        "definition": {
          "kind": "leaderboard",
          "aggregation": "sum",
          "input": {
            "minimum": "-1000000",
            "maximum": "1000000"
          },
          "order": "descending",
          "scope": {
            "type": "global"
          },
          "rank": "ordinal",
          "privacy": {
            "display": "pseudonymous",
            "opt_out": true,
            "anonymous_entries": false
          },
          "prizes": [],
          "score_source": {
            "type": "currency_earned",
            "currency": "xp"
          }
        },
        "qualification": {
          "sources": []
        },
        "calendar": {
          "schema": "orishare.calendar/v1",
          "period": "week",
          "run_per_period": false,
          "timezone_source": "environment",
          "ambiguous_local_time": "earlier",
          "nonexistent_local_time": "next_valid",
          "event_time": {
            "merchant": "occurred_at",
            "client": "received_at"
          },
          "after_finalization": "correction_only"
        },
        "trust": {
          "minimum_trust": "customer_claim",
          "allowed_sources": ["operator_command"],
          "on_insufficient": "ignore",
          "liability_caps": [],
          "recognition_caps": [],
          "allow_legacy_unknown": false
        },
        "correction": {
          "spendable": "reverse"
        },
        "reward": {
          "on": {}
        },
        "display": {
          "title": "Weekly XP",
          "description": "Most XP earned this week."
        },
        "enrollment": {
          "mode": "automatic"
        }
      }
    },
    {
      "type": "program.create",
      "kind": "referral",
      "key": "invite_friends",
      "name": "Invite friends"
    },
    {
      "type": "program.publish_definition",
      "key": "invite_friends",
      "definition": {
        "schema": "orishare.program/v2",
        "kind": "referral",
        "semantics": "native_v2",
        "definition": {
          "kind": "referral",
          "attribution_window_seconds": 2592000,
          "account_eligibility": "new",
          "new_account_window_seconds": 604800,
          "allow_anonymous_claim": false,
          "qualifying_event": "referral.qualified",
          "minimum": {
            "currency": "coins",
            "amount_minor": "1"
          },
          "cooling_off_seconds": 86400,
          "rewards": {
            "referrer": [
              {
                "type": "currency",
                "currency": "coins",
                "amount_minor": "200"
              }
            ],
            "referred": [
              {
                "type": "currency",
                "currency": "coins",
                "amount_minor": "100"
              }
            ]
          },
          "caps": {
            "per_referrer": 50,
            "per_environment": 100000
          },
          "refund": "proportional_then_invalidate",
          "approval": {
            "mode": "automatic",
            "period_seconds": 2592000,
            "max_per_referrer_per_period": 10,
            "max_per_period": 500
          }
        },
        "qualification": {
          "sources": [
            {
              "event": "referral.qualified"
            }
          ]
        },
        "calendar": {
          "schema": "orishare.calendar/v1",
          "period": "none",
          "run_per_period": false,
          "timezone_source": "environment",
          "ambiguous_local_time": "earlier",
          "nonexistent_local_time": "next_valid",
          "event_time": {
            "merchant": "occurred_at",
            "client": "received_at"
          },
          "after_finalization": "correction_only"
        },
        "trust": {
          "minimum_trust": "merchant_asserted",
          "allowed_sources": ["secret_key_event"],
          "on_insufficient": "ignore",
          "liability_caps": [],
          "recognition_caps": [],
          "allow_legacy_unknown": false
        },
        "correction": {
          "spendable": "reverse"
        },
        "reward": {
          "on": {}
        },
        "display": {
          "title": "Invite friends",
          "description": "Share your code; you both get coins when your friend plays."
        },
        "enrollment": {
          "mode": "automatic"
        }
      }
    }
  ]
}
