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

add multiblock rt test #365

Merged
merged 7 commits into from
Jun 17, 2023
Merged

add multiblock rt test #365

merged 7 commits into from
Jun 17, 2023

Conversation

jrhea
Copy link
Contributor

@jrhea jrhea commented Jun 16, 2023

Added a test for this scenario:

  • user opens a long right before checkpoint boundary
  • waits a block
  • then closes long

the test shows that this isn't profitable in the following conditions:

  • position duration: 1 year
  • checkpoint length: 1 day
  • aprs ranging from: 0.1% to 40%

With the following fees

  • curve: 5% of APR
  • flat: 5 bps

@coveralls
Copy link
Collaborator

coveralls commented Jun 16, 2023

Coverage Status

coverage: 94.348%. remained the same when pulling 007c284 on multiblock-test into 2105408 on main.

@jrhea jrhea force-pushed the multiblock-test branch 3 times, most recently from 030cc88 to 68d996b Compare June 16, 2023 22:54
@github-actions
Copy link

github-actions bot commented Jun 16, 2023

Hyperdrive Gas Benchmark

Benchmark suite Current: 007c284 Previous: 2105408 Deviation Status
addLiquidity: min 687 gas 687 gas 0% 🟰
addLiquidity: avg 48084 gas 48084 gas 0% 🟰
addLiquidity: max 83536 gas 83536 gas 0% 🟰
checkpoint: min 514 gas 514 gas 0% 🟰
checkpoint: avg 23022 gas 23022 gas 0% 🟰
checkpoint: max 33418 gas 33418 gas 0% 🟰
closeLong: min 659 gas 659 gas 0% 🟰
closeLong: avg 46419 gas 46419 gas 0% 🟰
closeLong: max 81328 gas 81328 gas 0% 🟰
closeShort: min 616 gas 616 gas 0% 🟰
closeShort: avg 40968 gas 40499 gas 1.1581% 🚨
closeShort: max 81627 gas 81627 gas 0% 🟰
initialize: min 687 gas 687 gas 0% 🟰
initialize: avg 139493 gas 139483 gas 0.0072% 🚨
initialize: max 140690 gas 140690 gas 0% 🟰
openLong: min 661 gas 661 gas 0% 🟰
openLong: avg 105064 gas 101604 gas 3.4054% 🚨
openLong: max 148646 gas 148646 gas 0% 🟰
openShort: min 687 gas 687 gas 0% 🟰
openShort: avg 138172 gas 142473 gas -3.0188%
openShort: max 207735 gas 207735 gas 0% 🟰
removeLiquidity: min 547 gas 547 gas 0% 🟰
removeLiquidity: avg 60194 gas 59732 gas 0.7735% 🚨
removeLiquidity: max 116344 gas 116344 gas 0% 🟰

This comment was automatically generated by workflow using github-action-benchmark.

@jrhea jrhea marked this pull request as ready for review June 16, 2023 23:06
@jrhea jrhea requested a review from jalextowle June 16, 2023 23:16
@jrhea jrhea added the testing label Jun 16, 2023
Copy link
Contributor

@jalextowle jalextowle left a comment

Choose a reason for hiding this comment

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

This looks good to me.

@jrhea jrhea merged commit a3b0765 into main Jun 17, 2023
@jrhea jrhea deleted the multiblock-test branch June 17, 2023 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants