🔮Price Oracles
Our trustsource
DIP Exchange uses a combination of Chainlink Oracle and CEX prices.
Currently, GMX, GMX forks and Level Finance do not fully use Chainlink as the only price. Chainlink on DEX is generally used as a reference price. When closing a position, it is not executed according to the price of the Oracle in the contract, but is handled by a centralized program on the platform.
Theoretically, closing an order will be split into two steps:
Place a closing order first, but the closing profit is not calculated at this time. Only the closing order is recorded.
Closing an order is monitored by an additional centralized program. At the same time, the current closing price is posted to calculate the closing profit/loss.
GMX uses Chainlink and 3 mainstream CEXs to take the price as the Oracle price. The price of CEX and Chainlink cannot exceed a certain ratio.
For example, the price of a certain token in Chainlink is $100 and the price of CEX is $103. At this time, $100-$103 will be used as the token price. To open a long position, use the highest price of $103 as the opening price and the lowest price of $100 as the closing price when closing the position. The opening and closing are reversed.
The benefits of this are:
Prevent problems with Chainlink.
Prevent front-running, for example, the user has seen the CEX price before closing the position, and then preemptively traded before the Chainlink feeds the price. This mechanism protects liquidity providers funds against large arbitrage opportunities.
Last updated