MuchFi
TradingPerpetuals

Self-Trade Prevention

Mechanism preventing accidental self-trading

Self-Trade Prevention

MuchFi implements automatic self-trade prevention to protect traders from accidentally trading against their own orders.

How It Works

To prevent self-trading, if a taker order matches against an order from the same address, the resting order is canceled. No fill occurs.

Mechanism Details

The system automatically detects when:

  1. A new (taker) order would match with an existing (maker) order
  2. Both orders originate from the same wallet address

When detected:

  • The existing resting order is automatically canceled
  • The new order proceeds to match against other orders
  • No trade is executed between the same trader's orders

Purpose

Self-trade prevention serves several functions:

Prevents Wash Trading

Stops traders from artificially inflating volume by trading with themselves.

Protects Traders

Prevents accidental execution where a trader might inadvertently match their own order.

Maintains Market Integrity

Ensures all executed trades represent genuine exchange of assets between distinct parties.

Implementation

The prevention mechanism operates at the matching engine level:

  • Checks are performed before any fill execution
  • Order cancellation happens automatically
  • No manual intervention required
  • Zero gas cost for the canceled order