origin-dollar icon indicating copy to clipboard operation
origin-dollar copied to clipboard

WOETH yield buckets

Open sparrowDom opened this issue 1 year ago • 2 comments

This is the third attempt at the implementation of limiting the yield increase and, consequen the exchange rate between WOETH and OETH. The other 2:

  • https://github.com/OriginProtocol/origin-dollar/pull/2106
  • https://github.com/OriginProtocol/origin-dollar/pull/2421

This approach:

  • does the internal accounting of credits the same way https://github.com/OriginProtocol/origin-dollar/pull/2106 does it
  • the WOETH exchange rate is in sync with OETH yield as long as it doesn't surpass the 91% yearly yield rate. In such case the yield is delayed and will be distributed over the next yield period. Which lasts 23 hours
  • similarly to https://github.com/OriginProtocol/origin-dollar/pull/2421 this PR requires interaction with the contract in order to increase the exchange rate / start new yield period by calling increaseYieldLimit()

To be completed before internal review begins:

  • [ ] The contract code is complete
  • [ ] Executable deployment file
  • [ ] Fork tests that test after the deployment file runs
  • [ ] Unit tests *if needed
  • [ ] The owner has done a full checklist review of the code + tests

Internal review:

  • [ ] Two approvals by internal reviewers

sparrowDom avatar Mar 17 '25 22:03 sparrowDom

Warnings
:warning: :eyes: This PR needs at least 2 reviewers

Generated by :no_entry_sign: dangerJS against b68269df644f05a6329c1ee260fd334733e972a0

github-actions[bot] avatar Mar 17 '25 22:03 github-actions[bot]

Codecov Report

Attention: Patch coverage is 84.21053% with 3 lines in your changes missing coverage. Please review.

Please upload report for BASE (sparrowDom/woeth_hack_proof@79af39f). Learn more about missing BASE report.

Files with missing lines Patch % Lines
contracts/contracts/token/WOETH.sol 84.21% 3 Missing :warning:
Additional details and impacted files
@@                      Coverage Diff                       @@
##             sparrowDom/woeth_hack_proof    #2447   +/-   ##
==============================================================
  Coverage                               ?   47.22%           
==============================================================
  Files                                  ?      100           
  Lines                                  ?     4898           
  Branches                               ?     1294           
==============================================================
  Hits                                   ?     2313           
  Misses                                 ?     2581           
  Partials                               ?        4           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Mar 17 '25 22:03 codecov[bot]

closing in favour of this one: https://github.com/OriginProtocol/origin-dollar/pull/2453

sparrowDom avatar Apr 10 '25 08:04 sparrowDom