I don't understand the logic in the other answer, and I think it doesn't make sense, so here is my take:
You pay taxes on income, not on sales price. So if you put X $ of your own money in the account and it becomes X + Y $ in the future, at the moment of liquidation, you will own taxes on the Y $. Never on the X $, as it was your own (already taxed) money to begin with. The difference between long-term and short-term gains just influences the tax rate on Y.
If you donate the gain alone (the Y $) to charity, you can deduct Y from your tax base. So adding Y to your tax base and then deducting Y again obviously leaves your tax base at the old value, so you pay no extra taxes. Which seems logical, as you didn't make any money in the process.
Aside from extreme cases where the deductible gain is too large a percentage from your income or negative, I don't see why this would ever be different.
So you can take your original 100 $ back out and donate all gains, and be fine.
Note that potential losses are seen different, as the IRA regulations are not symmetric.