-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create liquidity_provider_interface.py
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
blockchain_integration/pi_network/pinnacle/src/interface/liquidity_provider_interface.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from abc import ABC, abstractmethod | ||
from typing import List | ||
|
||
class LiquidityProviderInterface(ABC): | ||
@abstractmethod | ||
def get_liquidity(self, token: str) -> float: | ||
"""Get the available liquidity for a given token""" | ||
pass | ||
|
||
@abstractmethod | ||
def place_order(self, token: str, amount: float, price: float) -> str: | ||
"""Place an order on the liquidity provider""" | ||
pass | ||
|
||
@abstractmethod | ||
def cancel_order(self, order_id: str) -> bool: | ||
"""Cancel an order on the liquidity provider""" | ||
pass | ||
|
||
@abstractmethod | ||
def get_order_book(self, token: str) -> List[dict]: | ||
"""Get the order book for a given token""" | ||
pass | ||
|
||
@abstractmethod | ||
def get_trading_pairs(self) -> List[str]: | ||
"""Get the list of available trading pairs""" | ||
pass |