Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Range Bond Price and UX Improvements #2491

Merged
merged 5 commits into from
Dec 13, 2022
Merged

Conversation

brightiron
Copy link
Contributor

@brightiron brightiron commented Dec 10, 2022

New Features

  • Display ‘Current Price’ as price from our Balancer LP instead of the currentPrice from the range price contract. This would bring this view consistent with the market price displayed on the bond view. The ‘historical’ data on the chart will still use the chainlink feed, but the current price dot and the “current price” in the tooltip will display our balancer LP price. 

  • Default to Sell View if current price is below the start of the lower cushion. Otherwise, default to the buy view.
  • Route orders to operator (wall) if bondPrice is below lower wall or above upper wall. This will produce a more desirable trade in most scenarios. A user can still interact directly with the bond markets via the bond page if they desire.



Other General Improvements:

  • Bring consistency to discount calculations displayed on bond view and range view. These will now be exactly the same when a bond market is live.
  • RangeChart. Fix formatting on Y Axis (overflow). Improve timestamp on X axis
  • move away from .toString({decimals}) for bond percentage discounts. It trims and does not round.
  • use useV3Bond hook for pulling rangeBond data instead of previously implemented hooks specific to range. These existed only because we hadn't deployed v3 bonds yet and was keeping everything isolated to the range section. Discrepancies in discount percent sometimes existed due to minor rounding errors in the different implementations.
  • useV3Bond should use .div on a BigNumber instead of / on a Number to prevent potential underflow.

I'd like to dry run this with Oighty on testnet contracts to double check all states are handled correctly after these changes.

@github-actions
Copy link

github-actions bot commented Dec 10, 2022

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements
89.18% (-0.06% 🔻)
45859/51422
🟢 Branches
80.46% (-0.05% 🔻)
1680/2088
🟡 Functions
62.06% (+0.02% 🔼)
813/1310
🟢 Lines
89.18% (-0.06% 🔻)
45859/51422
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢 hooks/useBalance.ts
98.92% (-1.08% 🔻)
96.67% (-3.33% 🔻)
100%
98.92% (-1.08% 🔻)
🟡
... / useBondV3.ts
68.49% (-7.67% 🔻)
50% (+22.22% 🔼)
100% (+33.33% 🔼)
68.49% (-7.67% 🔻)
🔴
... / RangeChart.tsx
33.57% (-0.86% 🔻)
25% (-50% 🔻)
20%
33.57% (-0.86% 🔻)
🟢
... / hooks.tsx
82.14% (-2.47% 🔻)
80% (-3.33% 🔻)
87.1% (-3.81% 🔻)
82.14% (-2.47% 🔻)
🟢
... / index.tsx
97.76% (-1.5% 🔻)
93.51% (-1.56% 🔻)
100%
97.76% (-1.5% 🔻)

Test suite run success

150 tests passing in 87 suites.

Report generated by 🧪jest coverage report action from 81c1160

Copy link
Contributor

@appleseed-iii appleseed-iii left a comment

Choose a reason for hiding this comment

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

looks good let me know after you've dry-run it with oighty

@brightiron
Copy link
Contributor Author

going to surface this in the RBS launch channel too. just for more eyeballs.

@appleseed-iii appleseed-iii merged commit 8be8541 into develop Dec 13, 2022
@appleseed-iii appleseed-iii deleted the rangeBondPriceImprovements branch December 13, 2022 15:52
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.

2 participants