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

feat: Modified Dynamic Fee Handlers with twap oracle #236

Merged
merged 13 commits into from
May 2, 2024

Conversation

andersonlee725
Copy link
Collaborator

@andersonlee725 andersonlee725 commented Apr 18, 2024

Modified Dynamic Fee Handlers calculate the fee in the native coin based on the twap oracle.

Description

Created a twap oracle using Uniswap V3.
In the Dynamic Fee Handlers, calculate the tx cost fee of the destination chain and the fee is converted to the amount in the native coin of the resource chain.
For converting, the twap oracle is used.

Related Issue Or Context

Closes: #

How Has This Been Tested? Testing details.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation

Checklist:

  • I have commented my code, particularly in hard-to-understand areas.
  • I have ensured that all acceptance criteria (or expected behavior) from issue are met
  • I have updated the documentation locally and in chainbridge-docs.
  • I have added tests to cover my changes.
  • I have ensured that all the checks are passing and green, I've signed the CLA bot

contracts/handlers/fee/V2/TwapOracle.sol Outdated Show resolved Hide resolved
contracts/handlers/fee/V2/TwapOracle.sol Outdated Show resolved Hide resolved
contracts/handlers/fee/V2/TwapOracle.sol Outdated Show resolved Hide resolved
contracts/handlers/fee/V2/TwapOracle.sol Outdated Show resolved Hide resolved
contracts/handlers/fee/V2/TwapOracle.sol Outdated Show resolved Hide resolved
contracts/handlers/fee/V2/DynamicFeeHandlerV2.sol Outdated Show resolved Hide resolved
contracts/handlers/fee/V2/DynamicERC20FeeHandlerEVM.sol Outdated Show resolved Hide resolved
contracts/handlers/fee/V2/DynamicGenericFeeHandlerEVM.sol Outdated Show resolved Hide resolved
contracts/handlers/fee/V2/DynamicFeeHandlerV2.sol Outdated Show resolved Hide resolved
contracts/handlers/fee/V2/DynamicFeeHandlerV2.sol Outdated Show resolved Hide resolved
Copy link
Contributor

@lastperson lastperson left a comment

Choose a reason for hiding this comment

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

Need to account for possibility where there is no destination domain wrap pool available. In such case it should be possible to manually set the price rate.

contracts/handlers/fee/V2/DynamicFeeHandlerV2.sol Outdated Show resolved Hide resolved
contracts/handlers/fee/V2/DynamicFeeHandlerV2.sol Outdated Show resolved Hide resolved
contracts/handlers/fee/V2/TwapOracle.sol Outdated Show resolved Hide resolved
contracts/handlers/fee/V2/TwapOracle.sol Outdated Show resolved Hide resolved
contracts/handlers/fee/V2/TwapOracle.sol Outdated Show resolved Hide resolved
contracts/utils/TickMath.sol Show resolved Hide resolved
@andersonlee725 andersonlee725 changed the title Modified Dynamic Fee Handlers with twap oracle feat: Modified Dynamic Fee Handlers with twap oracle Apr 29, 2024
@nmlinaric nmlinaric merged commit 45ad376 into master May 2, 2024
5 checks passed
@nmlinaric nmlinaric deleted the anderson/dynamic-fee-handler branch May 2, 2024 08:42
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.

4 participants