Deductions & credits

Ah, now that I know I can speak legal gibberish, that changes how I can respond.   🙂

§1.1001-1(e) shows the gain is based on the actual amount received (assuming the seller's Basis is less than the amount received).  See Example #1.
<a rel="nofollow" target="_blank" href="https://www.law.cornell.edu/cfr/text/26/1.1001-1#e">https://www.law.cornell.edu/cfr/text/26/1.1001-1...>

For the buyer, his Basis is USUALLY the actual amount paid, but that can get a bit wonky, depending on the circumstances.  See §1.1015-4.
<a rel="nofollow" target="_blank" href="https://www.law.cornell.edu/cfr/text/26/1.1015-4">https://www.law.cornell.edu/cfr/text/26/1.1015-4</...>

Does that help?  If not, please respond with any followup questions.