Skip to content

Conversation

@UjmaIT
Copy link

@UjmaIT UjmaIT commented Apr 14, 2025

Still in work

Summary

  • Added leverage support for different directions
  • Added wallet coin balance handling

Additional Information

Currently still testing this.
Creating PR for now to know if my code makes sense for you or if we each should go own directions with this.

PR Checklist

As part of the PR, make sure you have:

  • No breaking changes / documented all breaking changes clearly.
  • Updated & checked that all tests pass.
  • Updated the endpoint map (optional, if you know how).
  • Increased the version number in the package.json
  • Checked npm install runs without issue.
  • Included the package-lock.json, if it changed after npm install
  • Checked npm run build runs without issue.

@UjmaIT
Copy link
Author

UjmaIT commented Apr 14, 2025

What do you think about the leverage handling. Regarding the balance handling I think i will go for custom solution in my usecase

Copy link
Member

@tiagosiebler tiagosiebler left a comment

Choose a reason for hiding this comment

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

It's well thought out, makes a lot of sense to me. Only nitpicky question is about silently swallowing the error in the dump state (and what kind of error you saw here). I'd prefer you logged it. If rogue lib-driven console logs are a concern, could add a config to that fn that allows you to either disable the log and/or throw it

// Handle in a way that doesn't require console
return stateString;
} catch (error) {
// Silently handle errors
Copy link
Member

Choose a reason for hiding this comment

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

Were you seeing exceptions here? Why not log the error?

Comment on lines 256 to 258
setSymbolLeverage(symbol: string, leverage: number): void {
this.accountLeverageState[symbol] = leverage;
this.accountLeverageState[symbol] = { buy: leverage, sell: leverage };
}
Copy link
Member

Choose a reason for hiding this comment

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

Good that you kept the symbol leverage setter without a side - less friction for upgrading to this

@tiagosiebler tiagosiebler marked this pull request as draft June 2, 2025 08:49
@tiagosiebler tiagosiebler added the WIP Not finished label Jul 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WIP Not finished

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants