Skip to content
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

Merged
merged 96 commits into from
Aug 27, 2024
Merged

Conversation

ruixhuang
Copy link
Contributor

Updating Adjust Isolated Margin Input related classes
Adding fixing from PR.
Tested on Android and guarded by feature flag.

ruixhuang and others added 30 commits August 1, 2024 14:11
# 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
…4-abacus into feature/markets_4"

This reverts commit 60d8eb6, reversing
changes made to d52adce.
mobile-build-bot and others added 19 commits August 22, 2024 05:58
# 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
Copy link

linear bot commented Aug 26, 2024

@ruixhuang ruixhuang marked this pull request as ready for review August 26, 2024 19:53
moo-onthelawn
moo-onthelawn previously approved these changes Aug 26, 2024
market = data.market,
type = data.type ?: IsolatedMarginAdjustmentType.Add,
amount = parser.asString(data.amount),
amountPercent = parser.asString(data.amountPercent),
Copy link
Contributor

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?

Copy link
Contributor Author

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,
Copy link
Contributor

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

Copy link
Contributor Author

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.

Base automatically changed from feature/trade_6 to main August 27, 2024 06:22
@ruixhuang ruixhuang dismissed moo-onthelawn’s stale review August 27, 2024 06:22

The base branch was changed.

ruixhuang and others added 2 commits August 27, 2024 14:24
# 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
@ruixhuang ruixhuang merged commit 5ef7c06 into main Aug 27, 2024
4 checks passed
@ruixhuang ruixhuang deleted the feature/trade_7 branch August 27, 2024 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants