Changed TODO-mg to TODO-lev

This commit is contained in:
Sam Germain 2021-08-01 17:28:48 -06:00
parent d80db3c4db
commit 9c8acd98c4
2 changed files with 13 additions and 13 deletions

View File

@ -29,34 +29,34 @@ class LiqFormula(Enum):
raise OperationalException(f"{self.name} does not support {trading_mode.value} trading")
def __binance(self, trading_mode: TradingMode):
# TODO-mg: Additional arguments, fill in formulas
# TODO-lev: Additional arguments, fill in formulas
if trading_mode == TradingMode.CROSS_MARGIN:
# TODO-mg: perform a calculation based on this formula
# TODO-lev: perform a calculation based on this formula
# https://www.binance.com/en/support/faq/f6b010588e55413aa58b7d63ee0125ed
self.__exception(trading_mode)
elif trading_mode == TradingMode.ISOLATED_MARGIN:
self.__exception(trading_mode) # Likely won't be implemented
elif trading_mode == TradingMode.CROSS_FUTURES:
# TODO-mg: perform a calculation based on this formula
# TODO-lev: perform a calculation based on this formula
# https://www.binance.com/en/support/faq/b3c689c1f50a44cabb3a84e663b81d93
self.__exception(trading_mode)
elif trading_mode == TradingMode.ISOLATED_FUTURES:
# TODO-mg: perform a calculation based on this formula
# TODO-lev: perform a calculation based on this formula
# https://www.binance.com/en/support/faq/b3c689c1f50a44cabb3a84e663b81d93
self.__exception(trading_mode)
else:
self.__exception(trading_mode)
def __kraken(self, trading_mode: TradingMode):
# TODO-mg: Additional arguments, fill in formulas
# TODO-lev: Additional arguments, fill in formulas
if trading_mode == TradingMode.CROSS_MARGIN:
self.__exception(trading_mode)
# TODO-mg: perform a calculation based on this formula
# TODO-lev: perform a calculation based on this formula
# https://support.kraken.com/hc/en-us/articles/203325763-Margin-Call-Level-and-Margin-Liquidation-Level
elif trading_mode == TradingMode.CROSS_FUTURES:
# TODO-mg: implement
# TODO-lev: implement
self.__exception(trading_mode)
elif trading_mode == TradingMode.ISOLATED_MARGIN or \
trading_mode == TradingMode.ISOLATED_FUTURES:
@ -65,7 +65,7 @@ class LiqFormula(Enum):
self.__exception(trading_mode)
def __ftx(self, trading_mode: TradingMode):
# TODO-mg: Additional arguments, fill in formulas
# TODO-lev: Additional arguments, fill in formulas
self.__exception(trading_mode)
def __call__(self, **k):

View File

@ -14,7 +14,7 @@ def test_liquidation_formula():
assert LiqFormula.BINANCE(
trading_mode=spot
) is None
# TODO-mg: Uncomment these assertions and make them real calculation tests
# TODO-lev: Uncomment these assertions and make them real calculation tests
# assert LiqFormula.BINANCE(
# trading_mode=cross_margin
# ) == 1.0 #Replace 1.0 with real value
@ -31,26 +31,26 @@ def test_liquidation_formula():
assert LiqFormula.KRAKEN(
trading_mode=spot
) is None
# TODO-mg: Uncomment these assertions and make them real calculation tests
# TODO-lev: Uncomment these assertions and make them real calculation tests
# assert LiqFormula.KRAKEN(
# trading_mode=cross_margin
# ) == 1.0
# LiqFormula.KRAKEN(
# trading_mode=isolated_margin
# )
# asset exception thrown #TODO-mg: Check that exception is thrown
# asset exception thrown #TODO-lev: Check that exception is thrown
# assert LiqFormula.KRAKEN(
# trading_mode=cross_futures
# ) == 1.0
# LiqFormula.KRAKEN(
# trading_mode=isolated_futures
# )
# asset exception thrown #TODO-mg: Check that exception is thrown
# asset exception thrown #TODO-lev: Check that exception is thrown
assert LiqFormula.FTX(
trading_mode=spot
) is None
# TODO-mg: Uncomment these assertions and make them real calculation tests
# TODO-lev: Uncomment these assertions and make them real calculation tests
# assert LiqFormula.FTX(
# trading_mode=cross_margin
# ) == 1.0