{
  "directed": true,
  "name": "Fig9bcd_CodePanels",
  "strict": false,
  "attrs": {
    "rankdir": "LR",
    "fontsize": "10"
  },
  "nodes": [
    {
      "id": "\\n",
      "attrs": {}
    }
  ],
  "edges": [
    {
      "source": "cluster_init",
      "target": "cluster_net",
      "attrs": {
        "style": "invis"
      }
    },
    {
      "source": "cluster_net",
      "target": "cluster_pay",
      "attrs": {
        "style": "invis"
      }
    }
  ],
  "subgraphs": [
    {
      "name": "cluster_init",
      "attrs": {
        "label": "\"(b) RcveReqInit - Initialization\"",
        "style": "rounded"
      },
      "nodes": [
        {
          "id": "init1",
          "attrs": {
            "label": "\"Load/validate request\\n(payer, payee, amount)\""
          }
        },
        {
          "id": "init2",
          "attrs": {
            "label": "\"Initialize ledger refs\\n& session variables\""
          }
        },
        {
          "id": "\\n",
          "attrs": {}
        }
      ],
      "edges": [
        {
          "source": "init1",
          "target": "init2",
          "attrs": {}
        }
      ],
      "subgraphs": []
    },
    {
      "name": "cluster_net",
      "attrs": {
        "label": "\"(c) CalcNetPos - Netting Computation\"",
        "style": "rounded"
      },
      "nodes": [
        {
          "id": "net1",
          "attrs": {
            "label": "\"Update running net\\n(netXY += delta)\""
          }
        },
        {
          "id": "net2",
          "attrs": {
            "label": "\"Update counters\\n(countSinceSettle++)\""
          }
        },
        {
          "id": "net3",
          "attrs": {
            "label": "\"Check trigger:\\n|netXY|>=NetLimit\\nor count>=NumLimit\""
          }
        },
        {
          "id": "\\n",
          "attrs": {}
        }
      ],
      "edges": [
        {
          "source": "net1",
          "target": "net2",
          "attrs": {}
        },
        {
          "source": "net2",
          "target": "net3",
          "attrs": {}
        }
      ],
      "subgraphs": []
    },
    {
      "name": "cluster_pay",
      "attrs": {
        "label": "\"(d) DoSettle - Issue Settlement Payment\"",
        "style": "rounded"
      },
      "nodes": [
        {
          "id": "pay1",
          "attrs": {
            "label": "\"Determine direction:\\nif netXY>0 => X pays Y\\nelse Y pays X\""
          }
        },
        {
          "id": "pay2",
          "attrs": {
            "label": "\"Transfer stablecoin\\nfor |netXY|\""
          }
        },
        {
          "id": "pay3",
          "attrs": {
            "label": "\"Reset net + counters\\n(netXY=0, count=0)\""
          }
        },
        {
          "id": "\\n",
          "attrs": {}
        }
      ],
      "edges": [
        {
          "source": "pay1",
          "target": "pay2",
          "attrs": {}
        },
        {
          "source": "pay2",
          "target": "pay3",
          "attrs": {}
        }
      ],
      "subgraphs": []
    }
  ]
}