Add Trader Joe V2 Mixin to Avalanche BridgeAdapter (#686)

* Add Trader Joe V2 Mixin to Avalanche BridgeAdapter

* Add TraderJoeV2 MixIn tests

* update forked function signatures

* Update Avalanche FQT address to reflect Trader Joe V2 MixIn

* Update CHANGELOG
This commit is contained in:
Savarn Dontamsetti (Sav)
2023-04-20 12:48:21 +09:00
committed by GitHub
parent ff104e7505
commit b483805a22
12 changed files with 307 additions and 55 deletions

View File

@@ -88,10 +88,13 @@ struct TokenAddresses {
IEtherToken WrappedNativeToken;
}
// keep the names of the struct members in alphabetical order for correct json unparsing
struct LiquiditySources {
address KyberElasticPool;
address KyberElasticQuoter;
address KyberElasticRouter;
address TraderJoeV2Pool;
address TraderJoeV2Router;
address UniswapV2Router;
address UniswapV3Router;
}
@@ -100,6 +103,37 @@ interface IFQT {
function bridgeAdapter() external returns (address);
}
interface ITraderJoeV2Pool {
struct FeeParameters {
// 144 lowest bits in slot
uint16 binStep;
uint16 baseFactor;
uint16 filterPeriod;
uint16 decayPeriod;
uint16 reductionFactor;
uint24 variableFeeControl;
uint16 protocolShare;
uint24 maxVolatilityAccumulated;
// 112 highest bits in slot
uint24 volatilityAccumulated;
uint24 volatilityReference;
uint24 indexRef;
uint40 time;
}
function feeParameters() external view returns (FeeParameters memory);
function tokenY() external view returns (address);
}
interface ITraderJoeV2Router {
function getSwapOut(
address pool,
uint256 amountIn,
bool swapForY
) external view returns (uint256 amountOut, uint256 feesIn);
}
interface IKyberElasticQuoter {
function quoteExactInput(
bytes memory path,