Cost basis

FIFO, LIFO and average, carried correctly through splits, mergers and spin-offs.

Methods

Three methods are supported: FIFO, LIFO and average cost. The method is a query parameter rather than an account setting, so a position can be evaluated under more than one basis without reconfiguring anything.

Surviving corporate actions

Basis is carried through corporate actions rather than reset at them. A position held across a merger keeps a defensible basis, and the actions applied to reach the current state are listed on the response so a discrepancy is traceable to a specific event.

curl -s https://api.robinhoodrpc.io/v1/accounts/0xabc.../positions \  -H "Authorization: Bearer $RHRPC_KEY" \  -G --data-urlencode "cost_basis_method=FIFO" \  | jq '.positions[] | {token_symbol, cost_basis_usd, applied_action_ids}'

Correctness

Correctness note

A basis calculation that treats a split as a purchase, or a dividend reinvestment as a new lot, will diverge from a broker statement. Because Robinhood expresses both through the multiplier rather than as transfers, a naive transfer-based basis engine sees nothing at all and is wrong by omission.

Related