Skip to content

Conversation

@zone-live
Copy link
Contributor

@zone-live zone-live commented Dec 11, 2025

Explanation

Adds a tron_staking state structure to support staking APY data for Tron.

Tron staking uses a different approach than EVM pooled staking, so rather than forcing Tron into the existing pooled_staking structure (which would require nullable vault-specific fields and conditional logic), this introduces a dedicated Tron specific state.

We opted for a chain-specific key (tron_staking) rather than a generic non_evm_staking map because different non-EVM chains may have significantly different data requirements. This approach is more explicit and if we add other non-EVM chains later, they can have their own state structures.

The idea next is for the mobile client to:
1 - Call EarnController.refreshNonEvmStakingApy() with Tron witness API fetcher
2 - Use the selectors in selectEarnTokens to populate earnToken.experience.apr with the Tron APY
3- Get rid of the useTronStakeApy hook calls from components

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Adds TRON staking APY support to EarnController with a new tron_staking state, fetch/update method, selectors, exports, and tests.

  • Earn Controller:
    • State: Introduces tron_staking (TronStakingState) with metadata; defaults to null (DEFAULT_TRON_STAKING_STATE) and included in getDefaultEarnControllerState.
    • Methods: Adds refreshTronStakingApy(apyFetcher) and getTronStakingApy().
    • Exports: Exposes TronStakingState, DEFAULT_TRON_STAKING_STATE, and new selectors via src/index.ts.
  • Selectors:
    • Adds selectTronStaking and selectTronStakingApy.
    • Tightens return types on existing lending selectors.
  • Tests:
    • Adds tests for TRON staking state/methods/selectors and updates metadata snapshots.
  • Docs:
    • Updates CHANGELOG.md to note TRON staking APY support.

Written by Cursor Bugbot for commit be891ac. This will update automatically on new commits. Configure here.

@zone-live zone-live requested a review from a team as a code owner December 11, 2025 14:24
nickewansmith
nickewansmith previously approved these changes Dec 17, 2025
@zone-live zone-live requested a review from a team as a code owner December 17, 2025 18:23
@zone-live zone-live added this pull request to the merge queue Dec 18, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 18, 2025
@zone-live zone-live enabled auto-merge December 18, 2025 15:42
@zone-live zone-live added this pull request to the merge queue Dec 18, 2025
Merged via the queue into main with commit c17a0d8 Dec 18, 2025
561 of 565 checks passed
@zone-live zone-live deleted the NWNT-776-move-tron-experience-into-earn-token branch December 18, 2025 15:56
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.

3 participants