Skip to content

API Reference


API Reference / applyFill

Function: applyFill()

applyFill(existing, fill): LedgerPosition

Defined in: src/execution/PositionLedger.ts:44

Folds one fill into a position's running average-cost state.

Pure and side-effect-free so every add/reduce/close/flip case is directly testable without a PositionLedger instance.

Parameters

existing

LedgerPosition | undefined

fill

Fill

Returns

LedgerPosition

Community project — not affiliated with Dhan. MIT License.