-
Notifications
You must be signed in to change notification settings - Fork 15
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
v1.7.24: Add function to reclaim funds #334
v1.7.24: Add function to reclaim funds #334
Conversation
jaredvu
commented
May 1, 2024
•
edited
Loading
edited
- Function looks to loop through existing subaccounts to find funds w/o positions/orders. It then initiates a transfer back to the parent subaccount.
- Fix Subaccount initialization to provide correct subaccountNumber
Tests? |
src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/SubaccountSupervisor.kt
Show resolved
Hide resolved
src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/SubaccountSupervisor.kt
Outdated
Show resolved
Hide resolved
helper.ioImplementations.threading?.async(ThreadingType.main) { | ||
this.reclaimUnutilizedFundsTimer = helper.ioImplementations.timer?.schedule( | ||
(10.seconds).inWholeSeconds.toDouble(), | ||
null, |
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.
can we use this repeat
duration instead of recursively calling this function?
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.
Current recursive implementation waits for a successful callback reponse for each transfer and goes through the entire list of childSubaccounts
then creates a fresh 10 sec timer before repeating. I don't think I can achieve the same effect with repeat
.
src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/SubaccountSupervisor.kt
Outdated
Show resolved
Hide resolved
…from' of github.com:dydxprotocol/v4-abacus into jared/tra-238-add-function-to-reclaim-unutilized-funds-from