1. Hold Cryptocurrency for the Long-Term

If you hold a crypto investment for at least one year before selling, your gains qualify for the preferential long-term capital gains rate. Depending on your taxable income for the year, this can almost halve your tax rate, going from a maximum rate of 37% for short-term gains to a maximum rate of just 20% for long-term gains.

2. Offset Gains with Losses

As with any investment, you can take advantage of crypto gains by also claiming losses on other investments the year you realize your profit. That means if you made $10,000 for selling Bitcoin but lost $10,000 for selling Ethereum, you wouldn’t owe any tax since you broke even.

These losses aren’t limited to other forms of cryptocurrency, though. If you are about to cash in a large crypto investment, look through the rest of your portfolio to see if there are other losing investments you could sell to offset your gains. And if you end up losing substantially more than you gain in a year, you can deduct up to $3,000 in the excess losses against your personal income taxes as well as carry forward any unused losses to offset your future investment gains.

3. Time Sales with Your Tax Rate

If you have the luxury of time on your side, you can always try to wait out a lower tax rate, says Jeff Hoopes, an associate professor at the University of North Carolina and research director of the UNC Tax Center.

“Perhaps you got laid off, retired, went back to school or moved to a lower tax state. Then you might find yourself in a lower tax bracket, which would allow you to sell your crypto while owing less in taxes,” he says.

4. Claim Expenses for Mining

While it might seem like a low-cost activity in theory, mining crypto comes with considerable expenses, including computers, servers, electricity and internet service provider charges. If you are a crypto miner, you can deduct these costs against your mining income, though the amount you’ll be able to deduct will depend on whether you categorize your operation as a business or as a hobby.

5. Consider Investing Through a Retirement Plan

If you invest in crypto using a retirement plan like a traditional IRA or Roth IRA, you can defer or avoid investment gains entirely, though it’s not as easy as investing through a normal brokerage account.

“There are ways to get crypto into tax advantaged vehicles like an individual retirement account (IRA), but it is not that common and not that easy (although many expect it to get easier),” says Hoopes. Right now if you’d like to open a crypto or Bitcoin IRA, you’d need to open a specialty account called a self-directed IRA with boutique firms that offer crypto investing.

6. Donate to Charity

If you don’t need all of the profit from your crypto investment, you can decrease your tax burden by donating at least some of your crypto to charity. You’ll get a deduction worth the full value of your crypto, including any gains. But this generally only makes sense if you planned on donating to charity already.