Skip to content

chore: remove deprecated thorchain lending and savers, extract runepool - #12511

Merged
kaladinlight merged 4 commits into
developfrom
chore/remove-thorchain-lending-savers
Jul 31, 2026
Merged

chore: remove deprecated thorchain lending and savers, extract runepool#12511
kaladinlight merged 4 commits into
developfrom
chore/remove-thorchain-lending-savers

Conversation

@kaladinlight

Copy link
Copy Markdown
Member

Description

Removes the sunset THORChain defi dead code and renames the surviving rails to what they actually serve:

  • THORChain lending: deleted wholesale. src/pages/Lending, lib/utils/thorchain/lending, all THORCHAIN_LENDING* flags, /lending routes + nav entries, and the lending-only useQuoteEstimatedFeesQuery. The shared useGetEstimatedFeesQuery / useIsSweepNeededQuery hooks (used by TCY, LP, Sweep) moved from pages/Lending/hooks to src/hooks/queries (git renames, byte-identical).
  • Savers vaults: deleted. SAVERS_VAULTS* flags, the thorchainsavers resolvers, savers quote hooks, balance.ts, and the savers-only paths (ERC-20 approve, UTXO sweep, dust, quotes) in the manager components.
  • RUNEPool: extracted as a first-class provider. RUNEPool is live on-chain (RUNEPOOLENABLED=1, ~2.85M RUNE deposited) and previously rode the savers rails. New RUNE-only resolvers/runepool + RunePoolManager (deposit POOL+, withdraw pool-:<bps> — memos byte-equivalent to the previous RUNE branches). DefiProvider.ThorchainSaversDefiProvider.RunePool ('RUNEPool'), with the opportunities persist migration bumped to 7 to purge the old serialized provider string.
  • TCY claims unaffected: the savers position-introspection helpers TCY needs live on in lib/utils/thorchain/savers.ts.
  • Translations: defi.modals.saversVaultsdefi.modals.runePool migrated across all 10 locales (values copied, no new strings); dead lending.*/navBar keys removed; pools.haltedDepositTitle added for the LP pool page.
  • Rider fixes: wallet-drawer DeFi tab no longer spins forever on empty search results (PositionTable); RUNEPool status "View Position" now goes to the account page instead of the desktop-redirected /wallet/earn.

Notes for reviewers:

  • Mixpanel opportunity events now report provider: "RUNEPool" where they previously said "THORChain Savers" — dashboards keyed on the old string will need their filters updated.
  • The RUNEPool deposit confirm no longer requires supportsETH(wallet) (savers-era leftover that wrongly gated non-ETH wallets on a native RUNE MsgDeposit).

Issue (if applicable)

closes #

Risk

High — this rewrites the components that construct and broadcast RUNEPool deposit/withdraw transactions (native THORChain MsgDeposit). The memos and useSendThorTx plumbing are unchanged and byte-equivalent to the previous isRunePool branches, but the surrounding components are new files. TCY claim and THORChain LP flows share touched utilities (useSendThorTx action union, dust-threshold constant relocation, moved fee/sweep hooks) and should be regression-checked.

What protocols, transaction types, wallets or contract interactions might be affected by this PR?

THORChain RUNEPool deposits/withdrawals (MsgDeposit), TCY claims (shared savers introspection + dust constants), THORChain LP (shared useSendThorTx / mimir hooks), removed: THORChain lending + savers vaults surfaces.

Testing

Engineering

  • RUNEPool deposit executed end-to-end on the new flow against mainnet (0.25 RUNE, broadcast + confirmed, position visible afterwards).
  • Multi-agent review pass over the full diff: scripted sweep found zero references to deleted modules/flags/enum members/routes; scripted translation audit verified all referenced keys exist in en/main.json, all 10 locales parse and are structurally consistent, and no removed key is still referenced.
  • pnpm run type-check / pnpm run lint to be confirmed in CI.

Operations

  • 🏁 My feature is behind a flag and doesn't require operations testing (yet)

Regression QA (preview env, wallet with a THORChain account):

  1. RUNEPool: wallet drawer → DeFi tab → RUNE row → deposit (small amount) and withdraw; verify maturity-lockup warning on deposit and that "View Position" lands on the account page.
  2. TCY: claim flow for an account with former savers positions still resolves addresses and completes.
  3. THORChain LP: add/withdraw liquidity unaffected.
  4. Confirm /lending no longer appears in nav and old links 404 gracefully.

Screenshots (if applicable)

🤖 Generated with Claude Code

Remove the sunset THORChain lending feature wholesale and the savers
vaults surface, extracting RUNEPool (still live on-chain) onto its own
provider/resolver with savers -> runepool vernacular throughout.

- delete src/pages/Lending, lib/utils/thorchain/lending, all
  THORCHAIN_LENDING*/SAVERS_VAULTS* flags, /lending routes and nav
- move shared useGetEstimatedFeesQuery/useIsSweepNeededQuery hooks from
  pages/Lending/hooks to src/hooks/queries
- replace resolvers/thorchainsavers + ThorchainSaversManager with
  RUNE-only resolvers/runepool + RunePoolManager (no approve/sweep/
  savers-quote paths - RUNE is native non-UTXO)
- rename DefiProvider.ThorchainSavers -> DefiProvider.RunePool
  ('RUNEPool') with opportunities persist migration bump to 7
- keep TCY-claim savers introspection helpers in
  lib/utils/thorchain/savers.ts
- migrate defi.modals.saversVaults -> defi.modals.runePool translations
  across all 10 locales, trim dead lending keys
- fix PositionTable infinite spinner on empty search results
- fix RUNEPool status view-position navigating to the desktop-redirected
  /wallet/earn

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@kaladinlight
kaladinlight requested a review from a team as a code owner July 31, 2026 19:28
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 115 files, which is 15 over the limit of 100.

To get a review, narrow the scope:
• coderabbit review --committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3d5a2859-296e-4f7f-bc34-79e38975ef01

📥 Commits

Reviewing files that changed from the base of the PR and between 6755469 and 43b9111.

⛔ Files ignored due to path filters (1)
  • src/assets/runepool-top.png is excluded by !**/*.png
📒 Files selected for processing (115)
  • .env
  • src/Routes/RoutesCommon.tsx
  • src/assets/translations/de/main.json
  • src/assets/translations/en/main.json
  • src/assets/translations/es/main.json
  • src/assets/translations/fr/main.json
  • src/assets/translations/ja/main.json
  • src/assets/translations/pt/main.json
  • src/assets/translations/ru/main.json
  • src/assets/translations/tr/main.json
  • src/assets/translations/uk/main.json
  • src/assets/translations/zh/main.json
  • src/components/EarnDashboard/components/PositionDetails/StakingPositionsByProvider.tsx
  • src/components/Layout/Header/Header.tsx
  • src/components/StakingVaults/PositionTable.tsx
  • src/components/Sweep.tsx
  • src/config.ts
  • src/features/defi/contexts/DefiManagerProvider/DefiCommon.ts
  • src/features/defi/contexts/DefiManagerProvider/utils.ts
  • src/features/defi/providers/runepool/components/RunePoolManager/Deposit/DepositCommon.ts
  • src/features/defi/providers/runepool/components/RunePoolManager/Deposit/DepositContext.ts
  • src/features/defi/providers/runepool/components/RunePoolManager/Deposit/DepositReducer.ts
  • src/features/defi/providers/runepool/components/RunePoolManager/Deposit/RunePoolDeposit.tsx
  • src/features/defi/providers/runepool/components/RunePoolManager/Deposit/components/Confirm.tsx
  • src/features/defi/providers/runepool/components/RunePoolManager/Deposit/components/Deposit.tsx
  • src/features/defi/providers/runepool/components/RunePoolManager/Deposit/components/Status.tsx
  • src/features/defi/providers/runepool/components/RunePoolManager/Overview/RunePoolEmpty.tsx
  • src/features/defi/providers/runepool/components/RunePoolManager/Overview/RunePoolOverview.tsx
  • src/features/defi/providers/runepool/components/RunePoolManager/RunePoolManager.tsx
  • src/features/defi/providers/runepool/components/RunePoolManager/Withdraw/RunePoolWithdraw.tsx
  • src/features/defi/providers/runepool/components/RunePoolManager/Withdraw/WithdrawCommon.ts
  • src/features/defi/providers/runepool/components/RunePoolManager/Withdraw/WithdrawContext.ts
  • src/features/defi/providers/runepool/components/RunePoolManager/Withdraw/WithdrawReducer.ts
  • src/features/defi/providers/runepool/components/RunePoolManager/Withdraw/components/Confirm.tsx
  • src/features/defi/providers/runepool/components/RunePoolManager/Withdraw/components/Status.tsx
  • src/features/defi/providers/runepool/components/RunePoolManager/Withdraw/components/Withdraw.tsx
  • src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Deposit/DepositCommon.ts
  • src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Deposit/DepositContext.ts
  • src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Deposit/DepositReducer.ts
  • src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Deposit/components/Approve.tsx
  • src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Deposit/components/Confirm.tsx
  • src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Deposit/components/Deposit.tsx
  • src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Dust/Dust.tsx
  • src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Overview/ThorchainSaversOverview.tsx
  • src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Withdraw/WithdrawCommon.ts
  • src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Withdraw/WithdrawContext.ts
  • src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Withdraw/WithdrawReducer.ts
  • src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Withdraw/components/Confirm.tsx
  • src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Withdraw/components/Withdraw.tsx
  • src/hooks/queries/useGetEstimatedFeesQuery.ts
  • src/hooks/queries/useIsSweepNeededQuery.ts
  • src/hooks/useRouteAccountId/useRouteAccountId.ts
  • src/hooks/useRouteAssetId/useRouteAssetId.ts
  • src/lib/utils/thorchain/balance.test.ts
  • src/lib/utils/thorchain/balance.ts
  • src/lib/utils/thorchain/constants.ts
  • src/lib/utils/thorchain/hooks/useGetThorchainSaversDepositQuoteQuery.tsx
  • src/lib/utils/thorchain/hooks/useGetThorchainSaversWithdrawQuoteQuery.tsx
  • src/lib/utils/thorchain/hooks/useSendThorTx.tsx
  • src/lib/utils/thorchain/hooks/useThorchainFromAddress.tsx
  • src/lib/utils/thorchain/index.ts
  • src/lib/utils/thorchain/lending/index.ts
  • src/lib/utils/thorchain/lending/types.ts
  • src/lib/utils/thorchain/savers.ts
  • src/lib/utils/thorchain/types.ts
  • src/pages/Lending/AvailablePools.tsx
  • src/pages/Lending/LendingPage.tsx
  • src/pages/Lending/Pool/Pool.tsx
  • src/pages/Lending/Pool/components/Borrow/Borrow.tsx
  • src/pages/Lending/Pool/components/Borrow/BorrowConfirm.tsx
  • src/pages/Lending/Pool/components/Borrow/BorrowInput.tsx
  • src/pages/Lending/Pool/components/Borrow/BorrowSweep.tsx
  • src/pages/Lending/Pool/components/Borrow/types.ts
  • src/pages/Lending/Pool/components/Faq.tsx
  • src/pages/Lending/Pool/components/LoanSummary.tsx
  • src/pages/Lending/Pool/components/PoolInfo.tsx
  • src/pages/Lending/Pool/components/Repay/Repay.tsx
  • src/pages/Lending/Pool/components/Repay/RepayConfirm.tsx
  • src/pages/Lending/Pool/components/Repay/RepayInput.tsx
  • src/pages/Lending/Pool/components/Repay/types.ts
  • src/pages/Lending/YourLoans.tsx
  • src/pages/Lending/components/LendingHeader.tsx
  • src/pages/Lending/hooks/useAllLendingPositionsData.tsx
  • src/pages/Lending/hooks/useIsLendingActive.ts
  • src/pages/Lending/hooks/useLendingCloseQuery.ts
  • src/pages/Lending/hooks/useLendingPositionData.tsx
  • src/pages/Lending/hooks/useLendingQuoteQuery.ts
  • src/pages/Lending/hooks/useLendingSupportedAssets/index.ts
  • src/pages/Lending/hooks/usePoolDataQuery.ts
  • src/pages/Lending/hooks/useRepaymentLockData.tsx
  • src/pages/TCY/components/Claim/ClaimConfirm.tsx
  • src/pages/TCY/queries/useTcyClaims.tsx
  • src/pages/ThorChainLP/AvailablePools.tsx
  • src/pages/ThorChainLP/Pool/Pool.tsx
  • src/pages/ThorChainLP/YourPositions.tsx
  • src/pages/ThorChainLP/components/AddLiquidity/AddLiquidityInput.tsx
  • src/pages/ThorChainLP/components/RemoveLiquidity/RemoveLiquidityInput.tsx
  • src/react-queries/hooks/useQuoteEstimatedFeesQuery.ts
  • src/state/migrations/index.ts
  • src/state/slices/opportunitiesSlice/constants.ts
  • src/state/slices/opportunitiesSlice/mappings.ts
  • src/state/slices/opportunitiesSlice/opportunitiesSlice.test.ts
  • src/state/slices/opportunitiesSlice/resolvers/runepool/index.ts
  • src/state/slices/opportunitiesSlice/resolvers/runepool/types.ts
  • src/state/slices/opportunitiesSlice/resolvers/runepool/utils.ts
  • src/state/slices/opportunitiesSlice/resolvers/thorchainLending/types.ts
  • src/state/slices/opportunitiesSlice/resolvers/thorchainsavers/index.ts
  • src/state/slices/opportunitiesSlice/resolvers/thorchainsavers/types.ts
  • src/state/slices/opportunitiesSlice/resolvers/thorchainsavers/utils.test.ts
  • src/state/slices/opportunitiesSlice/resolvers/thorchainsavers/utils.ts
  • src/state/slices/opportunitiesSlice/types.ts
  • src/state/slices/opportunitiesSlice/utils/index.ts
  • src/state/slices/preferencesSlice/preferencesSlice.ts
  • src/test/mocks/store.ts
  • src/vite-env.d.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kaladinlight
kaladinlight merged commit 6391fc2 into develop Jul 31, 2026
4 checks passed
@kaladinlight
kaladinlight deleted the chore/remove-thorchain-lending-savers branch July 31, 2026 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant