Skip to content

Commit

Permalink
Merge branch 'main' into feature/vault_1
Browse files Browse the repository at this point in the history
  • Loading branch information
ruixhuang committed Oct 2, 2024
2 parents b732262 + c5f9e67 commit 5e8c065
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ allprojects {
}

group = "exchange.dydx.abacus"
version = "1.12.13"
version = "1.12.14"

repositories {
google()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion v4_abacus.podspec
Original file line number Diff line number Diff line change
@@ -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 = ''
Expand Down

0 comments on commit 5e8c065

Please sign in to comment.