-
Notifications
You must be signed in to change notification settings - Fork 20
Feat: keep funding reserve on exchange #113
Feat: keep funding reserve on exchange #113
Conversation
hedgingBounds.MINIMUM_FUNDING_BALANCE_BTC, | ||
) | ||
} else { | ||
this.logger.error( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure to understand this.. if this.getFundingAccountBalance()
fail then we continue trying to withdraw?
also, I prefer the other style that you use for ok returns, something like line 584
if (!fundingAccountBalanceResult.ok) {
this.logger.error(
{ fundingAccountBalanceResult },
"getFundingAccountBalance() error: {fundingAccountBalanceResult}",
)
return { ... }
}
newTransferSizeInBtc = Math.max(
0,
fundingAccountBalanceResult.value.btcFreeBalance -
hedgingBounds.MINIMUM_FUNDING_BALANCE_BTC,
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah if it fails too bad or should it be an alert to get attention?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving but with some comments. Not sure if worth to do a lot of changes to code style if we will re-write the dealer
fundingAccountBalanceResult.value.btcFreeBalance - | ||
hedgingBounds.MINIMUM_FUNDING_BALANCE_BTC, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason to just not do a comparison? fundingAccountBalanceResult.value.btcFreeBalance > hedgingBounds.MINIMUM_FUNDING_BALANCE_BTC
this.logger.error( | ||
{ withdrawalResponse }, | ||
"rebalancing withdrawal was NOT successful", | ||
this.logger.debug( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same issue here with the else block.. code is cleaner using an early return
…/bootstrap-5.1.6 Bump @types/bootstrap from 4.6.1 to 5.1.6
No description provided.