When you buying an AC off the lease

when you have a plane on lease and insted of tearmating the lease you can buy it. So when you do buy the plane do you get the depsit back or does that go towards the purchase of the ac that ur getting thanks:)

You get it back, but I’m not sure if this happens after paying the aircraft.