Cost basis of an asset bought
The acquisition cost of an asset bought is calculated as the asset's fair market value (FMV) at the time of the transaction.
Cost basis of an asset sold
The acquisition cost of an asset sold is calculated according to the selected cost basis method. In most countries, the default calculation method is First-in First-out, also referred to as FIFO.
There are special rules for calculating cost basis in certain countries, such as the UK and Canada.
We have written several in-depth guides about this topic. We recommend starting with this guide to learn more: Cryptocurrency Tax Calculations: What is FIFO, LIFO, and HIFO?