diff --git a/build.gradle.kts b/build.gradle.kts index 62c30c1ae..dd127b8bb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -52,7 +52,7 @@ allprojects { } group = "exchange.dydx.abacus" -version = "1.12.13" +version = "1.12.14" repositories { google() diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/output/input/TradeInput.kt b/src/commonMain/kotlin/exchange.dydx.abacus/output/input/TradeInput.kt index dbad270dc..5dc8dff60 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/output/input/TradeInput.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/output/input/TradeInput.kt @@ -767,6 +767,14 @@ enum class OrderType(val rawValue: String) { operator fun invoke(rawValue: String?) = entries.firstOrNull { it.rawValue == rawValue } } + + val isSlTp: Boolean + get() = listOf( + StopMarket, + TakeProfitMarket, + StopLimit, + TakeProfitLimit, + ).contains(this) } @JsExport diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/validator/trade/TradeAccountStateValidator.kt b/src/commonMain/kotlin/exchange.dydx.abacus/validator/trade/TradeAccountStateValidator.kt index 9c89ef2d1..86340fdba 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/validator/trade/TradeAccountStateValidator.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/validator/trade/TradeAccountStateValidator.kt @@ -290,6 +290,9 @@ internal class TradeAccountStateValidator( return false } val type = trade.type ?: return false + // does not apply to trigger/stop trades + if (type.isSlTp) return false + val price = if (type == OrderType.Market) { trade.marketOrder?.worstPrice } else { @@ -347,6 +350,7 @@ internal class TradeAccountStateValidator( ): Boolean { if (orders != null) { val type = parser.asString(trade["type"]) ?: return false + if (listOf("STOP_MARKET", "TAKE_PROFIT_MARKET", "STOP_LIMIT", "TAKE_PROFIT").contains(type)) return false val price = parser.asDouble( parser.value( trade, diff --git a/v4_abacus.podspec b/v4_abacus.podspec index ea8c72523..517e07c0b 100644 --- a/v4_abacus.podspec +++ b/v4_abacus.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'v4_abacus' - spec.version = '1.12.13' + spec.version = '1.12.14' spec.homepage = 'https://github.com/dydxprotocol/v4-abacus' spec.source = { :http=> ''} spec.authors = ''