If there are doubts as to whether the amount paid in the account of payments due from this party under the contract is a deposit (for example, in the course of an uncompleted written form), such amount is equivalent to an advance if there is no other evidence.
If the obligation is terminated before the beginning of its fulfillment with the consent of the parties or because of impossibility of performance, the deposit is subject to return. If the party that gave the specific deposit is responsible for non-fulfillment of the contract, then it remains with the other party. In a situation where the party that received the deposit is responsible for failure to perform the contract, it is its duty to pay the double amount of the deposit to the second party. In addition, the party responsible for non-fulfillment of the contract shall reimburse the losses to the second party, with the set-off of the deposit, unless otherwise provided by the contract.
If you take, for example, the types of transactions in Forex, then such concepts as "Deposit" and "Withholding" for obvious reasons will not work.
Grounds of retention. The creditor who possesses the thing to be transferred to either the debtor or the person indicated by the debtor has the right in the situation of the debtor failing to fulfill obligations to pay for this thing on time or to reimburse the costs to the creditor and other losses related to the thing in question, until the corresponding commitment is fulfilled.
Also, the retention of a thing is ensured by claims though not having a connection with the payment of this thing, or reimbursement of costs for this thing and other damages, but arising from obligations where the parties act as entrepreneurs. The creditor has the right to retain the thing that is available to it, despite the fact that upon receipt of the creditor's possession, a third person has acquired the right to it. The contract may provide otherwise. The lender's claim, which holds the thing in question, receives satisfaction from its value in the amount, the order that is provided to satisfy the claims secured by the pledge.