You created a tax event and paid taxes on it and you got a loan for x% of $100.
If you sell the stock at $80 you'd pay no taxes on the appreciation (-$20). No credits, investing is risky.