Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: [xgap] check balance before placing orders #1484

Merged
merged 1 commit into from Jan 6, 2024

Conversation

narumiruna
Copy link
Collaborator

No description provided.

@narumiruna narumiruna requested a review from c9s January 6, 2024 14:42
@bbgokarma-bot
Copy link

Welcome back! @narumiruna, This pull request may get 220 BBG.

Copy link

codecov bot commented Jan 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9dd4de0) 21.22% compared to head (36aadf7) 21.22%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1484   +/-   ##
=======================================
  Coverage   21.22%   21.22%           
=======================================
  Files         598      598           
  Lines       44130    44130           
=======================================
  Hits         9368     9368           
  Misses      34085    34085           
  Partials      677      677           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9dd4de0...36aadf7. Read the comment docs.

@bbgokarma-bot
Copy link

Re-estimated karma: this pull request may get 236 BBG

if quoteBalance.Available.Div(price).Compare(minQuantity) < 0 {
log.Infof("quote balance: %s is not enough, skip", quoteBalance.Available.String())
return
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use types.Market.IsDustQuantity method for this

@narumiruna narumiruna merged commit b7a397b into main Jan 6, 2024
4 checks passed
@narumiruna narumiruna deleted the narumi/xgap/check-balance branch January 6, 2024 16:26
@bbgokarma-bot
Copy link

Hi @narumiruna,

Well done! 251 BBG has been sent to your polygon wallet. Please check the following tx:

https://polygonscan.com/tx/0x9cb71bc663298dddb4eed31b1d9991e17a0c4048785bac31365e184ea05dd484

Thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants