IPythEvents.sol 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. // SPDX-License-Identifier: Apache-2.0
  2. pragma solidity ^0.8.0;
  3. /// @title IPythEvents contains the events that Pyth contract emits.
  4. /// @dev This interface can be used for listening to the updates for off-chain and testing purposes.
  5. interface IPythEvents {
  6. /// @dev Emitted when the price feed with `id` has received a fresh update.
  7. /// @param id The Pyth Price Feed ID.
  8. /// @param publishTime Publish time of the given price update.
  9. /// @param price Price of the given price update.
  10. /// @param conf Confidence interval of the given price update.
  11. event PriceFeedUpdate(
  12. bytes32 indexed id,
  13. uint64 publishTime,
  14. int64 price,
  15. uint64 conf
  16. );
  17. /// @dev Emitted when the TWAP price feed with `id` has received a fresh update.
  18. /// @param id The Pyth Price Feed ID.
  19. /// @param startTime Start time of the TWAP.
  20. /// @param endTime End time of the TWAP.
  21. /// @param twapPrice Price of the TWAP.
  22. /// @param twapConf Confidence interval of the TWAP.
  23. /// @param downSlotsRatio Down slot ratio of the TWAP.
  24. event TwapPriceFeedUpdate(
  25. bytes32 indexed id,
  26. uint64 startTime,
  27. uint64 endTime,
  28. int64 twapPrice,
  29. uint64 twapConf,
  30. uint32 downSlotsRatio
  31. );
  32. }