Feat/b2 fee adjusted apy#161
Open
legend-esc wants to merge 3 commits into
Open
Conversation
- fetchPositionEvents() in blend.ts: queries Horizon /accounts/{pool}/operations,
maps invoke_host_function ops (submit→rebalance, claim→harvest) to PositionEvent
- recordPositionEvent() writes open/rebalance/harvest/close events with HF snapshot
to localStorage (keyed per asset+pool) at transaction time
- renderPositionTimeline() renders scrollable <details> block: local timestamps,
UTC on hover, colour-coded icons, network-aware Stellar Expert tx links
- refreshTimelineFromChain() merges on-chain history into local store (fire-and-forget
from loadAll when a position exists)
- Position History <details> added to position card in index.html
- CSS for .pos-timeline / .pos-event-item with per-kind icon colours
Closes Dgetsylver#27
- irAtUtil(): mirrors exact 3-kink IR formula using live rateConfig params - renderWorstCase(): projects HF at 30/90/180 days at 99% util (r_three active), borrow/supply APR breakdown, and days-to-liquidation at worst-case spread - Updates on every leverage slider / deposit input change via updatePreview() - <details> panel collapsed by default in the preview section - CSS for .worst-case-panel / .wc-* elements Closes Dgetsylver#41
Formula (from doc.md): fee_drag_%/yr = (rebalances × 2_txs × 0.00001_XLM × xlm_price) / equity_usd × 100 fee_adjusted_net_apy = aprToApy(netApr − fee_drag_%/yr) - feeDragPct(): computes annualised XLM fee drag as % of equity Uses live XLM reserve price when available, fallback $0.10 - Applied to prev-net-apr (updatePreview) and pos-net-apr / hero-net-apy (renderPosition) - Tooltip shows breakdown: net APR, drag %, rebalances, XLM price - 'Rebalances/yr' input in settings dropdown (default 12 = monthly) Persists to localStorage; updates APY display on change - Default of 12 documented in code comment Closes Dgetsylver#29
|
@legend-esc Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Include annualised XLM fee drag in displayed net APY.
Formula (from doc.md)
fee_drag_%/yr = (rebalances × 2 txs × 0.00001 XLM × xlm_price) / equity_usd × 100
fee_adjusted_net_apy = aprToApy(netApr − fee_drag_%/yr)
Changes
feeDragPct(): computes annual fee drag as % of equity.Uses live XLM reserve price when available, fallback $0.10.
Applied to
prev-net-apr(updatePreview) andpos-net-apr/hero-net-apy(renderPosition).Tooltip shows full breakdown: net APR, drag %, rebalances, XLM price.
Default: 12 (monthly). Persists to localStorage. Updates APY on change.
Acceptance criteria
blendlev_rebalances_per_year)Tested
vite build— 0 errorsCloses #29