Skip to content

bank

Bank model holding InstrumentStore, PositionStore, and Ledger.

Classes:

  • Bank

    Holds instruments, positions, and ledger. No business logic.

  • BookView

    Lightweight view over a Bank's positions filtered by book type.

Bank

Bank(
    name: str,
    instruments: InstrumentStore,
    positions: PositionStore,
    ledger: Ledger,
)

Holds instruments, positions, and ledger. No business logic.

Attributes:

banking_book property

banking_book: BookView

View of banking book positions (for backward compatibility).

trading_book property

trading_book: BookView

View of trading book positions (for backward compatibility).

BookView

BookView(bank: Bank, book_type: BookType)

Lightweight view over a Bank's positions filtered by book type.

Provides iteration over instruments for backward compatibility with BankBookController which expects an iterable of instruments.

Methods:

get_instrument_by_id

get_instrument_by_id(instrument_id: str)

Look up instrument by id.