# New Utility in Pyth EVM Contracts: Combine Price Feeds to derive Cross Rates

**URL:** <https://dev-forum.pyth.network/t/new-utility-in-pyth-evm-contracts-combine-price-feeds-to-derive-cross-rates/230>\
**Category:** Announcements\
**Tags:** evm\
**Created:** [June 23, 2025, 6:32pm UTC](https://dev-forum.pyth.network/t/new-utility-in-pyth-evm-contracts-combine-price-feeds-to-derive-cross-rates/230 "2025-06-23T18:32:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aditya520](https://yyz2.discourse-cdn.com/flex034/user_avatar/dev-forum.pyth.network/aditya520/32/12_2.png) [@Aditya520](https://dev-forum.pyth.network/u/Aditya520)\
**Post date:** [June 23, 2025, 6:32pm UTC](https://dev-forum.pyth.network/t/new-utility-in-pyth-evm-contracts-combine-price-feeds-to-derive-cross-rates/230/1 "2025-06-23T18:32:44Z")

</div>

We just added a new helper to the [pyth-sdk-solidity](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/ethereum/sdk/solidity) — [deriveCrossRate()](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/sdk/solidity/PythUtils.sol#L77) — to make it easier to calculate **synthetic prices** or **cross rates** like ETH/EUR, SOL/BTC, etc., using existing Pyth feeds.

This is helpful when Pyth doesn’t directly publish a trading pair you’re interested in — but you can derive it using a ratio of two prices.

### **📦 What’s new**

You can now compute a price like:  
`ETH/EUR = ETH/USD / EUR/USD`

⚙ Onchain, using this:

```auto
int64 crossRate = PythUtils.deriveCrossRate(
    price1, expo1,
    price2, expo2,
    targetExponent
);

```

📖 Docs: [Derive Cross Rates](https://docs.pyth.network/price-feeds/derive-cross-rate)

🧠 Bonus: The SDK also includes overflow protection, rounding logic, and edge case handling.

You can see a full working example in our docs [here](https://docs.pyth.network/price-feeds/derive-cross-rate#example-1Doe).

---

<div class="post-metadata">

**Author:** ![0xcredence](https://yyz2.discourse-cdn.com/flex034/user_avatar/dev-forum.pyth.network/0xcredence/32/26_2.png) [@0xcredence](https://dev-forum.pyth.network/u/0xcredence)\
**Post date:** [June 24, 2025, 11:25am UTC](https://dev-forum.pyth.network/t/new-utility-in-pyth-evm-contracts-combine-price-feeds-to-derive-cross-rates/230/2 "2025-06-24T11:25:50Z")

</div>

Pinned on June 24, 2025, 11:25am UTC



---

<div class="post-metadata">

**Author:** ![KemarTiti](https://yyz2.discourse-cdn.com/flex034/user_avatar/dev-forum.pyth.network/kemartiti/32/6_2.png) [@KemarTiti](https://dev-forum.pyth.network/u/KemarTiti)\
**Post date:** [July 30, 2025, 9:23am UTC](https://dev-forum.pyth.network/t/new-utility-in-pyth-evm-contracts-combine-price-feeds-to-derive-cross-rates/230/3 "2025-07-30T09:23:14Z")

</div>

What if I want to do combine prices on the front end, is there any way to do this?

---

<div class="post-metadata">

**Author:** ![Aditya520](https://yyz2.discourse-cdn.com/flex034/user_avatar/dev-forum.pyth.network/aditya520/32/12_2.png) [@Aditya520](https://dev-forum.pyth.network/u/Aditya520)\
**Post date:** [July 30, 2025, 12:44pm UTC](https://dev-forum.pyth.network/t/new-utility-in-pyth-evm-contracts-combine-price-feeds-to-derive-cross-rates/230/4 "2025-07-30T12:44:02Z")

</div>

If you want to combine price feeds on front end, you can just divide the two prices.  
(ETH/USD) / (BTC/USD) = ETH/BTC.
