Defx Docs
Go to WebsiteTrade on Defx
  • About Defx
  • Defx Platform Overview
    • Self-Custodial
    • Central-Limit Order Book (CLOB)
    • APIs & Webhooks
  • Defx Product Docs
    • Orders
    • Margin
    • Liquidation
    • Insurance Fund
    • Auto-Deleveraging
    • Just-in-Time (JIT) Funding
    • Self Trade Prevention
    • Price Oracle
    • Fees
    • Multi-Asset Mode
      • Collateralization & Liquidation Ratios
      • Liquidation in Multi-Asset Mode
    • Glossary
  • Defx Smart Contracts
  • Contract Specifications
  • Defx Developer Hub
    • REST APIs Documentation
      • REST API Postman Collection
    • WebSocket Documentation
      • User Data Streams (Closed Socket)
      • MarketFeed Streams (Open Socket)
  • Referrals
  • Points
  • Using our Testnet
  • Audits
  • Risks
  • Restricted Territories
  • Terms & Conditions
  • Features
    • Trade Smarter: How Defx's Multi-Asset Collateral System Transforms Crypto Trading
    • sUSDe support
Powered by GitBook
On this page
  1. Defx Product Docs

Self Trade Prevention

PreviousJust-in-Time (JIT) FundingNextPrice Oracle

Last updated 4 months ago

Defx's self trade prevention mechanism prevents traders from matching their own orders on the order book, thereby ensuring that trading activities reflect genuine market interest rather than manipulated volumes.

There are three possible actions that Defx can take if an order could create a self-trade

EXPIRE_TAKER - This mode prevents a trade by immediately expiring the taker order's quantity.

EXPIRE_MAKER - This mode prevents a trade by immediately expiring the potential maker order's quantity.

EXPIRE_BOTH - This mode prevents a trade by immediately expiring both the taker and the potential maker orders' quantities.

The STP event will occur depending on the STP mode of the taker order.

Please note: These parameters are passed as part of the . While making a Create Order request, if you do not explicitly pass a value for stp as part of the request being made, Defx assigns a default stp mode to be EXPIRE_TAKER

Create Order API
Page cover image