hoodkit
    Preparing search index...

    Class Position

    A multiplier-aware position tracker with weighted-average-cost PnL.

    PnL is computed in the quote asset per token. Robinhood's Chainlink feeds are total-return (already multiplier-adjusted), so comparing average cost per token to the current per-token price is corporate-action correct without re-applying uiMultiplier — a reinvested dividend shows up as a price move, captured in unrealized PnL. The multiplier is used only to report share-equivalent quantity.

    Index
    multiplier: bigint

    1e18-scaled ERC-8056 multiplier for share-equivalent reporting.

    • get shareEquivalent(): number

      Share-equivalent quantity given the current multiplier.

      Returns number

    • Apply a fill, updating average cost (buys) or banking realized PnL (sells).

      Parameters

      Returns void

    • Unrealized PnL at markPrice.

      Parameters

      • markPrice: number

      Returns number