From 412fea9df80c766c898d6c2e804fb241f440dbce Mon Sep 17 00:00:00 2001 From: jorbuedo Date: Wed, 11 Oct 2023 13:08:42 +0200 Subject: [PATCH] Get market price of each pool, not the selected --- .../SelectPool/SelectPoolFromList/SelectPoolFromList.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/wallet-mobile/src/features/Swap/common/SelectPool/SelectPoolFromList/SelectPoolFromList.tsx b/apps/wallet-mobile/src/features/Swap/common/SelectPool/SelectPoolFromList/SelectPoolFromList.tsx index 50ae7bd8de..d2a958a555 100644 --- a/apps/wallet-mobile/src/features/Swap/common/SelectPool/SelectPoolFromList/SelectPoolFromList.tsx +++ b/apps/wallet-mobile/src/features/Swap/common/SelectPool/SelectPoolFromList/SelectPoolFromList.tsx @@ -1,4 +1,4 @@ -import {useSwap} from '@yoroi/swap' +import {getMarketPrice, useSwap} from '@yoroi/swap' import {Swap} from '@yoroi/types' import React, {useState} from 'react' import {StyleSheet, Text, TouchableOpacity, View} from 'react-native' @@ -79,7 +79,7 @@ export const SelectPoolFromList = ({pools = []}: Props) => { {Quantities.format( - orderData.selectedPoolCalculation?.prices.market ?? Quantities.zero, + getMarketPrice(pool, orderData.amounts.sell) ?? Quantities.zero, denomination, PRECISION, )}