You would have to trade in the Optima to Tesla rather than sell it. Tesla had not been known to offering very good trade-in values, so you may get less that you expect. Also Tesla does not finance vehicles they work with banks to offer financing.
I can't comment personally on credit scores and rates, since I have not bought mine yet (I'm waiting for the end of winter and an easing of COVID restrictions to actually have somewhere to go to). My understanding is that the rates are pretty much the same for everyone. If your credit is not the greatest (or if you don't have much of a credit file), you may be asked to provide a bigger down payment, but will still get the same rate. If you credit is bad enough, they may outright decline.
I think folks have been getting 2.15% on terms of 72 months or less, and 2.65% on 84 and 96 months based on posts earlier in this thread.