Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
daneisburgh committed Jan 14, 2024
2 parents ea9ef37 + ac9c54e commit e540113
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
run: pip install -e ".[dev]"
- name: Run format check
run: black --diff --color --check .
- name: Run type check
run: mypy --install-types --non-interactive .
# - name: Run type check
# run: mypy --install-types --non-interactive .
- name: Create release
if: github.ref == 'refs/heads/main'
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.env
.ipynb_checkpoints/
*.egg-info
.mypy_cache
.venv/
.Trash-1000
__pycache__/
Expand Down
10 changes: 9 additions & 1 deletion invaas/coinbase/coinbase_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,15 @@ def __buy_product(self, product_id: str, available_cash: float):

def __sell_product(self, product_id: str, owned_crypto: float):
crypto_id = self.__get_crypto_id(product_id)
sell_amount = self.floor_value(value=owned_crypto, precision=8)

if product_id in ["BTC-USD", "ETH-USD"]:
precision = 8
elif product_id in ["DOT-USD", "SOL-USD"]:
precision = 3
elif product_id in ["ATOM-USD"]:
precision = 2

sell_amount = self.floor_value(value=owned_crypto, precision=precision)
self.logger.info(f"Sell amount: {sell_amount}")

if sell_amount == 0:
Expand Down

0 comments on commit e540113

Please sign in to comment.