Commit 775e022
authored
feat: integrate external price feeds (Pyth Network) for automated mar… (#374)
* feat: integrate external price feeds (Pyth Network) for automated market resolution
- Add Pyth Network SDK dependency to workspace and contract
- Implement price feed adapter with oracle configuration management
- Add price condition system for automated resolution rules
- Integrate price-based pool resolution with timestamp validation
- Add comprehensive role-based access control for oracle operations
- Implement batch price feed updates and cleanup functionality
- Add detailed events for oracle operations and price resolution
- Create comprehensive test suite for price feed functionality
- Ensure proper code formatting and all tests passing
Features:
- Oracle initialization with configurable parameters
- Price feed updates with validation and freshness checks
- Price condition setting (equal, greater than, less than operators)
- Automated market resolution based on price conditions
- Support for tolerance-based price matching
- Batch operations for efficiency
- Comprehensive error handling and validation
* fix: resolve clippy warning for manual Option::map implementation
- Simplified get_oracle_config method to use direct return instead of manual Option mapping
- Resolves clippy::manual_map warning
- Maintains same functionality while improving code quality1 parent 50eaeef commit 775e022
File tree
7 files changed
+1099
-7
lines changed- contract
- contracts/predifi-contract
- src
7 files changed
+1099
-7
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
64 | 74 | | |
65 | 75 | | |
66 | 76 | | |
| |||
414 | 424 | | |
415 | 425 | | |
416 | 426 | | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
417 | 467 | | |
418 | 468 | | |
419 | 469 | | |
| |||
1680 | 1730 | | |
1681 | 1731 | | |
1682 | 1732 | | |
1683 | | - | |
| 1733 | + | |
1684 | 1734 | | |
1685 | 1735 | | |
1686 | 1736 | | |
1687 | | - | |
| 1737 | + | |
1688 | 1738 | | |
1689 | 1739 | | |
1690 | 1740 | | |
| |||
1709 | 1759 | | |
1710 | 1760 | | |
1711 | 1761 | | |
1712 | | - | |
| 1762 | + | |
1713 | 1763 | | |
1714 | 1764 | | |
1715 | 1765 | | |
| |||
1719 | 1769 | | |
1720 | 1770 | | |
1721 | 1771 | | |
1722 | | - | |
| 1772 | + | |
1723 | 1773 | | |
1724 | 1774 | | |
1725 | 1775 | | |
| |||
1728 | 1778 | | |
1729 | 1779 | | |
1730 | 1780 | | |
1731 | | - | |
| 1781 | + | |
1732 | 1782 | | |
1733 | 1783 | | |
1734 | | - | |
| 1784 | + | |
1735 | 1785 | | |
1736 | 1786 | | |
1737 | 1787 | | |
| |||
0 commit comments