You are taxed on the gains, not on the total sale volume.
So if I buy something today for $5, and sell it tomorrow for $6, I pay the 37% on the $1 of gain.
So my takeaway is $5.63, not the $3.78 it would be I was taxed on the full sale.
It's also worth noting that capital losses can offset gains. So if I made $1000 on one trade, but lost $1000 on another, my effective tax is $0, because I didn't make any money.
This can get squishy though, as there are a lot of accounting loopholes you can do to count things as "losses" that are more losses on paper than actual losses.
Impossible Creatures was a masterpiece. I still go back to it every now and then.