diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/calculator/TradeInputCalculator.kt b/src/commonMain/kotlin/exchange.dydx.abacus/calculator/TradeInputCalculator.kt index 304ac8a62..ef91206d4 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/calculator/TradeInputCalculator.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/calculator/TradeInputCalculator.kt @@ -1138,6 +1138,7 @@ internal class TradeInputCalculator( ): Map? { fields?.let { fields -> val options = mutableMapOf( + "needsMarginMode" to false, "needsSize" to false, "needsLeverage" to false, "needsTargetLeverage" to false, @@ -1188,6 +1189,10 @@ internal class TradeInputCalculator( "marginModeOptions", parser.asNativeList(field["options"]), ) + options.safeSet( + parser.asNativeList(field["options"]), + true, + ) } "reduceOnly" -> { diff --git a/src/commonTest/kotlin/exchange.dydx.abacus/payload/v4/V4ParentSubaccountTests.kt b/src/commonTest/kotlin/exchange.dydx.abacus/payload/v4/V4ParentSubaccountTests.kt index 34cf1e247..7ed847848 100644 --- a/src/commonTest/kotlin/exchange.dydx.abacus/payload/v4/V4ParentSubaccountTests.kt +++ b/src/commonTest/kotlin/exchange.dydx.abacus/payload/v4/V4ParentSubaccountTests.kt @@ -280,7 +280,6 @@ class V4ParentSubaccountTests : V4BaseTests(true) { "current": "trade", "trade": { "marginMode": "ISOLATED", - "targetLeverage": 1.0 "targetLeverage": 1.0, "options": { "needsMarginMode": true @@ -300,7 +299,6 @@ class V4ParentSubaccountTests : V4BaseTests(true) { "input": { "current": "trade", "trade": { - "marginMode": "CROSS" "marginMode": "CROSS", "options": { "needsMarginMode": true @@ -320,7 +318,6 @@ class V4ParentSubaccountTests : V4BaseTests(true) { "input": { "current": "trade", "trade": { - "marginMode": "ISOLATED" "marginMode": "ISOLATED", "options": { "needsMarginMode": true @@ -340,7 +337,6 @@ class V4ParentSubaccountTests : V4BaseTests(true) { "input": { "current": "trade", "trade": { - "marginMode": "CROSS" "marginMode": "CROSS", "options": { "needsMarginMode": true @@ -360,7 +356,6 @@ class V4ParentSubaccountTests : V4BaseTests(true) { "input": { "current": "trade", "trade": { - "marginMode": "ISOLATED" "marginMode": "ISOLATED", "options": { "needsMarginMode": true @@ -380,7 +375,6 @@ class V4ParentSubaccountTests : V4BaseTests(true) { "input": { "current": "trade", "trade": { - "marginMode": "CROSS" "marginMode": "CROSS", "options": { "needsMarginMode": true