Cooldown Mechanism

CooldownManager enforces an anti-fraud cooldown for C2C trades. Its core purpose is to prevent malicious participants from withdrawing their deposit and disappearing right after completing a C2C trade—a buyer's deposit must wait 24 hours after their last active trade ends before it can be withdrawn.

Scope

CooldownManager applies specifically to the C2C buyer deposit. It does not affect marketplace listing or ordering flows:

Cooldown State Logic

Trade in progress → active trade count > 0 → cannot withdraw deposit
Last trade ends → cooldown starts (24h)
After 24h → deposit can be withdrawn
  1. When a C2C trade is created, CooldownManager.activeTradeCount[user] is incremented by 1
  2. When a trade completes or is cancelled, activeTradeCount[user] is decremented by 1
  3. When activeTradeCount drops to 0, cooldownStart records the current time
  4. Only after cooldownStart + 24h has elapsed does canWithdraw() return true

Withdrawal Conditions (canWithdraw)

A buyer must satisfy all of the following conditions simultaneously to withdraw the deposit:

Deposit Disposition

When a buyer defaults in a C2C trade (loses arbitration), the deposit is disposed of according to the ruling. The disposition amount is not decided manually—it is computed by C2CTradeTemplate using a fixed formula: the deposit first covers the shortfall of the 10% arbitration fee, and any remainder is force-refunded to the buyer.

Platform Admin Authority Boundaries

Every exit path for the deposit is constrained by contract-level authorization. The platform (owner/admin) cannot autonomously penalize, withhold, or transfer this deposit:

In other words, the decision of "compensate the seller or penalize" rests with the on-chain arbitration result and the cooldown rules, not the platform. The platform can neither autonomously penalize nor autonomously withhold the buyer's deposit.

Merchant Deposit Withdrawal Cooldown (Separate Mechanism)

The withdrawal cooldown for merchant deposits is managed by DepositFactory (distinct from CooldownManager) and requires:

Key Parameters

Parameter Value Source
C2C buyer deposit cooldown 24 hours CooldownManager.COOLDOWN_PERIOD
Merchant deposit unlock cooldown 24 hours DepositFactory.UNLOCK_COOLDOWN_PERIOD