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

Add a max slippage of 0.5% for Maya and Thor #1427

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.vultisig.wallet.data.api.models.cosmos.CosmosTransactionBroadcastResp
import com.vultisig.wallet.data.api.models.cosmos.THORChainAccountResultJson
import com.vultisig.wallet.data.api.models.cosmos.THORChainAccountValue
import com.vultisig.wallet.data.chains.helpers.THORChainSwaps
import com.vultisig.wallet.data.chains.helpers.THORChainSwaps.Companion.TOLERANCE_BPS
import io.ktor.client.HttpClient
import io.ktor.client.call.body
import io.ktor.client.request.get
Expand Down Expand Up @@ -75,6 +76,7 @@ internal class MayaChainApiImp @Inject constructor(
parameter("amount", amount)
parameter("destination", address)
parameter("streaming_interval", interval)
parameter("tolerance_bps", TOLERANCE_BPS)
if (isAffiliate) {
parameter("affiliate", THORChainSwaps.AFFILIATE_FEE_ADDRESS)
parameter("affiliate_bps", THORChainSwaps.AFFILIATE_FEE_RATE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.vultisig.wallet.data.api.models.cosmos.NativeTxFeeRune
import com.vultisig.wallet.data.api.models.cosmos.THORChainAccountResultJson
import com.vultisig.wallet.data.api.models.cosmos.THORChainAccountValue
import com.vultisig.wallet.data.chains.helpers.THORChainSwaps
import com.vultisig.wallet.data.chains.helpers.THORChainSwaps.Companion.TOLERANCE_BPS
import com.vultisig.wallet.data.common.Endpoints
import com.vultisig.wallet.data.utils.ThorChainSwapQuoteResponseJsonSerializer
import io.ktor.client.HttpClient
Expand Down Expand Up @@ -99,6 +100,7 @@ internal class ThorChainApiImpl @Inject constructor(
parameter("amount", amount)
parameter("destination", address)
parameter("streaming_interval", interval)
parameter("tolerance_bps", TOLERANCE_BPS)
if (isAffiliate) {
parameter("affiliate", THORChainSwaps.AFFILIATE_FEE_ADDRESS)
parameter("affiliate_bps", THORChainSwaps.AFFILIATE_FEE_RATE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class THORChainSwaps(
companion object {
const val AFFILIATE_FEE_ADDRESS = "va"
const val AFFILIATE_FEE_RATE = "50" // 50 BP
const val TOLERANCE_BPS = "50"
}

private fun getPreSignedInputData(
Expand Down