From e70e8f609472d725e831b8ac342e09b71aac13f5 Mon Sep 17 00:00:00 2001 From: Mateo-mro <160488334+Mateo-mro@users.noreply.github.com> Date: Fri, 2 Aug 2024 10:09:36 +0200 Subject: [PATCH] [EASY] Use full precision in CoinGecko (#2852) # Description Use full precision in CoinGecko so we do the calculations with all the possible decimals. # Changes - Use full precision in CoinGecko ## How to test 1. Unit test --- crates/shared/src/price_estimation/native/coingecko.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/shared/src/price_estimation/native/coingecko.rs b/crates/shared/src/price_estimation/native/coingecko.rs index 773a266552..c9652a5639 100644 --- a/crates/shared/src/price_estimation/native/coingecko.rs +++ b/crates/shared/src/price_estimation/native/coingecko.rs @@ -58,7 +58,8 @@ impl NativePriceEstimating for CoinGecko { let mut url = crate::url::join(&self.base_url, &self.chain); url.query_pairs_mut() .append_pair("contract_addresses", &format!("{:#x}", token)) - .append_pair("vs_currencies", "eth"); + .append_pair("vs_currencies", "eth") + .append_pair("precision", "full"); let mut builder = self.client.get(url.clone()); if let Some(ref api_key) = self.api_key { builder = builder.header(Self::AUTHORIZATION, api_key)