Skip to content
HALOWERK

Finopswerk

scenario nonanticipative liquidity injections

Computes the complete optimal bounded capital-injection policy for one declared 2-stage information tree with four leaf scenarios A0, A1, B0, B1. Root injection x occurs before the observed stage-1 signal A/B and its cashflow d1; child injection yA/yB occurs after the signal but before the second cashflow d2. Cash must stay >= 0 on all leaves, with 0 <= x, yA, yB <= supplied caps. It minimizes the expected weighted injection cost c0*x + pA*cA*yA + pB*cB*yB.

POST https://finops.halowerk.com/v1/scenario-nonanticipative-liquidity-injections

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
initial_cash_nintegerYes
stage1_cashflow_narrayYes
stage2_cashflow_narrayYes
injection_caps_narrayYes
unit_cost_narrayYes
money_denominatorintegerYes
cost_denominatorintegerYes
leaf_probability_narrayYes
probability_denominatorintegerYes
reportSee schemaYes
Show full input schema
{
  "type": "object",
  "properties": {
    "initial_cash_n": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1000
    },
    "stage1_cashflow_n": {
      "type": "array",
      "items": {
        "type": "integer",
        "minimum": -1000,
        "maximum": 1000
      },
      "minItems": 2,
      "maxItems": 2
    },
    "stage2_cashflow_n": {
      "type": "array",
      "items": {
        "type": "array",
        "items": {
          "type": "integer",
          "minimum": -1000,
          "maximum": 1000
        },
        "minItems": 2,
        "maxItems": 2
      },
      "minItems": 2,
      "maxItems": 2
    },
    "injection_caps_n": {
      "type": "array",
      "items": {
        "type": "integer",
        "minimum": 0,
        "maximum": 1000
      },
      "minItems": 3,
      "maxItems": 3
    },
    "unit_cost_n": {
      "type": "array",
      "items": {
        "type": "integer",
        "minimum": 1,
        "maximum": 1000
      },
      "minItems": 3,
      "maxItems": 3
    },
    "money_denominator": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1000
    },
    "cost_denominator": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1000
    },
    "leaf_probability_n": {
      "type": "array",
      "items": {
        "type": "integer",
        "minimum": 1,
        "maximum": 1000
      },
      "minItems": 4,
      "maxItems": 4
    },
    "probability_denominator": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1000
    },
    "report": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "object",
          "properties": {
            "policy_and_value": {
              "type": "object",
              "minProperties": 6,
              "maxProperties": 6,
              "propertyNames": {
                "enum": [
                  "root",
                  "after_signal_A",
                  "after_signal_B",
                  "expected_cost",
                  "optimal_root_min",
                  "optimal_root_max"
                ]
              },
              "additionalProperties": {
                "type": "object",
                "properties": {
                  "n": {},
                  "d": {}
                },
                "required": [
                  "n",
                  "d"
                ],
                "additionalProperties": false,
                "oneOf": [
                  {
                    "properties": {
                      "n": {
                        "type": "string",
                        "pattern": "^(0|-[1-9][0-9]*|[1-9][0-9]*)$",
                        "maxLength": 64
                      },
                      "d": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]*$",
                        "maxLength": 64
                      }
                    }
                  },
                  {
                    "properties": {
                      "n": {
                        "type": "null"
                      },
                      "d": {
                        "type": "null"
                      }
                    }
                  }
                ]
              }
            },
            "optimal_vertices": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "n": {},
                    "d": {}
                  },
                  "required": [
                    "n",
                    "d"
                  ],
                  "additionalProperties": false,
                  "oneOf": [
                    {
                      "properties": {
                        "n": {
                          "type": "string",
                          "pattern": "^(0|-[1-9][0-9]*|[1-9][0-9]*)$",
                          "maxLength": 64
                        },
                        "d": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]*$",
                          "maxLength": 64
                        }
                      }
                    },
                    {
                      "properties": {
                        "n": {
                          "type": "null"
                        },
                        "d": {
                          "type": "null"
                        }
                      }
                    }
                  ]
                },
                "minItems": 3,
                "maxItems": 3
              },
              "minItems": 1,
              "maxItems": 2
            }
          },
          "required": [
            "policy_and_value",
            "optimal_vertices"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "required": [
    "initial_cash_n",
    "stage1_cashflow_n",
    "stage2_cashflow_n",
    "injection_caps_n",
    "unit_cost_n",
    "money_denominator",
    "cost_denominator",
    "leaf_probability_n",
    "probability_denominator",
    "report"
  ],
  "additionalProperties": false
}

Open original schema

Published input example

{
  "initial_cash_n": 0,
  "stage1_cashflow_n": [
    -2,
    1
  ],
  "stage2_cashflow_n": [
    [
      -3,
      2
    ],
    [
      -5,
      1
    ]
  ],
  "injection_caps_n": [
    6,
    6,
    6
  ],
  "unit_cost_n": [
    1,
    4,
    4
  ],
  "money_denominator": 1,
  "cost_denominator": 1,
  "leaf_probability_n": [
    1,
    1,
    1,
    1
  ],
  "probability_denominator": 4,
  "report": {
    "policy_and_value": {
      "root": {
        "n": "5",
        "d": "1"
      },
      "after_signal_A": {
        "n": "0",
        "d": "1"
      },
      "after_signal_B": {
        "n": "0",
        "d": "1"
      },
      "expected_cost": {
        "n": "5",
        "d": "1"
      },
      "optimal_root_min": {
        "n": "5",
        "d": "1"
      },
      "optimal_root_max": {
        "n": "5",
        "d": "1"
      }
    },
    "optimal_vertices": [
      [
        {
          "n": "5",
          "d": "1"
        },
        {
          "n": "0",
          "d": "1"
        },
        {
          "n": "0",
          "d": "1"
        }
      ]
    ]
  }
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub โ†’