diff --git a/src/plugins/stake-plugins/generic/policyAdapters/CoreumStakeKitAdaptor.ts b/src/plugins/stake-plugins/generic/policyAdapters/CoreumStakeKitAdaptor.ts index a992e8843d0..0be7e88f286 100644 --- a/src/plugins/stake-plugins/generic/policyAdapters/CoreumStakeKitAdaptor.ts +++ b/src/plugins/stake-plugins/generic/policyAdapters/CoreumStakeKitAdaptor.ts @@ -2,6 +2,7 @@ import type { ActionRequestDto, TransactionDto } from '@stakekit/api-hooks' import { add, div, eq, floor, gt, mul, sub } from 'biggystring' import { EdgeCurrencyWallet, EdgeTransaction } from 'edge-core-js' +import { DECIMAL_PRECISION } from '../../../../util/utils' import { AssetId, ChangeQuote, PositionAllocation, QuoteAllocation, StakePosition } from '../../types' import { StakePolicyConfig } from '../types' import { @@ -13,7 +14,6 @@ import { yieldGetSingleYieldBalances, yieldYieldOpportunity } from '../util/stakeKitUtils' -import { convertNativeToExchange, DECIMAL_PRECISION } from '../../../../util/utils' import { StakePolicyAdapter } from './types' export interface CoreumNativeSkateKitAdapterConfig { @@ -119,7 +119,7 @@ export const makeSkateKitAdapter = (policyConfig: StakePolicyConfig { - const networkFee = convertNativeToExchange(exchangeDenomMultiplier)(tx.gasEstimate?.amount ?? '0') + const networkFee = mul(exchangeDenomMultiplier, tx.gasEstimate?.amount ?? '0') const edgeTx: EdgeTransaction = { blockHeight: 0, @@ -171,7 +171,7 @@ export const makeSkateKitAdapter = (policyConfig: StakePolicyConfig { - const networkFee = convertNativeToExchange(exchangeDenomMultiplier)(tx.gasEstimate?.amount ?? '0') + const networkFee = mul(exchangeDenomMultiplier, tx.gasEstimate?.amount ?? '0') const edgeTx: EdgeTransaction = { blockHeight: 0, @@ -235,7 +235,7 @@ export const makeSkateKitAdapter = (policyConfig: StakePolicyConfig { - const networkFee = convertNativeToExchange(exchangeDenomMultiplier)(tx.gasEstimate?.amount ?? '0') + const networkFee = mul(exchangeDenomMultiplier, tx.gasEstimate?.amount ?? '0') const edgeTx: EdgeTransaction = { blockHeight: 0, @@ -393,7 +393,10 @@ export const makeSkateKitAdapter = (policyConfig: StakePolicyConfig validator.address === adapterConfig.preferredValidatorAddress) + if (validatorApr == null) return { apy: 0 } + + return { apy: validatorApr.apr * 100 } } }