Product margins per tonne
product_marginsCompute per-product revenue, cost, and margin per metric tonne by applying metal assays, payable percentages, and index prices, with inventory valued at market.
Instructions
Compute per-product revenue, cost, and margin per metric tonne. Revenue/MT = sum over metals of (assay% x payable% x index price), marked to market against inventory. Returns one record per product with metal contributions and inventory valuation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| config | No | Margin config (products, indices, cost_per_mt, inventory_mt, sensitivity_shocks, contracts). Defaults to the bundled sample config. | |
| prices | No | Index prices {symbol: usd_per_tonne}. Defaults to the bundled sample feed. |