# \[PASSED\] OP-PIP-68: Upgrade Pyth Oracle on TON Mainnet v2

**URL:** <https://forum.pyth.network/t/passed-op-pip-68-upgrade-pyth-oracle-on-ton-mainnet-v2/2112>\
**Category:** Proposals\
**Tags:** operational-pip\
**Created:** [April 25, 2025, 9:40am UTC](https://forum.pyth.network/t/passed-op-pip-68-upgrade-pyth-oracle-on-ton-mainnet-v2/2112 "2025-04-25T09:40:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![KemarTiti](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.pyth.network/kemartiti/32/5_2.png) [@KemarTiti](https://forum.pyth.network/u/KemarTiti)\
**Post date:** [April 25, 2025, 9:40am UTC](https://forum.pyth.network/t/passed-op-pip-68-upgrade-pyth-oracle-on-ton-mainnet-v2/2112/1 "2025-04-25T09:40:45Z")

</div>

**Abstract**

This OP-PIP follows the successful [OP-PIP-64](https://forum.pyth.network/t/passed-op-pip-64-upgrade-pyth-oracle-on-ton-testnet-v2/2105) that upgraded the Pyth oracle on TON testnet.

This PR enhances the Pyth oracle contract on TON by implementing cell chain traversal for price feed ID parsing. The change allows handling more than 3 price feed IDs in a single update by properly managing TON’s cell bit limitations.

**Rationale**

TON cells have a fundamental limitation of 1023 bits per cell. Given that each price feed ID is 256 bits:

- A single cell can only store 3 complete price feed IDs (768 bits)
- Previous implementation would fail when attempting to parse more than 3 IDs
- Applications need to handle more than 3 price feeds in a single update

**Description**

This proposal upgrades the Pyth oracle program on TON with the following major change:

- feat(target\_chains/ton): add helper function to parse price IDs beyond a single cell and enhance update handling - [PR 2558](https://github.com/pyth-network/pyth-crosschain/pull/2558)

**Implementation Plan**

Proposal: [https://proposals.pyth.network/?tab=proposals&cluster=mainnet-beta&proposal=3cmGxt9p4QaybakYEcrWLgfPQeHCBeqpugEQiyuzNNYz](https://proposals.pyth.network/?tab=proposals&cluster=mainnet-beta&proposal=3cmGxt9p4QaybakYEcrWLgfPQeHCBeqpugEQiyuzNNYz)

Verify the implementation by comparing the hash `553364b57e4a72918cce30a58cd219f30fb11947af185e22290c3252901a986c`:

- checkout the [pyth-crosschain repo](https://github.com/pyth-network/pyth-crosschain)
- `pnpm install --frozen-lockfile`
- `pnpm turbo build --filter "@pythnetwork/pyth-ton"`
- check that the `hash` in the output matches with the `package hash` in the proposal

---

<div class="post-metadata">

**Author:** ![Pyth-DAO](https://avatars.discourse-cdn.com/v4/letter/p/edb3f5/32.png) [@Pyth-DAO](https://forum.pyth.network/u/Pyth-DAO)\
**Post date:** [May 2, 2025, 11:16am UTC](https://forum.pyth.network/t/passed-op-pip-68-upgrade-pyth-oracle-on-ton-mainnet-v2/2112/2 "2025-05-02T11:16:04Z")

</div>


