piker/piker/accounting
Gud Boi c7979d0100 Enable console logging in `.accounting` on import
Enable `get_console_log()` at `.accounting.__init__` import-time
to ensure console output is available whenever the subsystem is
used by `.clearing` or other code.

Deats,
- uncomment and complete `get_console_log()` call in
  `.accounting.__init__` with default `level='warning'` and
  `name=__name__`.
- update comment explaining rationale: better to enable on import
  since namely used by `.clearing` subsystem.

Also,
- change `piker.calc` import to relative `.calc` in
  `.accounting.__init__`.
- drop unused `get_console_log` import from `.accounting._pos`.
- add `log = get_logger(name=__name__)` to `.accounting.cli`.
- change `get_logger(loglevel)` -> `get_console_log()` in
  `.accounting.cli.sync()` with proper kwargs.
- add `get_console_log` import to `.accounting.cli`.

(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-02-23 12:22:48 -05:00
..
README.rst Officially drop `Position.size` 2023-08-03 16:57:02 -04:00
__init__.py Enable console logging in `.accounting` on import 2026-02-23 12:22:48 -05:00
_allocate.py Bleh, move `.data.types` back up to top level pkg 2023-08-05 15:57:10 -04:00
_ledger.py `.accounting._ledger`: typing anda more multiline styling 2026-01-02 16:49:16 -05:00
_mktinfo.py Finally drop `Symbol` 2026-01-02 16:49:16 -05:00
_pos.py Enable console logging in `.accounting` on import 2026-02-23 12:22:48 -05:00
calc.py accounting.calc: `.error()` on bad txn-time fields.. 2026-01-07 14:05:23 -05:00
cli.py Enable console logging in `.accounting` on import 2026-02-23 12:22:48 -05:00

README.rst

.accounting

A subsystem for transaction processing, storage and historical measurement.

.pnl

BEP, the break even price: the price at which liquidating a remaining position results in a zero PnL since the position was "opened" in the destination asset.

PPU: price-per-unit: the "average cost" (in cumulative mean terms) of the "entry" transactions which "make a position larger"; taking a profit relative to this price means that you will "make more profit then made prior" since the position was opened.