[PASSED] OP-PIP-106: Upgrade the Pyth Express Relay Program on Solana to add an SPL token withdrawal instruction

Abstract

Following the upgrading of the Pyth Express Relay program on Solana (OP-PIP54) to introduce swapping with fees, this proposal aims to upgrade the Pyth Express Relay Program to introduce an instruction to claim DAO fees.

Rationale

The swapping mechanism introduced in OP-PIP54 has resulted in the accumulation of ~25k USD notional worth of SPL token fees. Currently, the program has an instruction to withdraw SOL-denominated fees to the DAO but not to withdraw SPL-denominated fees.

We are proposing to upgrade the Express Relay program to include a withdrawal instruction for SPL token fees.

Description

The update to the program consists of adding a new instruction (withdraw_spl_fees) to extract fees of the specified SPL token mint to a specified token account.

Implementation Plan

  • Proposal id: J1JTqmB39avkqiFQwrxi6sgdVU3aWeVhqr8JyjXTUZqa

  • Extend the Pyth Express Relay Program with a withdraw_spl_fees instruction:

    • PR #584 added this instruction which checks for valid admin signer and allows withdrawal to any token account matching the token program and mint of the SPL token being withdrawn.
  • Verification steps (Skip to step 12 if you don’t want to build the program locally):

    1. Make sure you have git, rust and Docker installed.

    2. git: install git from here

    3. rust: install rust from here

    4. Docker: install Docker from here

    5. Install the solana cli: sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)"

    6. Install the solana-verify cli : cargo install --locked solana-verify --git https://github.com/solana-foundation/solana-verifiable-build --rev 5ff03e0

    7. clone the per repo by running the following command: git clone https://github.com/pyth-network/per

    8. change your directory to per/contracts/svm by doing cd per/contracts/svm

    9. checkout commit f816a9e by doing git checkout f816a9ec78b5239b14133d927390262f2e60c86c

    10. Build the program by running solana-verify build

    11. Check the hash of the artifact sha256sum target/deploy/express_relay.so

    12. Alternatively you can check the hash in this Github workflow that builds the program in “Print Hash”.

    13. check the hash of the deployed buffersolana program -u m dump HaY7ikwmcUdiNVCgeApG8w9NRBH59y8kFJAFNxqKHkqB temp_file && sha256sum temp_file && rm temp_file.

    14. Make sure the hash from step 11 (or 12) and 13 match

    15. Make sure the upgrade authority of the buffer HaY7ikwmcUdiNVCgeApG8w9NRBH59y8kFJAFNxqKHkqB is the Pythian Council 6oXTdojyfDS8m5VtTaYB9xRCxpKGSvKJFndLUPV3V3wT

2 Likes