# XRC canister not supporting (some) Ethererum pairs?

**URL:** <https://forum.dfinity.org/t/xrc-canister-not-supporting-some-ethererum-pairs/36921>\
**Category:** Developers\
**Created:** [November 4, 2024, 10:18am UTC](https://forum.dfinity.org/t/xrc-canister-not-supporting-some-ethererum-pairs/36921 "2024-11-04T10:18:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kristofer](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/kristofer/32/11135_2.png) [@kristofer](https://forum.dfinity.org/u/kristofer)\
**Post date:** [November 4, 2024, 10:18am UTC](https://forum.dfinity.org/t/xrc-canister-not-supporting-some-ethererum-pairs/36921/1 "2024-11-04T10:18:26Z")

</div>

I tried to look up some common trading pairs in the Ethereum DeFi ecosystem, such as `USDC/WETH` but did not successfully get any rates back:

Errors:

```auto
Asset: Asset { symbol: "USDC", class: Cryptocurrency }, Error: Failed to retrieve rate from Coinbase: IC0503: Error from Canister uf6dk-hyaaa-aaaaq-qaaaq-cai: Canister called `ic0.trap` with message: Failed to deserialize JSON: error: invalid type: map, expected a sequence at line 1 column 0 response: {"message":"Coinbase Pro API is deprecated."}.

Asset: Asset { symbol: "USDC", class: Cryptocurrency }, Error: Failed to retrieve rate from GateIo: Connecting to api.gateio.ws failed: Request failed direct connect client error (Connect) and connect through socks client error (Connect)

Asset: Asset { symbol: "USDC", class: Cryptocurrency }, Error: Failed to retrieve rate from Poloniex: IC0503: Error from Canister uf6dk-hyaaa-aaaaq-qaaaq-cai: Canister called `ic0.trap` with message: Failed to deserialize JSON: error: invalid type: map, expected a sequence at line 1 column 0 response: { "code" : 24101, "message" : "Invalid symbol!" }.

[KuCoin] Failed to deserialize JSON: error: missing field `data` at line 1 column 51 response: {"msg":"Unsupported trading pair.","code":"400100"}

```

… and some more.

Maybe the XRC canister should not be used for these kinds of pairs?

I guess `WETH` is not a super common token to use on centralised exchanges. It is the #14 of all tokens though, according to Coingecko. So, it seems reasonable the XRC canister should support it?

@dskloet @0x5279616e

---

<div class="post-metadata">

**Author:** ![THLO](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/thlo/32/2349_2.png) [@THLO](https://forum.dfinity.org/u/THLO)\
**Post date:** [November 4, 2024, 12:50pm UTC](https://forum.dfinity.org/t/xrc-canister-not-supporting-some-ethererum-pairs/36921/2 "2024-11-04T12:50:04Z")

</div>

The exchange rate canister supports all tokens traded at the major (centralized) exchanges. WETH is not one of them…

Out of curiosity, why do you need it? The WETH/USDC rate should never be far from the ETH/USDC rate, right?

---

<div class="post-metadata">

**Author:** ![kristofer](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/kristofer/32/11135_2.png) [@kristofer](https://forum.dfinity.org/u/kristofer)\
**Post date:** [November 4, 2024, 1:47pm UTC](https://forum.dfinity.org/t/xrc-canister-not-supporting-some-ethererum-pairs/36921/3 "2024-11-04T13:47:44Z")

</div>

I am building a DCA (Dollar Cost Average) example using `ic-alloy`. You setup a canister with a base token and a swap token and then, every X minutes it swaps some of the base token for the swap token using Uniswap. In order to calculate the slippage, I need the exchange rate. And, since I am using Uniswap I need an exchange rate source that supports all tokens on Uniswap.

ps. It turns out Uniswap provides exchange rates for all their supported pairs. I will use that for now.

---

<div class="post-metadata">

**Author:** ![THLO](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/thlo/32/2349_2.png) [@THLO](https://forum.dfinity.org/u/THLO)\
**Post date:** [November 4, 2024, 2:10pm UTC](https://forum.dfinity.org/t/xrc-canister-not-supporting-some-ethererum-pairs/36921/4 "2024-11-04T14:10:25Z")

</div>

Sounds cool! Thanks for the info!
