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 Inverted Quoter for AMO fork test. #2210

Merged
merged 31 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d29dc6f
feat: add inverted quoter for rebalancing.
clement-ux Aug 29, 2024
4e9d161
test: use quoter for AMO rebalancing.
clement-ux Aug 29, 2024
8810a77
chore: increase gas limit for test for AMO quoter.
clement-ux Aug 29, 2024
5e7df11
fix: remove arguments from quoter call.
clement-ux Aug 30, 2024
9b91a6a
fix: set strategist back to origin strategist for quoter.
clement-ux Aug 31, 2024
585b40a
feat: add AMO quoter for `amountToSwapToReachPrice`.
clement-ux Aug 31, 2024
4390da3
feat: add quoter for moving price in AMO tests and upgrade swap funct…
clement-ux Aug 31, 2024
aea2198
docs: add descriptions to functions.
clement-ux Sep 4, 2024
bf51ef9
feat: add `overrideWethShare` on `quoteAmountToSwapBeforeRebalance`.
clement-ux Sep 4, 2024
c502ed6
fix: use dictionnary syntax to call function that has same name as an…
clement-ux Sep 4, 2024
7383e79
fix: increase max iteration for quoter.
clement-ux Sep 9, 2024
ffa2d8e
fix: failling test.
clement-ux Sep 9, 2024
280f6b4
fix: move AMOQuoter to fixture.
clement-ux Sep 11, 2024
8abb412
feat: add more comments.
clement-ux Sep 11, 2024
3e076b9
fix: rethink variance calculation for AMO Quoter.
clement-ux Sep 11, 2024
a4d585b
fix: give more WETH at start and simplifies swap.
clement-ux Sep 11, 2024
ef2bf26
fix: remove unused import.
clement-ux Sep 11, 2024
2d663be
fix: _minTokenReceived is 99% of amountToSwap.
clement-ux Sep 11, 2024
80d115b
fix: refactor % comparison.
clement-ux Sep 11, 2024
6b72dc9
fix: change public into internal.
clement-ux Sep 16, 2024
944bb28
fix: adjust quoteAmountToSwapBeforeRebalance for custom shares.
clement-ux Sep 16, 2024
26035cc
fix: split boundaries for quoter.
clement-ux Sep 16, 2024
ea44472
fix: fetch governor before impersonning.
clement-ux Sep 16, 2024
d6d386a
fix: increase tolereance eth remaining in AMO after withdraw.
clement-ux Sep 16, 2024
aa3bb5b
fix: fix failing test and add description.
clement-ux Sep 16, 2024
29c18b5
fix: add doc for edge case in withdraw.
clement-ux Sep 17, 2024
f1c84b0
Merge branch 'master' into clement/add-quoter-for-AMO-fork-tests
clement-ux Sep 18, 2024
10e1ba8
fix: adjust test with latest values.
clement-ux Sep 18, 2024
920099b
Merge remote-tracking branch 'origin/master' into clement/add-quoter-…
sparrowDom Sep 24, 2024
8dce05e
Fix issues with fork testing (#2255)
sparrowDom Sep 30, 2024
d146df8
Merge remote-tracking branch 'origin/master' into clement/add-quoter-…
sparrowDom Sep 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions contracts/contracts/interfaces/aerodrome/IAMOStrategy.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

import { ICLPool } from "./ICLPool.sol";

interface IAMOStrategy {
error NotEnoughWethForSwap(uint256 wethBalance, uint256 requiredWeth);
error NotEnoughWethLiquidity(uint256 wethBalance, uint256 requiredWeth);
error PoolRebalanceOutOfBounds(
uint256 currentPoolWethShare,
uint256 allowedWethShareStart,
uint256 allowedWethShareEnd
);
error OutsideExpectedTickRange(int24 currentTick);

function governor() external view returns (address);

function rebalance(
uint256 _amountToSwap,
bool _swapWeth,
uint256 _minTokenReceived
) external;

function clPool() external view returns (ICLPool);

function vaultAddress() external view returns (address);

function poolWethShareVarianceAllowed() external view returns (uint256);

function poolWethShare() external view returns (uint256);

function tokenId() external view returns (uint256);

function withdrawAll() external;

function setAllowedPoolWethShareInterval(
uint256 _allowedWethShareStart,
uint256 _allowedWethShareEnd
) external;

function setWithdrawLiquidityShare(uint128 share) external;

function lowerTick() external view returns (int24);

function upperTick() external view returns (int24);

function getPoolX96Price() external view returns (uint160 _sqrtRatioX96);

function sqrtRatioX96TickLower() external view returns (uint160);

function sqrtRatioX96TickHigher() external view returns (uint160);

function tickSpacing() external view returns (int24);
}
Loading
Loading