# Cost basis

> Cost basis is what a position actually cost you. It is the anchor every return figure is measured from, which is why a wrong cost basis quietly corrupts everything else.

Cost basis is the total amount you put into a position. It is the reference
point that [unrealised and realised return](/concepts/unrealised-and-realised-return)
are both measured against, which makes it the most load-bearing number in the
holdings table.

If the cost basis is wrong, every return figure derived from it is wrong by the
same amount, and nothing about the display will look broken.

## Where it comes from

For connected brokers, cost basis is built from your actual trade history: each
buy adds its consideration, each sell removes a proportional share. That is why
importing a complete transaction history matters more than importing a recent
one. A portfolio whose earliest trades are missing will show a cost basis that
is too low and a return that is correspondingly too flattering.

For closed positions the same column reads as the total you invested over the
life of the position.

## Why it drifts

Three things move a cost basis in ways people find surprising.

**Partial sells.** Selling part of a position reduces the remaining cost basis
proportionally, not by the amount you sold it for. What you gained on the part
you sold moves to realised return instead.

**Corporate actions.** A stock split multiplies your quantity without changing
what you paid, so the cost basis stays put while
[average cost](/concepts/average-cost) falls. A split applied after the fact
changes historical figures, which is expected rather than a bug.

**Currency.** Gylder holds everything in euro. A position bought in another
currency has a cost basis fixed in euro at the time of purchase, so subsequent
exchange rate moves show up in your return rather than restating what you paid.

## Manual holdings

A holding you entered by hand has no trade history to build a cost basis from.
Its value comes from the valuations you enter, so it is excluded from the
contribution-based return and risk calculations rather than being given an
invented starting point.

That is why a portfolio with many manual entries will show risk measures
covering less than the whole of it.
