Skip to content

Conversation

@btschwertfeger
Copy link
Owner

@btschwertfeger btschwertfeger commented Oct 27, 2025

The problem described in the issue is a hard one. The error must be on the side of Kraken, since the balance retrieved via REST API (without further processing) does not match with the expectations based on the vol_exec value, meaning that even if an order with a fixed volume like 0.01205356 is being executed, there is a chance that Kraken will only add 0.012053559999999998 to the accounts' balances (and yes, the fee was paid with the quote and not with base currency).

Meaning that we have the following alternatives:

  • Place the sell order in this situation with min(vol_exec, <available base balance>) - this is quite unsafe, since the case where the user might messed up with the volumes, e.g. by trading by hand, would lead to situations where actual errors with the balance would not be visible. Also it might be the case that then orders are created that are way too small in terms of volume.
  • Reduce the volume by the smallest possible amount (current proposed approach in this PR). This way we first check if the order would be successfully placed in with a reduced amount in case the available balance is smaller than the volume to be placed. And if not, we reduce the volume by the smallest possible amount. If the order can still not be placed, we exit with error, since then is something else wrong.

Closes #72

@btschwertfeger btschwertfeger added this to the Upcoming Release milestone Oct 27, 2025
@btschwertfeger btschwertfeger self-assigned this Oct 27, 2025
@btschwertfeger btschwertfeger added the bug Something isn't working label Oct 27, 2025
@codecov-commenter
Copy link

codecov-commenter commented Oct 27, 2025

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.70%. Comparing base (72e8f45) to head (4b46edb).

Files with missing lines Patch % Lines
src/infinity_grid/strategies/grid_sell.py 71.42% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #73      +/-   ##
==========================================
- Coverage   83.75%   83.70%   -0.05%     
==========================================
  Files          25       25              
  Lines        1674     1682       +8     
==========================================
+ Hits         1402     1408       +6     
- Misses        272      274       +2     
Flag Coverage Δ
unittests 83.70% <77.77%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/infinity_grid/models/exchange.py 98.59% <100.00%> (+0.02%) ⬆️
src/infinity_grid/strategies/grid_base.py 69.53% <ø> (ø)
src/infinity_grid/strategies/grid_hodl.py 90.90% <ø> (ø)
src/infinity_grid/strategies/grid_sell.py 90.76% <71.42%> (-2.34%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link

🚀 Deployment Status

Release Name: infinity-grid-pr-73
Namespace: infinity-grid
Docker Image: ghcr.io/btschwertfeger/infinity-grid:pr-73
Status: ✅ Successfully deployed

The infinity-grid application has been deployed to the Kubernetes cluster using the PR-specific Docker image.

Commands to check the deployment:

kubectl get pods -n infinity-grid -l app.kubernetes.io/instance=infinity-grid-pr-73
kubectl logs -n infinity-grid -l app.kubernetes.io/instance=infinity-grid-pr-73
kubectl describe deployment -n infinity-grid -l app.kubernetes.io/instance=infinity-grid-pr-73

The deployment will be automatically cleaned up when this PR is closed.

@github-actions
Copy link

🚀 Deployment Status

Release Name: infinity-grid-pr-73
Namespace: infinity-grid
Docker Image: ghcr.io/btschwertfeger/infinity-grid:pr-73
Status: ✅ Successfully deployed

The infinity-grid application has been deployed to the Kubernetes cluster using the PR-specific Docker image.

Commands to check the deployment:

kubectl get pods -n infinity-grid -l app.kubernetes.io/instance=infinity-grid-pr-73
kubectl logs -n infinity-grid -l app.kubernetes.io/instance=infinity-grid-pr-73
kubectl describe deployment -n infinity-grid -l app.kubernetes.io/instance=infinity-grid-pr-73

The deployment will be automatically cleaned up when this PR is closed.

@btschwertfeger btschwertfeger marked this pull request as ready for review October 28, 2025 14:10
@github-actions
Copy link

🚀 Deployment Status

Release Name: infinity-grid-pr-73
Namespace: infinity-grid
Docker Image: ghcr.io/btschwertfeger/infinity-grid:pr-73
Status: ✅ Successfully deployed

The infinity-grid application has been deployed to the Kubernetes cluster using the PR-specific Docker image.

Commands to check the deployment:

kubectl get pods -n infinity-grid -l app.kubernetes.io/instance=infinity-grid-pr-73
kubectl logs -n infinity-grid -l app.kubernetes.io/instance=infinity-grid-pr-73
kubectl describe deployment -n infinity-grid -l app.kubernetes.io/instance=infinity-grid-pr-73

The deployment will be automatically cleaned up when this PR is closed.

@github-actions
Copy link

🚀 Deployment Status

Release Name: infinity-grid-pr-73
Namespace: infinity-grid
Docker Image: ghcr.io/btschwertfeger/infinity-grid:pr-73
Status: ✅ Successfully deployed

The infinity-grid application has been deployed to the Kubernetes cluster using the PR-specific Docker image.

Commands to check the deployment:

kubectl get pods -n infinity-grid -l app.kubernetes.io/instance=infinity-grid-pr-73
kubectl logs -n infinity-grid -l app.kubernetes.io/instance=infinity-grid-pr-73
kubectl describe deployment -n infinity-grid -l app.kubernetes.io/instance=infinity-grid-pr-73

The deployment will be automatically cleaned up when this PR is closed.

@btschwertfeger btschwertfeger merged commit 962a9a7 into master Oct 30, 2025
58 of 60 checks passed
@btschwertfeger btschwertfeger deleted the 72-kraken-messes-with-vol_exec branch October 30, 2025 05:55
@github-actions
Copy link

🧹 Cleanup Complete

Release Name: infinity-grid-pr-73
PR Number: 73
Status: ✅ Successfully cleaned up

The following resources have been cleaned up:

  • ✅ Kubernetes deployment uninstalled
  • ✅ PR-specific Docker image cleanup attempted (ghcr.io/btschwertfeger/infinity-grid:pr-73)

The infrastructure for this PR has been fully cleaned up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kraken messes with vol_exec

3 participants