End-to-end proof of concept for the Cypherock x Everstake HYSP integration. Tests deposit, instant redeem, and queue redeem flows against Ethereum mainnet using the Cypherock X1 for signing.
npm installRun:
npx tsx index.tsThe script runs sequentially through 7 steps. At each write step (approve, deposit, redeem) it prints a serialized unsigned transaction, pauses, and waits for you to paste a signed transaction from Cypherock X1 back. Press Enter to skip any step.
Signing flow:
- Script prints serialized unsigned tx
- Paste into your HW wallet SDK (
EvmApp.signTxn({ txn: "<serialized>", serializeTxn: true, ... })) - Device signs it, copy the
serializedTxnoutput - Paste back into the script prompt
- Script broadcasts and waits for on-chain confirmation
All configurable values are at the top of index.ts:
const WALLET_ADDRESS // your wallet public address
const USDC_ADDRESS // USDC contract address
const REFERRER_ID // always "SDK:cypherockwallet:prod:v1" — do not change
const DEPOSIT_AMOUNT_USDC // amount to deposit (plain number, e.g. 6)
const REDEEM_AMOUNT_MEVUSD // amount to redeem (plain number, e.g. 5)
const CHAIN_ID // 1 for ETH mainnet, 8453 for Base
const RPC_URL // public RPC — swap for paid APIs in prodconst CHAIN_ID = 8453;
const RPC_URL = "https://base.publicnode.com";
const USDC_ADDRESS = getAddress("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913");Change SDK init in main():
await hysp.init("base");// ETH mainnet USDT
const USDT_ADDRESS = getAddress("0xdAC17F958D2ee523a2206206994597C13D831ec7");Pass USDT_ADDRESS wherever USDC_ADDRESS is used in deposit and redeem calls.
Step 1 — SDK init
Step 2 — Read calls (APY, price, fees, liquidity, balances)
Step 3 — Approve USDC for deposit
Step 4 — Deposit USDC to mevUSD
Step 5 — Approve mevUSD for redemption
Step 6 — Instant redeem mevUSD to USDC
Step 7 — Queue redeem (structure only, not broadcasting)
Keep steps 1 and 2 active. Comment out steps 3 to 7.
Keep steps 1, 2, 3, 4. Comment out steps 5, 6, 7.
Keep steps 1, 2, 5, 6. Comment out steps 3, 4, 7.
Note: step 5 approve can be skipped if the redemption vault already has sufficient mevUSD allowance from a previous run. Check on-chain allowance before skipping.
Keep steps 1, 2, 7. Comment out steps 3, 4, 5, 6.
Note: queue redeem requires a minimum amount (confirm with Everstake) and broadcasting is disabled in step 7 by default.
- All write methods (approve, deposit, redeem) expect plain human-readable numbers. Do not use
parseUnits— the SDK handles decimal conversion internally. REFERRER_IDmust always be included in every deposit. This is a contractual requirement for revenue share attribution.- Gas price is set to 1.5x current network price to ensure timely confirmation. Adjust the multiplier in
serializeTx()if needed. - Public RPC may be slow. Replace
RPC_URLwith an paid endpoint for faster responses.
index.ts — main POC script
package.json
tsconfig.json