Currently, Lexer utilizes an on-demand Decentralized Oracle Network (DON) from Chainlink to gather spot pricing data from prominent exchanges. It calculates the median value, removes outliers, combines the data into a single reliable price feed, and submits it to the blockchain for transaction execution.
Additionally, a keeper mechanism ensures the price feed's stability and reliability. The keeper node continuously compares the DON price feed to the Chainlink oracle price. If the price data for a trading pair deviates from the Chainlink price by more than a specified threshold, the keeper submits both prices to the blockchain, and both are used for transaction execution.
For instance, with ETH/USD, the deviation threshold would be 0.05%. If the DON price is $1000 and the Chainlink price is $1010, both prices are sent to the blockchain. When opening a long position, the higher price is used, while the lower price is used when closing. For short positions, the lower price is used when opening, and the higher price is used when closing.
The Lexer v2 oracle system will be powered by the Pyth Network. This oracle provides Lexer traders with real-time price information, lower trading costs, and enhanced price data integrity, leading to a more efficient and profitable trading experience.
Benefits of Pyth Network Oracles:
Low-to-zero latency: Pyth Network uses a pull model to update prices, which means that prices are updated on-chain as soon as they are available on Pythnet. This results in nearly zero latency, which is critical for Lexer security.
Improved accuracy: Pyth Network aggregates price feeds from over 90 trusted parties, ensuring that prices are accurate and reliable.
Decentralized control: Pyth Network is a decentralized oracle system, which means that it is not controlled by any single entity. This reduces the risk of price manipulation.
Lower maintenance costs: Pyth Network's pull model is more gas-efficient than traditional push models, which results in lower maintenance costs for Lexer's users.
More price feeds: Pyth Network supports thousands of price feeds, which will allow Lexer to offer a wider range of markets to our traders.