Skip to content

Commit

Permalink
[EASY] Use full precision in CoinGecko (#2852)
Browse files Browse the repository at this point in the history
# 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
  • Loading branch information
m-lord-renkse authored Aug 2, 2024
1 parent 2d1b59b commit e70e8f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/shared/src/price_estimation/native/coingecko.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e70e8f6

Please sign in to comment.