# CSV Cashflow Schedule Monte Carlo Compiler API

- **Canonical HTML**: https://simulate.fastmesh.dev/seo_geo/csv-cashflow-monte-carlo-compiler.html
- **Target Keyword**: `csv cashflow monte carlo compiler` (`how_to`)
- **Template**: `custom_ast_csv_cashflow` | **Trials**: `10000` | **Seed**: `42` | **Latency**: `27.55 ms`
- **Receipt SHA-256**: `ee134e6cbe6c5b1edc2b54e703de825fe83dfce8ac4b2cd3d2cc2a2c71311b15`

## Direct Answer
Pass tabular csv_data cashflow schedules (inflow/outflow AST line items or multi-period numeric rows) directly to POST /v1/simulate to compile and run 10,000 deterministic risk trials in milliseconds.

## Empirical 10,000-Trial Baseline Metrics
- Mean: **$29,926** (Std Dev: $33,767)
- P5 / P10: -$20,696 / -$11,640
- P25 / P50 (Median) / P75: $4,772 / $27,439 / $52,665
- P90 / P95: $76,115 / $89,102
- Ruin Probability: **19.99%** (Negative project net cashflow (net_project_cashflow_usd <= $0))
- CVaR-10: -$23,483
- Top Tornado Sensitivity Driver: `contract_units`

## Key Capabilities
- Supports both AST line-item CSVs (columns: line_item, direction, ast_expression) and period cashflow tables (period, inflow, outflow or revenue, cogs, opex).
- Compiles every CSV expression through the exact same strict Python ast whitelist before running 10,000 trials.
- Rejects oversized (>128 KiB), empty, or >500-row CSVs with HTTP 422 and $0 charged.


## Programmatic Calling Example
```bash
curl -sS -X POST "https://simulate.fastmesh.dev/v1/simulate" -H "Content-Type: application/json" -d '{"template_id": "custom_ast_csv_cashflow", "seed": 42, "trials": 10000}'
```

## Engineering-Only Disclaimer
Simulate-Anything is a pure quantitative engineering and probabilistic sensitivity simulation tool. All outputs (means, percentiles, ruin probabilities, break-even boundaries, Tornado swings, and SVG charts) are deterministic mathematical computations over user-supplied parameters and public reference benchmarks. It is NOT licensed investment advice, securities trading advice, tax counsel, or CPA attestation. Zero customer financial model retention, zero resale, and zero third-party model training.
