Skip to main content

Overview

The Domination Finance perpetual exchange uses a series of off-chain services or "bots" to execute orders and monitor positions for liquidation. This approach is similar to other perpetual exchanges that perform their order matching or execution off-chain.

Traders create orders on-chain by transacting with the OrderBook contract. As soon as these transactions are mined and publicly available, we start monitoring the resulting order's trigger condition (price or position PnL).

Once a position has been opened in the DomFiPerp contract, we immediately begin monitoring the position's PnL percent to ensure that losses do not exceed the exchange's liquidation threshold. Note that this PnL includes the cost of funding.

Performance Conditions

The order and position liquidation bot use WebSocket events from our RPC provider to be immediately notified of new blocks with relevant events that will trigger update cycles. This avoids any additional latency, typically hundreds of milliseconds to a few seconds, that would be incurred with a polling architecture. On L2s like Arbitrum with low block times, such latency can be significant.

Both order and position bots batches their on-chain actions, limited by the network's block size.

In practice, we've seen the update cycle (excluding time to publish on-chain) perform within <1 second.