Skip to content

Conversation

@dankelleher
Copy link
Member

@dankelleher dankelleher commented Jan 21, 2026

Summary

  • Add admin instructions for rebalancing funds from SPL stake pool to Marinade
  • Fix critical bugs in SPL WithdrawStake CPI instruction
  • Add comprehensive unit tests for mainnet deployment confidence

Key Changes

Bug Fixes (Critical)

  • WithdrawStake discriminator: Changed from 12 (SetFee) to 10 (WithdrawStake)
  • Account count: Changed from 12 to 13 accounts (added native_stake_program)
  • Validator list parsing: Fixed blaze.ts to use correct 73-byte ValidatorStakeInfoLayout

New Instructions

  • moveSplLiquidToMarinade - Direct liquid transfer from SPL pool to Marinade LP
  • createSplStakeAccount - Withdraw stake from SPL pool and deactivate
  • depositSplStakeToLiquid - Deposit deactivated stake to Marinade LP

Tests Added

  • 29 Rust unit tests covering instruction format, PDA derivation, pool math
  • 12 TypeScript unit tests for validator list parsing
  • Scenario test for liquid transfer flow

dankelleher and others added 5 commits December 10, 2025 16:12
Add three new admin-only program instructions for migrating funds from
SPL stake pool to Marinade liquidity pool:

- move_spl_liquid_to_marinade: Withdraw SOL from SPL pool reserve and
  add directly to Marinade liquidity pool
- create_spl_stake_account: Create a stake account from SPL pool and
  deactivate it (uses PDA for discoverability)
- deposit_spl_stake_to_liquid: Deposit fully deactivated stake account
  to Marinade liquidity pool

Also adds:
- Client SDK methods for all three instructions
- findSplRebalanceStakeAccounts() method for stake account discovery
- Admin scripts for executing the operations and reporting
- Reverts UI withdrawals to use Marinade (admin instructions handle
  SPL pool migration instead of user-initiated withdrawals)
- Fix critical bug: WithdrawStake discriminator was 12 (SetFee), now 10
- Fix account count: WithdrawStake requires 13 accounts, not 12
- Fix validator list parsing in blaze.ts to use correct 73-byte layout
- Add Rust unit tests for create_spl_stake_account (7 tests)
- Add Rust unit tests for deposit_spl_stake_to_liquid (5 tests)
- Add Rust unit tests for spl.rs pool token math (16 tests)
- Add TypeScript unit tests for blaze.ts validator parsing (12 tests)
- Add spl-rebalance-liquid-transfer scenario test
- Add inspectBlaze.ts script for debugging stake pool state
- Add admin fixtures for scenario tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Jan 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
app Ready Ready Preview, Comment Jan 21, 2026 5:03pm

Request Review

- Run cargo fmt on Rust files
- Use JSON import in tests instead of fs.readFileSync
- Exclude __tests__ from tsconfig (run separately by mocha)
- Add __tests__ to eslint ignorePatterns
- Fix unused import and type annotation in blaze.ts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@dankelleher dankelleher merged commit e205855 into develop Jan 21, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants