FIFO is the default accounting method used by the IRS for most taxpayers, unless another method is chosen prior to the sale of a security. FIFO cost basis method assumes the first shares you sell are matched with the first shares you purchased. LIFO assumes the first shares you sell are matched with the shares you purchased last. IBKR allows you to change the tax basis on your account but defaults to FIFO for assets sold from your account. See FAQ: How often may I change the tax basis method on my account?
In compliance with Treasury Department Circular 230, unless stated to the contrary, any information contained in this FAQ was not intended or written to be used and cannot be used for the purpose of avoiding tax penalties that may be imposed on any taxpayer.