They're usually used by mining companies to hedge future market variance, and are not exclusive to Tesla either. On top of other companies having these contracts in place as well, mining companies will pay to break these contracts if a high enough bidder comes along or flat out pays them to break it.
With demand pricing spiking for batteries, these lock ins are not very strong.