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_feesinstruction:- 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):
-
Make sure you have git, rust and Docker installed.
-
git: install
gitfrom here -
rust: install
rustfrom here -
Docker: install Docker from here
-
Install the
solanacli:sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)" -
Install the
solana-verifycli :cargo install --locked solana-verify --git https://github.com/solana-foundation/solana-verifiable-build --rev 5ff03e0 -
clone the per repo by running the following command:
git clone https://github.com/pyth-network/per -
change your directory to
per/contracts/svmby doingcd per/contracts/svm -
checkout commit
f816a9eby doinggit checkout f816a9ec78b5239b14133d927390262f2e60c86c -
Build the program by running
solana-verify build -
Check the hash of the artifact
sha256sum target/deploy/express_relay.so -
Alternatively you can check the hash in this Github workflow that builds the program in “Print Hash”.
-
check the hash of the deployed buffer
solana program -um dump HaY7ikwmcUdiNVCgeApG8w9NRBH59y8kFJAFNxqKHkqB temp_file && sha256sum temp_file && rm temp_file. -
Make sure the hash from step 11 (or 12) and 13 match
-
Make sure the upgrade authority of the buffer
HaY7ikwmcUdiNVCgeApG8w9NRBH59y8kFJAFNxqKHkqBis the Pythian Council6oXTdojyfDS8m5VtTaYB9xRCxpKGSvKJFndLUPV3V3wT
-