🔮
Price Oracle
Lexer uses a on-demand Decentralised oracle network(DON) to fetch for spot pricing data of leading exchanges, taking the median and eliminating outliers, aggregate it into a single trust-worthy price data and submitting onto the blockchain for price execution.
There is also a keeper mechanics to keep the stablility and credibility of the price feed, the keeper node will constantly compare the price fed from the DON to the Chainlink oracle price, if the price data of a trading pair deviates form the Chainlink price over a certain threshold, the keeper will submit both prices onto the blockchain and both would be used for price execution.
For example for ETH/USD, the deviation threshold would be 0.05%, if the price data comes out at $1000 and the Chainlink price at $1010, both prices will be sent to the blockchain. When opening a long position, the higher price is used and when closing the lower price is used, for short positions, the lower price is used when opening and the higher price is used for closing.