Order Settlement

Oracles and Keepers

  • Network Overview: Pyth specializes in aggregating real-time price data from nodes and global trading venues, delivering it on-chain for decentralized applications.

  • Role of Keepers: These are externally operated scripts (available for setup via Github) that actively monitor and execute orders using prices from the Pyth Network. Enhanced security is ensured by integrating Chainlink price feeds where applicable.

Operational Mechanics

Market Orders

  • Execution Process: Upon a market order submission, a keeper is notified through an emitted event, prompting the retrieval of a real-time price from Pyth for the specified market. This price is then forwarded to the smart contracts for order execution.

Limit / Stop Orders

  • Order Management: These orders are recorded in the smart contracts with a notification sent to keepers. Keepers monitor Pyth's real-time prices and execute the order once the trigger price is met.

Liquidations

  • P/L Monitoring and Execution: Keepers continuously assess the profit and loss of open positions against the liquidation threshold of the market. Positions falling below this threshold are liquidated, with the P/L verification performed on-chain.

Security and Pricing

Price Data Sourcing

  • Diverse and Reliable Sources: Pyth ensures high-quality data by sourcing from leading entities within each market segment, such as top-tier spot exchanges for crypto and premier banks for forex, enhancing data reliability and performance.

Keeper Incentivization

  • Compensation for Operation Costs: Keepers are reimbursed for transaction gas costs, receiving a 5% commission from the fees of orders they execute, incentivizing efficient and timely order processing.

Security Measures Against Front-Running

  • On-Demand Pricing: The mechanism of pricing orders after submission by keepers inherently protects against front-running, ensuring fair and secure order execution.

  • Enhanced Order Execution: For markets with Chainlink support, orders can utilize Chainlink directly after a specified cooldown, with Pyth prices being anchored on-chain within a predefined deviation range, further solidifying execution reliability.

Last updated