-
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
TRCL-3636 Static Typing: Adjust Isolated Margin Input #602
Conversation
# Conflicts: # src/commonMain/kotlin/exchange.dydx.abacus/state/internalstate/InternalState.kt # src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine+Trades.kt
# Conflicts: # src/commonMain/kotlin/exchange.dydx.abacus/processor/markets/MarketProcessor.kt # src/commonMain/kotlin/exchange.dydx.abacus/processor/markets/MarketsProcessor.kt # src/commonMain/kotlin/exchange.dydx.abacus/processor/markets/MarketsSummaryProcessor.kt # src/commonTest/kotlin/exchange.dydx.abacus/processor/markets/MarketProcessorTests.kt # src/commonTest/kotlin/exchange.dydx.abacus/processor/markets/MarketsProcessorTests.kt # src/commonTest/kotlin/exchange.dydx.abacus/tests/mock/processor/markets/MarketProcessorMock.kt
… into feature/markets_4
This reverts commit d52adce.
…to feature/calc_1
# Conflicts: # build.gradle.kts # v4_abacus.podspec
# Conflicts: # src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine+ClosePositionInput.kt
# Conflicts: # build.gradle.kts # src/commonMain/kotlin/exchange.dydx.abacus/processor/input/ClosePositionInputProcessor.kt # src/commonMain/kotlin/exchange.dydx.abacus/state/internalstate/InternalState.kt # src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine.kt # v4_abacus.podspec
# Conflicts: # src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine+AdjustIsolatedMarginInput.kt
market = data.market, | ||
type = data.type ?: IsolatedMarginAdjustmentType.Add, | ||
amount = parser.asString(data.amount), | ||
amountPercent = parser.asString(data.amountPercent), |
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.
maybe a dumb question but why do we still need parser
here and the line below?
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.
Those fields are defined as string type in AdjustIsolatedMarginInput
, which is frontend-facing. It would be a breaking change if we change the data type.
positionLeverage = position?.calculated?.get(CalculationPeriod.current)?.leverage, | ||
positionLeverageUpdated = position?.calculated?.get(CalculationPeriod.post)?.leverage, | ||
liquidationPrice = position?.calculated?.get(CalculationPeriod.current)?.liquidationPrice, | ||
liquidationPriceUpdated = position?.calculated?.get(CalculationPeriod.post)?.liquidationPrice, |
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.
super nit, I wonder if this would be easier to read if we had postPosition
and currentPosition
variables
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 update in the future.... and then there are two calculated fields for subaccount and position, so it gets pretty confusing.
# Conflicts: # src/commonMain/kotlin/exchange.dydx.abacus/processor/input/ClosePositionInputProcessor.kt # src/commonMain/kotlin/exchange.dydx.abacus/state/internalstate/InternalState.kt # src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine.kt
Updating Adjust Isolated Margin Input related classes
Adding fixing from PR.
Tested on Android and guarded by feature flag.