Gain to which subsection (a)(2) applies shall be included in income in the taxable year which includes the earlier of— (A) the date on which such investment is sold or exchanged, or (B) December 31, 2026. (2) Amount includible (A) In general The amount of gain included in gross income under subsection (a)(1) shall be the excess of— (i) the lesser of the amount of gain excluded under paragraph (1) or the fair market value of the property as of the determined as of the date described in paragraph (1), over (ii) the taxpayer's basis in the investment. (B) Determination of basis (i) In general Except as otherwise provided in this clause or subsection (c), the taxpayer's basis in the investment shall be zero. (ii) Increase for gain recognized under subsection (a)(2) The basis in the investment shall be increased by the amount of gain recognized by reason of subsection (a)(2) with respect to such property. (iii) Investments held for 5 years In the case of any investment held for at least 5 years, the basis of such investment shall be increased by an amount equal to 10 percent of the amount of gain deferred by reason of subsection (a)(1). (iv) Investments held for 7 years In the case of any investment held by the taxpayer for at least 7 years, in addition to any adjustment made under clause (iii), the basis of such property shall be increased by an amount equal to 5 percent of the amount of gain deferred by reason of subsection (a)(1). (c) Special rule for investments held for at least 10 years In the case of any investment held by the taxpayer for at least 10 years and with respect to which the taxpayer makes an election under this clause, the basis of such property shall be equal to the fair market value of such investment on the date that the investment is sold or exchanged. (d) Qualified opportunity fund For purposes of this section— (1) Qualified opportunity fund The term qualified opportunity fund means any investment vehicle which is organized as a corporation or a partnership for the purpose of investing in