chore: Offboard Eth2Dai [TKR-356] (#470)
* Offboard Eth2Dai * Update CHANGELOG.json
This commit is contained in:
@@ -9,6 +9,10 @@
|
||||
{
|
||||
"note": "Offboard Swerve Finance and LinkSwap",
|
||||
"pr": 469
|
||||
},
|
||||
{
|
||||
"note": "Offboard Eth2Dai",
|
||||
"pr": 470
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@@ -79,7 +79,6 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
||||
ERC20BridgeSource.Native,
|
||||
ERC20BridgeSource.Uniswap,
|
||||
ERC20BridgeSource.UniswapV2,
|
||||
ERC20BridgeSource.Eth2Dai,
|
||||
ERC20BridgeSource.Kyber,
|
||||
ERC20BridgeSource.Curve,
|
||||
ERC20BridgeSource.Balancer,
|
||||
@@ -222,7 +221,6 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
||||
ERC20BridgeSource.Native,
|
||||
ERC20BridgeSource.Uniswap,
|
||||
ERC20BridgeSource.UniswapV2,
|
||||
ERC20BridgeSource.Eth2Dai,
|
||||
ERC20BridgeSource.Kyber,
|
||||
ERC20BridgeSource.Curve,
|
||||
ERC20BridgeSource.Balancer,
|
||||
@@ -2372,7 +2370,6 @@ export const DEFAULT_GAS_SCHEDULE: Required<FeeSchedule> = {
|
||||
[ERC20BridgeSource.LiquidityProvider]: fillData => {
|
||||
return (fillData as LiquidityProviderFillData).gasCost || 100e3;
|
||||
},
|
||||
[ERC20BridgeSource.Eth2Dai]: () => 400e3,
|
||||
[ERC20BridgeSource.Kyber]: () => 450e3,
|
||||
[ERC20BridgeSource.Curve]: fillData => (fillData as CurveFillData).pool.gasSchedule,
|
||||
[ERC20BridgeSource.CurveV2]: fillData => (fillData as CurveFillData).pool.gasSchedule,
|
||||
|
@@ -111,8 +111,6 @@ export function getErc20BridgeSourceToBridgeSource(source: ERC20BridgeSource): s
|
||||
return encodeBridgeSourceId(BridgeProtocol.Mooniswap, 'Mooniswap');
|
||||
case ERC20BridgeSource.MStable:
|
||||
return encodeBridgeSourceId(BridgeProtocol.MStable, 'MStable');
|
||||
case ERC20BridgeSource.Eth2Dai:
|
||||
return encodeBridgeSourceId(BridgeProtocol.Oasis, 'Eth2Dai');
|
||||
case ERC20BridgeSource.Shell:
|
||||
return encodeBridgeSourceId(BridgeProtocol.Shell, 'Shell');
|
||||
case ERC20BridgeSource.SushiSwap:
|
||||
@@ -328,10 +326,6 @@ export function createBridgeDataForBridgeOrder(order: OptimizedMarketBridgeOrder
|
||||
const uniFillData = (order as OptimizedMarketBridgeOrder<GenericRouterFillData>).fillData;
|
||||
bridgeData = encoder.encode([uniFillData.router]);
|
||||
break;
|
||||
case ERC20BridgeSource.Eth2Dai:
|
||||
const oasisFillData = (order as OptimizedMarketBridgeOrder<GenericRouterFillData>).fillData;
|
||||
bridgeData = encoder.encode([oasisFillData.router]);
|
||||
break;
|
||||
case ERC20BridgeSource.MStable:
|
||||
const mStableFillData = (order as OptimizedMarketBridgeOrder<GenericRouterFillData>).fillData;
|
||||
bridgeData = encoder.encode([mStableFillData.router]);
|
||||
@@ -524,7 +518,6 @@ export const BRIDGE_ENCODERS: {
|
||||
[ERC20BridgeSource.Shell]: poolEncoder,
|
||||
[ERC20BridgeSource.Component]: poolEncoder,
|
||||
[ERC20BridgeSource.Mooniswap]: poolEncoder,
|
||||
[ERC20BridgeSource.Eth2Dai]: poolEncoder,
|
||||
[ERC20BridgeSource.MStable]: poolEncoder,
|
||||
[ERC20BridgeSource.Balancer]: poolEncoder,
|
||||
[ERC20BridgeSource.Cream]: poolEncoder,
|
||||
|
@@ -1350,7 +1350,7 @@ export class SamplerOperations {
|
||||
takerFillAmounts: BigNumber[],
|
||||
tokenAdjacencyGraph: TokenAdjacencyGraph = this.tokenAdjacencyGraph,
|
||||
): SourceQuoteOperation[] {
|
||||
// Find the adjacent tokens in the provided tooken adjacency graph,
|
||||
// Find the adjacent tokens in the provided token adjacency graph,
|
||||
// e.g if this is DAI->USDC we may check for DAI->WETH->USDC
|
||||
const intermediateTokens = getIntermediateTokens(makerToken, takerToken, tokenAdjacencyGraph);
|
||||
// Drop out MultiHop and Native as we do not query those here.
|
||||
@@ -1363,8 +1363,6 @@ export class SamplerOperations {
|
||||
return [];
|
||||
}
|
||||
switch (source) {
|
||||
case ERC20BridgeSource.Eth2Dai:
|
||||
return [];
|
||||
case ERC20BridgeSource.Uniswap:
|
||||
return isValidAddress(UNISWAPV1_ROUTER_BY_CHAIN_ID[this.chainId])
|
||||
? this.getUniswapSellQuotes(
|
||||
@@ -1671,8 +1669,6 @@ export class SamplerOperations {
|
||||
return _.flatten(
|
||||
_sources.map((source): SourceQuoteOperation | SourceQuoteOperation[] => {
|
||||
switch (source) {
|
||||
case ERC20BridgeSource.Eth2Dai:
|
||||
return [];
|
||||
case ERC20BridgeSource.Uniswap:
|
||||
return isValidAddress(UNISWAPV1_ROUTER_BY_CHAIN_ID[this.chainId])
|
||||
? this.getUniswapBuyQuotes(
|
||||
|
@@ -37,7 +37,6 @@ export enum ERC20BridgeSource {
|
||||
Native = 'Native',
|
||||
Uniswap = 'Uniswap',
|
||||
UniswapV2 = 'Uniswap_V2',
|
||||
Eth2Dai = 'Eth2Dai',
|
||||
Kyber = 'Kyber',
|
||||
Curve = 'Curve',
|
||||
LiquidityProvider = 'LiquidityProvider',
|
||||
|
@@ -49,7 +49,7 @@ const MAKER_TOKEN = randomAddress();
|
||||
const TAKER_TOKEN = randomAddress();
|
||||
|
||||
const DEFAULT_INCLUDED = [
|
||||
ERC20BridgeSource.Eth2Dai,
|
||||
ERC20BridgeSource.SushiSwap,
|
||||
ERC20BridgeSource.Kyber,
|
||||
ERC20BridgeSource.Native,
|
||||
ERC20BridgeSource.Uniswap,
|
||||
@@ -319,7 +319,7 @@ describe('MarketOperationUtils tests', () => {
|
||||
const DEFAULT_RATES: RatesBySource = {
|
||||
...ZERO_RATES,
|
||||
[ERC20BridgeSource.Native]: createDecreasingRates(NUM_SAMPLES),
|
||||
[ERC20BridgeSource.Eth2Dai]: createDecreasingRates(NUM_SAMPLES),
|
||||
[ERC20BridgeSource.SushiSwap]: createDecreasingRates(NUM_SAMPLES),
|
||||
[ERC20BridgeSource.Uniswap]: createDecreasingRates(NUM_SAMPLES),
|
||||
[ERC20BridgeSource.Kyber]: createDecreasingRates(NUM_SAMPLES),
|
||||
};
|
||||
@@ -383,7 +383,6 @@ describe('MarketOperationUtils tests', () => {
|
||||
[ERC20BridgeSource.DodoV2]: {},
|
||||
[ERC20BridgeSource.CryptoCom]: { tokenAddressPath: [] },
|
||||
[ERC20BridgeSource.Uniswap]: { router: randomAddress() },
|
||||
[ERC20BridgeSource.Eth2Dai]: { router: randomAddress() },
|
||||
[ERC20BridgeSource.MakerPsm]: {},
|
||||
[ERC20BridgeSource.KyberDmm]: { tokenAddressPath: [], router: randomAddress(), poolsPath: [] },
|
||||
};
|
||||
@@ -511,7 +510,7 @@ describe('MarketOperationUtils tests', () => {
|
||||
});
|
||||
|
||||
it('does not poll DEXes in `excludedSources`', async () => {
|
||||
const excludedSources = [ERC20BridgeSource.Uniswap, ERC20BridgeSource.Eth2Dai];
|
||||
const excludedSources = [ERC20BridgeSource.Uniswap, ERC20BridgeSource.SushiSwap];
|
||||
let sourcesPolled: ERC20BridgeSource[] = [];
|
||||
replaceSamplerOps({
|
||||
getSellQuotes: (sources, makerToken, takerToken, amounts, wethAddress) => {
|
||||
@@ -541,7 +540,7 @@ describe('MarketOperationUtils tests', () => {
|
||||
});
|
||||
|
||||
it('only polls DEXes in `includedSources`', async () => {
|
||||
const includedSources = [ERC20BridgeSource.Uniswap, ERC20BridgeSource.Eth2Dai];
|
||||
const includedSources = [ERC20BridgeSource.Uniswap, ERC20BridgeSource.SushiSwap];
|
||||
let sourcesPolled: ERC20BridgeSource[] = [];
|
||||
replaceSamplerOps({
|
||||
getSellQuotes: (sources, makerToken, takerToken, amounts, wethAddress) => {
|
||||
@@ -1034,7 +1033,7 @@ describe('MarketOperationUtils tests', () => {
|
||||
const rates: RatesBySource = { ...DEFAULT_RATES };
|
||||
rates[ERC20BridgeSource.Native] = [0.4, 0.3, 0.2, 0.1];
|
||||
rates[ERC20BridgeSource.Uniswap] = [0.5, 0.05, 0.05, 0.05];
|
||||
rates[ERC20BridgeSource.Eth2Dai] = [0.6, 0.05, 0.05, 0.05];
|
||||
rates[ERC20BridgeSource.SushiSwap] = [0.6, 0.05, 0.05, 0.05];
|
||||
rates[ERC20BridgeSource.Kyber] = [0, 0, 0, 0]; // unused
|
||||
replaceSamplerOps({
|
||||
getSellQuotes: createGetMultipleSellQuotesOperationFromRates(rates),
|
||||
@@ -1048,7 +1047,7 @@ describe('MarketOperationUtils tests', () => {
|
||||
const improvedOrders = improvedOrdersResponse.optimizedOrders;
|
||||
const orderSources = improvedOrders.map(o => o.fills[0].source);
|
||||
const expectedSources = [
|
||||
ERC20BridgeSource.Eth2Dai,
|
||||
ERC20BridgeSource.SushiSwap,
|
||||
ERC20BridgeSource.Uniswap,
|
||||
ERC20BridgeSource.Native,
|
||||
ERC20BridgeSource.Native,
|
||||
@@ -1066,7 +1065,7 @@ describe('MarketOperationUtils tests', () => {
|
||||
const rates: RatesBySource = {
|
||||
[ERC20BridgeSource.Native]: [1, 0.99, 0.98, 0.97], // Effectively [0.94, 0.93, 0.92, 0.91]
|
||||
[ERC20BridgeSource.Uniswap]: [0.96, 0.1, 0.1, 0.1],
|
||||
[ERC20BridgeSource.Eth2Dai]: [0.95, 0.1, 0.1, 0.1],
|
||||
[ERC20BridgeSource.SushiSwap]: [0.95, 0.1, 0.1, 0.1],
|
||||
[ERC20BridgeSource.Kyber]: [0.1, 0.1, 0.1, 0.1],
|
||||
};
|
||||
const feeSchedule = {
|
||||
@@ -1091,7 +1090,7 @@ describe('MarketOperationUtils tests', () => {
|
||||
const expectedSources = [
|
||||
ERC20BridgeSource.Native,
|
||||
ERC20BridgeSource.Uniswap,
|
||||
ERC20BridgeSource.Eth2Dai,
|
||||
ERC20BridgeSource.SushiSwap,
|
||||
ERC20BridgeSource.Native,
|
||||
];
|
||||
expect(orderSources.sort()).to.deep.eq(expectedSources.sort());
|
||||
@@ -1104,7 +1103,7 @@ describe('MarketOperationUtils tests', () => {
|
||||
const rates: RatesBySource = {
|
||||
[ERC20BridgeSource.Native]: [0.95, 0.1, 0.1, 0.1],
|
||||
[ERC20BridgeSource.Kyber]: [0.1, 0.1, 0.1, 0.1],
|
||||
[ERC20BridgeSource.Eth2Dai]: [0.92, 0.1, 0.1, 0.1],
|
||||
[ERC20BridgeSource.SushiSwap]: [0.92, 0.1, 0.1, 0.1],
|
||||
// Effectively [0.8, ~0.5, ~0, ~0]
|
||||
[ERC20BridgeSource.Uniswap]: [1, 0.7, 0.2, 0.2],
|
||||
};
|
||||
@@ -1129,7 +1128,7 @@ describe('MarketOperationUtils tests', () => {
|
||||
const orderSources = improvedOrders.map(o => o.fills[0].source);
|
||||
const expectedSources = [
|
||||
ERC20BridgeSource.Native,
|
||||
ERC20BridgeSource.Eth2Dai,
|
||||
ERC20BridgeSource.SushiSwap,
|
||||
ERC20BridgeSource.Uniswap,
|
||||
];
|
||||
expect(orderSources.sort()).to.deep.eq(expectedSources.sort());
|
||||
@@ -1138,7 +1137,7 @@ describe('MarketOperationUtils tests', () => {
|
||||
it('can mix one concave source', async () => {
|
||||
const rates: RatesBySource = {
|
||||
[ERC20BridgeSource.Kyber]: [0, 0, 0, 0], // Won't use
|
||||
[ERC20BridgeSource.Eth2Dai]: [0.5, 0.85, 0.75, 0.75], // Concave
|
||||
[ERC20BridgeSource.SushiSwap]: [0.5, 0.85, 0.75, 0.75], // Concave
|
||||
[ERC20BridgeSource.Uniswap]: [0.96, 0.2, 0.1, 0.1],
|
||||
[ERC20BridgeSource.Native]: [0.95, 0.2, 0.2, 0.1],
|
||||
};
|
||||
@@ -1155,7 +1154,7 @@ describe('MarketOperationUtils tests', () => {
|
||||
const improvedOrders = improvedOrdersResponse.optimizedOrders;
|
||||
const orderSources = improvedOrders.map(o => o.fills[0].source);
|
||||
const expectedSources = [
|
||||
ERC20BridgeSource.Eth2Dai,
|
||||
ERC20BridgeSource.SushiSwap,
|
||||
ERC20BridgeSource.Uniswap,
|
||||
ERC20BridgeSource.Native,
|
||||
];
|
||||
@@ -1168,7 +1167,7 @@ describe('MarketOperationUtils tests', () => {
|
||||
const rates: RatesBySource = {};
|
||||
rates[ERC20BridgeSource.Native] = [1, 1, 0.01, 0.01];
|
||||
rates[ERC20BridgeSource.Uniswap] = [1, 1, 0.01, 0.01];
|
||||
rates[ERC20BridgeSource.Eth2Dai] = [0.49, 0.49, 0.49, 0.49];
|
||||
rates[ERC20BridgeSource.SushiSwap] = [0.49, 0.49, 0.49, 0.49];
|
||||
rates[ERC20BridgeSource.Kyber] = [0.35, 0.2, 0.01, 0.01];
|
||||
replaceSamplerOps({
|
||||
getSellQuotes: createGetMultipleSellQuotesOperationFromRates(rates),
|
||||
@@ -1363,7 +1362,7 @@ describe('MarketOperationUtils tests', () => {
|
||||
});
|
||||
|
||||
it('does not poll DEXes in `excludedSources`', async () => {
|
||||
const excludedSources = [ERC20BridgeSource.Uniswap, ERC20BridgeSource.Eth2Dai];
|
||||
const excludedSources = [ERC20BridgeSource.Uniswap, ERC20BridgeSource.SushiSwap];
|
||||
let sourcesPolled: ERC20BridgeSource[] = [];
|
||||
replaceSamplerOps({
|
||||
getBuyQuotes: (sources, makerToken, takerToken, amounts, wethAddress) => {
|
||||
@@ -1393,7 +1392,7 @@ describe('MarketOperationUtils tests', () => {
|
||||
});
|
||||
|
||||
it('only polls DEXes in `includedSources`', async () => {
|
||||
const includedSources = [ERC20BridgeSource.Uniswap, ERC20BridgeSource.Eth2Dai];
|
||||
const includedSources = [ERC20BridgeSource.Uniswap, ERC20BridgeSource.SushiSwap];
|
||||
let sourcesPolled: ERC20BridgeSource[] = [];
|
||||
replaceSamplerOps({
|
||||
getBuyQuotes: (sources, makerToken, takerToken, amounts, wethAddress) => {
|
||||
@@ -1485,7 +1484,7 @@ describe('MarketOperationUtils tests', () => {
|
||||
const rates: RatesBySource = { ...ZERO_RATES };
|
||||
rates[ERC20BridgeSource.Native] = [0.4, 0.3, 0.2, 0.1];
|
||||
rates[ERC20BridgeSource.Uniswap] = [0.5, 0.05, 0.05, 0.05];
|
||||
rates[ERC20BridgeSource.Eth2Dai] = [0.6, 0.05, 0.05, 0.05];
|
||||
rates[ERC20BridgeSource.SushiSwap] = [0.6, 0.05, 0.05, 0.05];
|
||||
replaceSamplerOps({
|
||||
getBuyQuotes: createGetMultipleBuyQuotesOperationFromRates(rates),
|
||||
});
|
||||
@@ -1498,7 +1497,7 @@ describe('MarketOperationUtils tests', () => {
|
||||
const improvedOrders = improvedOrdersResponse.optimizedOrders;
|
||||
const orderSources = improvedOrders.map(o => o.fills[0].source);
|
||||
const expectedSources = [
|
||||
ERC20BridgeSource.Eth2Dai,
|
||||
ERC20BridgeSource.SushiSwap,
|
||||
ERC20BridgeSource.Uniswap,
|
||||
ERC20BridgeSource.Native,
|
||||
ERC20BridgeSource.Native,
|
||||
@@ -1517,7 +1516,7 @@ describe('MarketOperationUtils tests', () => {
|
||||
...ZERO_RATES,
|
||||
[ERC20BridgeSource.Native]: [1, 0.99, 0.98, 0.97], // Effectively [0.94, ~0.93, ~0.92, ~0.91]
|
||||
[ERC20BridgeSource.Uniswap]: [0.96, 0.1, 0.1, 0.1],
|
||||
[ERC20BridgeSource.Eth2Dai]: [0.95, 0.1, 0.1, 0.1],
|
||||
[ERC20BridgeSource.SushiSwap]: [0.95, 0.1, 0.1, 0.1],
|
||||
[ERC20BridgeSource.Kyber]: [0.1, 0.1, 0.1, 0.1],
|
||||
};
|
||||
const feeSchedule = {
|
||||
@@ -1541,7 +1540,7 @@ describe('MarketOperationUtils tests', () => {
|
||||
const orderSources = improvedOrders.map(o => o.fills[0].source);
|
||||
const expectedSources = [
|
||||
ERC20BridgeSource.Uniswap,
|
||||
ERC20BridgeSource.Eth2Dai,
|
||||
ERC20BridgeSource.SushiSwap,
|
||||
ERC20BridgeSource.Native,
|
||||
ERC20BridgeSource.Native,
|
||||
];
|
||||
@@ -1557,7 +1556,7 @@ describe('MarketOperationUtils tests', () => {
|
||||
[ERC20BridgeSource.Native]: [0.95, 0.1, 0.1, 0.1],
|
||||
// Effectively [0.8, ~0.5, ~0, ~0]
|
||||
[ERC20BridgeSource.Uniswap]: [1, 0.7, 0.2, 0.2],
|
||||
[ERC20BridgeSource.Eth2Dai]: [0.92, 0.1, 0.1, 0.1],
|
||||
[ERC20BridgeSource.SushiSwap]: [0.92, 0.1, 0.1, 0.1],
|
||||
};
|
||||
const feeSchedule = {
|
||||
[ERC20BridgeSource.Uniswap]: _.constant(
|
||||
@@ -1580,7 +1579,7 @@ describe('MarketOperationUtils tests', () => {
|
||||
const orderSources = improvedOrders.map(o => o.fills[0].source);
|
||||
const expectedSources = [
|
||||
ERC20BridgeSource.Native,
|
||||
ERC20BridgeSource.Eth2Dai,
|
||||
ERC20BridgeSource.SushiSwap,
|
||||
ERC20BridgeSource.Uniswap,
|
||||
];
|
||||
expect(orderSources.sort()).to.deep.eq(expectedSources.sort());
|
||||
@@ -1592,7 +1591,7 @@ describe('MarketOperationUtils tests', () => {
|
||||
const rates: RatesBySource = { ...ZERO_RATES };
|
||||
rates[ERC20BridgeSource.Native] = [1, 1, 0.01, 0.01];
|
||||
rates[ERC20BridgeSource.Uniswap] = [1, 1, 0.01, 0.01];
|
||||
rates[ERC20BridgeSource.Eth2Dai] = [0.49, 0.49, 0.49, 0.49];
|
||||
rates[ERC20BridgeSource.SushiSwap] = [0.49, 0.49, 0.49, 0.49];
|
||||
replaceSamplerOps({
|
||||
getBuyQuotes: createGetMultipleBuyQuotesOperationFromRates(rates),
|
||||
});
|
||||
|
Reference in New Issue
Block a user