diff --git a/src/swap/defi/thorchain.ts b/src/swap/defi/thorchain.ts index a51cb17b..8d7e816f 100644 --- a/src/swap/defi/thorchain.ts +++ b/src/swap/defi/thorchain.ts @@ -668,6 +668,22 @@ const getPool = ( tokenCode: string, pools: Pool[] ): Pool => { + if (mainnetCode === 'THOR' && tokenCode === 'RUNE') { + // Create a fake pool for rune. Use BTC pool to find rune USD price + const btcPool = pools.find(pool => pool.asset === 'BTC.BTC') + + if (btcPool == null) { + throw new SwapCurrencyError(swapInfo, request) + } + const { assetPrice, assetPriceUSD } = btcPool + const pool: Pool = { + asset: 'THOR.RUNE', + assetPrice: '1', + assetPriceUSD: div(assetPriceUSD, assetPrice, 16) + } + return pool + } + const pool = pools.find(pool => { const [asset] = pool.asset.split('-') return asset === `${mainnetCode}.${tokenCode}`