From 10096801656dc294805b5cb11f0c5063b11d69dd Mon Sep 17 00:00:00 2001 From: Dane Isburgh Date: Sun, 4 Feb 2024 19:35:32 -0500 Subject: [PATCH] feat: update coinbase to use usdc wallet --- invaas/coinbase/coinbase_task.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/invaas/coinbase/coinbase_task.py b/invaas/coinbase/coinbase_task.py index c36141d..0266bbf 100644 --- a/invaas/coinbase/coinbase_task.py +++ b/invaas/coinbase/coinbase_task.py @@ -18,7 +18,7 @@ def __init__(self, env: str): self.cb_client = CoinbaseClient(self.get_secret("COINBASE-API-KEY"), self.get_secret("COINBASE-API-SECRET")) - self.product_ids = ["BTC-USD", "ETH-USD", "SOL-USD", "XRP-USD", "DOT-USD"] + self.product_ids = ["BTC-USDC", "ETH-USDC", "SOL-USDC", "XRP-USDC", "DOT-USDC"] self.logger.info(f"Products to trade: {str(self.product_ids)}") self.min_fear_greed_index_to_buy = 60 @@ -61,11 +61,11 @@ def __buy_product(self, product_id: str, available_cash: float): def __sell_product(self, product_id: str, owned_product: float): crypto_id = self.__get_crypto_id(product_id) - if product_id in ["BTC-USD", "ETH-USD"]: + if product_id in ["BTC-USDC", "ETH-USDC"]: precision = 6 - elif product_id in ["DOT-USD", "SOL-USD", "XRP-USD"]: + elif product_id in ["DOT-USDC", "SOL-USDC", "XRP-USDC"]: precision = 3 - elif product_id in ["ADA-USD", "ATOM-USD", "AVAX-USD", "LINK-USD"]: + elif product_id in ["ADA-USDC", "ATOM-USDC", "AVAX-USDC", "LINK-USDC"]: precision = 2 sell_amount = self.floor_value(value=owned_product, precision=precision) @@ -95,7 +95,7 @@ def create_orders(self): owned_product = self.__get_available_balance(f"{crypto_id} Wallet") self.logger.info(f"Owned {crypto_id}: {owned_product:.10f}") - available_cash = self.__get_available_balance("Cash (USD)") + available_cash = self.__get_available_balance("USDC Wallet") self.logger.info(f"Available cash: ${available_cash:.2f}") order_side = (