-
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
Feature/tra 327 isolated margin delta #409
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: mobile-build-bot-git <[email protected]> Co-authored-by: Rui <[email protected]>
…dxprotocol/v4-abacus into feature/TRA-327-isolated-margin-delta
ruixhuang
approved these changes
Jun 4, 2024
…dxprotocol/v4-abacus into feature/TRA-327-isolated-margin-delta
…dxprotocol/v4-abacus into feature/TRA-327-isolated-margin-delta
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Will add a brief description of the results for each file changed to aid in code review
AccountCalculator
mergeChildPendingPositions
outside ofif/else
conditional so that we are always attempting to process child pending positions. It was originally in the ternary because it was thought that there would be no need to mergependingPositions
if a regularposition
existed. Since Abacus adds a "dummy" position when in a market, ourpendingPositions
were getting lost.AccountTransformer
MarginModeCalculator
SubaccountTransformer
TradingStateMachine+AdjustIsolatedMargin
0
. Bug that I had introduced that killed the inputs if we cleared or set to 0.TradingStateMachine+Markets
TradingStateMachine+TradeInput
marginMode
when navigating markets. We want to ensureMarginMode
is never nulltargetLeverage
to it's default or the abs value of existingpositionLeverage
change
events to include childSubaccount if applicable (this is necessary for Web to receive the updates to the childSubaccount when inputs change)TradeInputFields
to thewhen
statement to determine when to update state.TradingStateMachine+Wallet
childSubaccountNumber
tochange
eventsAccountInputValidator
childSubaccountNumber
. This is pretty much never applicable to thechildSubaccount
because the transfer will have been sent before the order is placed. This validation error blocks the start of that place order flow.TradeStateValidator
parentSubaccount
vschildSubaccount
and make the delineation more clear.Testing Improvements ✨
IsolatedMarginTests
IsolatedMargin
flows. Tried to be as descriptive and informative as possible. It would be cool if we could update our test suite to allow commenting within the test flow i.e.describe('should not ....', () => testStuff)
V4BaseTests
open
toloadMarketsConfiguration
so that it can be overridable. It is usingv3 configs right now.
V4ParentSubaccountTests
/ParentSubaccountMocks
MarketConfigurationMock
/MarketsChannelMock
MarketsChannelMock
dataISO-USD
to test Isolated Markets (Before we had just updatedAVAX-USD
and I had no idea wtf was going on because I was unaware we just designatedAVAX
to that market type for testing)Notes
@johnqh is a godsend 👼 for catching the issues w/ all of the childSubaccount deltas ❤️ ❤️ ❤️