fix(stacks-alpha-engine): a one sided HODLMM holding is not "deploy now" - #415
Open
cliqueengagements wants to merge 1 commit into
Open
cliqueengagements wants to merge 1 commit into
cliqueengagements wants to merge 1 commit into
Conversation
A wallet holding one side of a HODLMM pair is tiered `deploy_now` and given the pool's full APY with a daily dollar figure. It should be `swap_first`, and that figure is not achievable. `dlmm-core-v-1-1` holds the X asset only at bins at or above the active bin, and Y only at or below it, so both assets are valid together ONLY at the active bin. A deposit funded from one side lands outside it, which is outside the range where fees accrue, so the reported income is not received. Second issue in the same branch: the size comes from `Math.max(xUsd, yUsd)`, the larger side. A paired deposit can only be as large as the side that runs out first, so it is bounded by the smaller side, doubled. Observed on a wallet holding only STX: four pools offered as ready to deploy, at 604%, 366%, 185% and 4.4% APY, each carrying a daily figure. No behaviour change for a wallet holding both sides, or holding neither. Co-Authored-By: microbasilisk <272877828+microbasilisk@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A wallet holding one side of a HODLMM pair is tiered
deploy_nowand given the pool full APY with a daily dollar figure. It should beswap_first, and that figure is not achievable.The defect
dlmm-core-v-1-1holds the X asset only at bins at or above the active bin, and Y only at or below it, so both assets are valid together only at the active bin. A deposit funded from one side lands outside it, which is outside the range where fees accrue. The reported income is not received.Observed on a wallet holding only STX: four pools offered as ready to deploy, at 604%, 366%, 185% and 4.4% APY, each carrying a daily figure.
Second issue in the same branch
The size comes from
Math.max(xUsd, yUsd), the larger side. A paired deposit can only be as large as the side that runs out first, so it is bounded by the smaller side, doubled.Scope
18 insertions, 3 deletions, one branch of one function. No behaviour change for a wallet holding both sides, or holding neither. Most of the addition is the comment recording the bin invariant, so the next reader does not have to rediscover it.
One request on merge
If this is squashed or rebased, please keep the trailer:
A squash drops authorship unless the trailer is carried, and asking after the merge is too late to fix.