Files
Hydra-Engine/hydra/exchange/base.py
2026-03-30 13:19:11 +09:00

23 lines
658 B
Python

from abc import ABC, abstractmethod
class BaseExchange(ABC):
@abstractmethod
async def get_balance(self) -> dict: ...
@abstractmethod
async def create_order(self, symbol: str, side: str, order_type: str, qty: float, price: float | None = None) -> dict: ...
@abstractmethod
async def cancel_order(self, order_id: str) -> dict: ...
@abstractmethod
async def cancel_all(self) -> list: ...
@abstractmethod
async def get_positions(self) -> list: ...
async def set_leverage(self, symbol: str, leverage: int) -> None:
"""레버리지 설정. 현물 거래소는 no-op (override 불필요)."""
pass