Generally there are no security deposits with RTO because those must be refundable. Instead, there is an initial option payment, which technically is not required to be refundable. So if the tenant walks, the option payments are all yours, providing this is stipulated in your contracts.
However many banks and CMHC require that option payments are partially refundable if the tenant buyer tries to buy the property and is unable to get financing. They may not even process the application until the option agreement is amended as such.
Unfortunately there is no set rule as to how much must be refundable. CMHC just requires a "reasonable" amount, so I write that 20% of the initial option payment is refundable. The monthly credits are not refundable at all. Some banks will require that the full option is refundable, but you can accomplish this with an amendment when the tenant buyer is purchasing the property.