# This file is automatically generated by pyo3_stub_gen
# ruff: noqa: E501

import decimal
import typing

from nautilus_trader import analysis
from nautilus_trader import model

__all__ = [
    "Portfolio",
    "PortfolioConfig",
]

@typing.final
class PortfolioConfig:
    @property
    def use_mark_prices(self) -> bool: ...
    @property
    def use_mark_xrates(self) -> bool: ...
    @property
    def bar_updates(self) -> bool: ...
    @property
    def convert_to_account_base_currency(self) -> bool: ...
    @property
    def equity_curve(self) -> bool: ...
    @property
    def min_account_state_logging_interval_ms(self) -> int | None: ...
    @property
    def snapshot_interval_ms(self) -> int | None: ...
    @property
    def debug(self) -> bool: ...
    def __new__(
        cls,
        use_mark_prices: bool | None = None,
        use_mark_xrates: bool | None = None,
        bar_updates: bool | None = None,
        convert_to_account_base_currency: bool | None = None,
        equity_curve: bool | None = None,
        min_account_state_logging_interval_ms: int | None = None,
        debug: bool | None = None,
        snapshot_interval_ms: int | None = None,
    ) -> PortfolioConfig: ...

@typing.final
class Portfolio:
    def is_initialized(self) -> bool: ...
    def account(
        self, venue: model.Venue | None = None, account_id: model.AccountId | None = None
    ) -> typing.Any | None: ...
    def balances_locked(
        self, venue: model.Venue | None = None, account_id: model.AccountId | None = None
    ) -> dict | None: ...
    def instrument_initial_margins(
        self, venue: model.Venue | None = None, account_id: model.AccountId | None = None
    ) -> dict | None: ...
    def instrument_maintenance_margins(
        self, venue: model.Venue | None = None, account_id: model.AccountId | None = None
    ) -> dict | None: ...
    def realized_pnls(
        self,
        venue: model.Venue | None = None,
        account_id: model.AccountId | None = None,
        target_currency: model.Currency | None = None,
    ) -> dict: ...
    def unrealized_pnls(
        self,
        venue: model.Venue | None = None,
        account_id: model.AccountId | None = None,
        target_currency: model.Currency | None = None,
    ) -> dict: ...
    def total_pnls(
        self,
        venue: model.Venue | None = None,
        account_id: model.AccountId | None = None,
        target_currency: model.Currency | None = None,
    ) -> dict: ...
    def net_exposures(
        self,
        venue: model.Venue | None = None,
        account_id: model.AccountId | None = None,
        target_currency: model.Currency | None = None,
    ) -> dict | None: ...
    def mark_values(
        self, venue: model.Venue | None = None, account_id: model.AccountId | None = None
    ) -> dict: ...
    def equity(
        self, venue: model.Venue | None = None, account_id: model.AccountId | None = None
    ) -> dict: ...
    def missing_price_instruments(
        self, venue: model.Venue, account_id: model.AccountId | None = None
    ) -> list[model.InstrumentId]: ...
    def build_snapshot(self, account_id: model.AccountId) -> model.PortfolioSnapshot | None: ...
    def snapshots(self, account_id: model.AccountId) -> list[model.PortfolioSnapshot]: ...
    def realized_pnl(
        self,
        instrument_id: model.InstrumentId,
        account_id: model.AccountId | None = None,
        target_currency: model.Currency | None = None,
    ) -> model.Money | None: ...
    def unrealized_pnl(
        self,
        instrument_id: model.InstrumentId,
        price: model.Price | None = None,
        account_id: model.AccountId | None = None,
        target_currency: model.Currency | None = None,
    ) -> model.Money | None: ...
    def total_pnl(
        self,
        instrument_id: model.InstrumentId,
        price: model.Price | None = None,
        account_id: model.AccountId | None = None,
        target_currency: model.Currency | None = None,
    ) -> model.Money | None: ...
    def net_exposure(
        self,
        instrument_id: model.InstrumentId,
        price: model.Price | None = None,
        account_id: model.AccountId | None = None,
        target_currency: model.Currency | None = None,
    ) -> model.Money | None: ...
    def net_position(
        self, instrument_id: model.InstrumentId, account_id: model.AccountId | None = None
    ) -> decimal.Decimal: ...
    def is_net_long(
        self, instrument_id: model.InstrumentId, account_id: model.AccountId | None = None
    ) -> bool: ...
    def is_net_short(
        self, instrument_id: model.InstrumentId, account_id: model.AccountId | None = None
    ) -> bool: ...
    def is_net_flat(
        self, instrument_id: model.InstrumentId, account_id: model.AccountId | None = None
    ) -> bool: ...
    def is_completely_net_flat(self, account_id: model.AccountId | None = None) -> bool: ...
    def statistics(self) -> analysis.PortfolioStatistics: ...
    def register_statistic(self, statistic: typing.Any) -> None: ...
    def deregister_statistic(self, statistic: typing.Any) -> None: ...
    def deregister_statistics(self) -> None: ...
