Pricing Mechanism
The Candy protocol uses an oracle-based pricing mechanism. When a trade request is made, the Candy protocol invokes the Pyth oracle services to fetch the asset's price. This price is then cross-verified with Chainlink's price feeds. If the discrepancy between these two prices is within the maximum permissible error, the initial cost, referred to as the 'Market Price', is accepted.
Once the market price is established, a price fluctuation, known as the 'Spread', occurs based on the direction (long or short) the trader selects. The 'Open Price', or 'Entry Price', is then calculated using a specific formula.
Long Position Open Price = Ask Price + Spread
Short Position Open Price = Bid Price - Spread
While closing a position, the spread also exists and the ‘Close Price’ formulas are vice versa against the ‘Open Price’ formulas.
The spread of a specific pair is a constant number, and the market volatility of the underlying assets determines it.
Last updated