Skip to content

Commit 502f073

Browse files
committed
feat: implement IOracleProvider interface for architectural consistency
1 parent 15eeac8 commit 502f073

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

demo_automated_vault.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import statistics
1111
import logging
1212
import json
13+
from abc import ABC, abstractmethod
1314
from pathlib import Path
1415
import pandas as pd
1516
from decimal import Decimal, getcontext
@@ -25,6 +26,7 @@
2526

2627
__version__ = "0.1.0-gsoc2026"
2728
__all__ = [
29+
"IOracleProvider",
2830
"auto_pilot_mode",
2931
"VaultConfig",
3032
"CircuitBreaker",
@@ -46,6 +48,23 @@
4648
)
4749
logger = logging.getLogger(__name__)
4850

51+
# ==========================================
52+
# ARCHITECTURAL INTERFACES (GSoC 2026 Strategy)
53+
# ==========================================
54+
class IOracleProvider(ABC):
55+
"""
56+
Abstract Base Class for all price providers.
57+
"""
58+
@abstractmethod
59+
async def fetch_price(self) -> Decimal:
60+
"""Fetches the current ticker price, returning a strict Decimal."""
61+
pass
62+
63+
@abstractmethod
64+
async def is_healthy(self) -> bool:
65+
"""Checks if the exchange API is responsive within the timeout."""
66+
pass
67+
4968
@dataclass(frozen=True)
5069
class VaultConfig:
5170
mock_mode: bool

0 commit comments

Comments
 (0)