Find a funding gap inside an otherwise positive cash schedule
A positive closing balance can conceal a mid-period reserve breach. Replay the signed flows in order. The closing balance is 25, but two period ends fall below the reserve and the worst gap is 15.
Run the framework with your own input
Install Blyx 0.2.1 and a Rust toolchain with a host linker, then run the versioned project. Each positional argument is a number or a comma-separated numerical vector. The CLI accepts up to 16 entries per vector. The imported module accepts longer inputs.
git clone --depth 1 --branch v0.1.0 https://github.com/Rahulchaube1/blyx-siskin.git
cd blyx-siskin
blyxc native-run project.blyx -- 20 "-15,-10,30" 10API and return values
Returns [closing balance, low-water balance, first deficient period, deficient periods, period-end funding gap]. Flows must be in date order. Invalid input returns an empty vector.
| Argument | Accepted input |
|---|---|
| opening | exact signed integer |
| flows | Vector of: exact signed integer |
| reserve | exact signed integer |
Use the libraries independently
The framework vendors the same library source published in these two repositories. Each module has its own package page, input contract and regression suite.
Try the program
Expected output
25 -5 0 2 15
Practice
Change opening = 0.0, flows = [10]. Predict the result, then run the program.
Hint
Returns [closing balance, low-water balance, first deficient period, deficient periods, period-end funding gap]. Flows must be in date order.
Worked solution
The result vector is [10, 0, -1, 0, 0]. Compare its fields with the return layout in the API section.
Find
let opening = 20.0;Replace with
let opening = 0.0;Find
let flows = [-15, -10, 30];Replace with
let flows = [10];Output after the change
10 0 -1 0 0
