bayesline.api.equity.AsyncOptimizationResult#

class bayesline.api.equity.AsyncOptimizationResult#

Contains the optimized state of each portfolio in the problem.

Each portfolio is optimized independently against the same objectives and constraints, so every date/portfolio pair carries its own solver status and objective value; one errored or infeasible solve does not affect the others.

__init__()#

Methods

__init__()

get_exposures()

Get the prior and optimized factor exposures per date and portfolio.

get_holdings()

Get the prior and optimized holdings per date, portfolio and asset.

get_summary()

Get the solver outcome per date and portfolio.

abstractmethod async get_summary() DataFrame#

Get the solver outcome per date and portfolio.

Solution-carrying rows (optimal, optimal_inaccurate) report the achieved objective value; other rows report a null objective value. message holds a human-readable explanation for rows without a solution and is null otherwise.

objective_value is in scaled (gross-nav-relative) units, not dollars or a per-net-nav unit – a multi-term objective would have no single natural unit to convert it to.

Returns#

pl.DataFrame

A dataframe with columns date, portfolio_id, status (an OptimizationStatus value), objective_value, and message, one row per optimized date and portfolio.

abstractmethod async get_holdings() DataFrame#

Get the prior and optimized holdings per date, portfolio and asset.

Only date/portfolio pairs whose status carries a solution (optimal, optimal_inaccurate) contribute rows.

Returns#

pl.DataFrame

A dataframe with columns date, portfolio_id, asset_id, old, new, and trade, all in nav currency (dollars).

abstractmethod async get_exposures() DataFrame#

Get the prior and optimized factor exposures per date and portfolio.

Only date/portfolio pairs whose status carries a solution (optimal, optimal_inaccurate) contribute rows.

Returns#

pl.DataFrame

A dataframe with columns date, portfolio_id, factor, old, and new, both per unit of net nav. Null for a factor-unconstrained portfolio whose net nav is ~0 (long/short books), where a per-net-nav value is not well-defined.