diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/StateManagerAdaptor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/StateManagerAdaptor.kt index 913b585cb..e4632e3cc 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/StateManagerAdaptor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/StateManagerAdaptor.kt @@ -101,7 +101,6 @@ import kotlin.time.Duration.Companion.seconds import kotlin.time.DurationUnit import kotlin.time.times import kotlin.time.toDuration -import exchange.dydx.abacus.utils.Logger @JsExport open class StateManagerAdaptor( @@ -1804,20 +1803,13 @@ open class StateManagerAdaptor( val postOnly = false val timeInForce = null; - // when (triggerOrder.type) { - // OrderType.stopMarket, OrderType.takeProfitMarket -> "IOC" - // OrderType.stopLimit, OrderType.takeProfitLimit -> "GTT" - // else -> throw Exception("invalid triggerOrderType") - // } val execution = when (triggerOrder.type) { OrderType.stopMarket, OrderType.takeProfitMarket -> "IOC" - OrderType.stopLimit, OrderType.takeProfitLimit -> "Default" + OrderType.stopLimit, OrderType.takeProfitLimit -> "DEFAULT" else -> throw Exception("invalid triggerOrderType") } - Logger.e { "xcxc error: ${type} ${execution}"} - val duration = GoodTil.duration(TradeInputGoodUntil(TRIGGER_ORDER_DEFAULT_DURATION_DAYS, "D")) ?: throw Exception("invalid duration") val goodTilTimeInSeconds = (duration / 1.seconds).toInt() val goodTilBlock = null @@ -1955,14 +1947,11 @@ open class StateManagerAdaptor( } val execution = if (trade.options?.executionOptions != null) { - trade.execution ?: "Default" + trade.execution ?: "DEFAULT" } else { null } - Logger.e { "xcxc ${timeInForce} ${execution}"} - - val goodTilTimeInSeconds = ( ( if (trade.options?.goodTilUnitOptions != null) { @@ -2031,7 +2020,7 @@ open class StateManagerAdaptor( val price = summary.payloadPrice ?: throw Exception("price is null") val size = summary.size ?: throw Exception("size is null") val timeInForce = "IOC" - val execution = "Default" + val execution = "DEFAULT" val reduceOnly = environment.featureFlags.reduceOnlySupported val postOnly = false val goodTilTimeInSeconds = null diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/SubaccountSupervisor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/SubaccountSupervisor.kt index fa4d2fdeb..e41f23f56 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/SubaccountSupervisor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/SubaccountSupervisor.kt @@ -71,7 +71,6 @@ import kotlinx.serialization.json.Json import kotlin.random.Random import kotlin.time.Duration.Companion.days import kotlin.time.Duration.Companion.seconds -import exchange.dydx.abacus.utils.Logger internal class SubaccountSupervisor( stateMachine: TradingStateMachine, @@ -842,16 +841,12 @@ internal class SubaccountSupervisor( null } - - val execution = if (trade.options?.executionOptions != null) { - trade.execution ?: "Default" + trade.execution ?: "DEFAULT" } else { null } - Logger.e { "xcxc ${timeInForce} ${execution}"} - val goodTilTimeInSeconds = ( ( if (trade.options?.goodTilUnitOptions != null) { @@ -910,20 +905,12 @@ internal class SubaccountSupervisor( val timeInForce = null; - // when (triggerOrder.type) { - // OrderType.stopMarket, OrderType.takeProfitMarket -> "IOC" - // OrderType.stopLimit, OrderType.takeProfitLimit -> "GTT" - // else -> throw Exception("invalid triggerOrderType") - // } - val execution = when (triggerOrder.type) { OrderType.stopMarket, OrderType.takeProfitMarket -> "IOC" - OrderType.stopLimit, OrderType.takeProfitLimit -> "Default" + OrderType.stopLimit, OrderType.takeProfitLimit -> "DEFAULT" else -> throw Exception("invalid triggerOrderType") } - Logger.e { "xcxc error: ${type} ${execution}"} - val duration = GoodTil.duration(TradeInputGoodUntil(TRIGGER_ORDER_DEFAULT_DURATION_DAYS, "D")) ?: throw Exception("invalid duration") val goodTilTimeInSeconds = (duration / 1.seconds).toInt() val goodTilBlock = null @@ -1004,7 +991,7 @@ internal class SubaccountSupervisor( } if (triggerOrders.stopLossOrder != null) { - updateTriggerOrder(triggerOrders.stopLossOrder) + updateTriggerOrder(triggerOrders.stopLossOrder) } if (triggerOrders.takeProfitOrder != null) { @@ -1024,7 +1011,7 @@ internal class SubaccountSupervisor( val price = summary.payloadPrice ?: throw Exception("price is null") val size = summary.size ?: throw Exception("size is null") val timeInForce = "IOC" - val execution = "Default" + val execution = "DEFAULT" val reduceOnly = helper.environment.featureFlags.reduceOnlySupported val postOnly = false val goodTilTimeInSeconds = null