Skip to content

Conversation

@petar-omni
Copy link
Collaborator

This pull request introduces a patch to the @stakekit/widget package that fixes unstake limits for ERC4626-compliant yield opportunities. The main changes improve how unstake limits are calculated and allow users to change unstake amounts for ERC4626 positions, even when the amount is not explicitly required.

ERC4626 Unstake Limit Fixes:

  • Added the isERC4626 utility to yields.ts to detect ERC4626-compliant yield opportunities.
  • Updated logic in stake.ts so that the minimum unstake amount calculation uses higher decimal precision and correctly applies integration minimums for non-Bittensor staking.
  • In position-details/state/index.tsx, users can now change unstake amounts for ERC4626 positions, even if the amount is not marked as required.

General Maintenance:

  • Added missing import for isBittensorStaking in stake.ts.
  • Registered the patch change in .changeset/calm-owls-accept.md.

@changeset-bot
Copy link

changeset-bot bot commented Nov 19, 2025

🦋 Changeset detected

Latest commit: 14d952e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@stakekit/widget Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Nov 19, 2025

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

Project Deployment Preview Comments Updated (UTC)
dashboard-finery Ready Ready Preview Comment Nov 19, 2025 5:48pm
dashboard-utila Ready Ready Preview Comment Nov 19, 2025 5:48pm
staging-widget Ready Ready Preview Comment Nov 19, 2025 5:48pm
stakekit-widget Ready Ready Preview Comment Nov 19, 2025 5:48pm

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes unstake limits for ERC4626-compliant yield opportunities by improving limit calculations and enabling amount changes for ERC4626 positions regardless of the required flag.

  • Added isERC4626 utility function to detect ERC4626-compliant yields
  • Modified unstake amount logic to allow changes for ERC4626 positions even when not explicitly required
  • Refined getMinUnstakeAmount to apply special calculations only to Bittensor staking with higher decimal precision

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
packages/widget/src/domain/types/yields.ts Adds isERC4626 utility function to check if a yield supports the ERC4626 standard
packages/widget/src/pages/position-details/state/index.tsx Updates canChangeUnstakeAmount logic to allow ERC4626 positions to modify unstake amounts
packages/widget/src/domain/types/stake.ts Restricts special price-per-share calculation to Bittensor staking only and increases decimal precision from 8 to 16 places
.changeset/calm-owls-accept.md Registers the patch version change for the widget package

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@petar-omni petar-omni merged commit 3af0655 into main Nov 19, 2025
14 of 15 checks passed
@petar-omni petar-omni deleted the fix/unstake-limits branch November 19, 2025 18:02
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