This is the method used by derivative counterparties to protect each other from default.
Let’s say that two parties agree to a spread bet whereby one bets on the FTSE 100 rising and the other on it falling. Each one might be required to lodge a deposit with a clearing house of say 10% of the total value of the trade. This is sometimes called initial margin. Each day that the trade remains open either party can be required to supplement this if the FTSE 100 subsequently moves against them. Margin is usually refunded, plus interest, once a trade is successfully closed.