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: use automatic routing #531

Merged
merged 68 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
06c2ff7
feat: use automatic routing
KirillDogadin-std Nov 10, 2022
1a13592
improvements
KirillDogadin-std Nov 11, 2022
ca21a62
lint
KirillDogadin-std Nov 11, 2022
85d58e3
rename
KirillDogadin-std Nov 11, 2022
9820bcc
pools generated, route ignored
KirillDogadin-std Nov 11, 2022
b69041d
rm usesess block of code
KirillDogadin-std Nov 11, 2022
6c8481e
add dai to pools
KirillDogadin-std Nov 11, 2022
5d812be
lint
KirillDogadin-std Nov 11, 2022
1ee2f0e
rm useless arg
KirillDogadin-std Nov 11, 2022
6bab52a
rm useless comment
KirillDogadin-std Nov 11, 2022
a776b77
imporve
KirillDogadin-std Nov 11, 2022
6a7d437
refactor: only v3 is affected
KirillDogadin-std Nov 11, 2022
6169244
fix prev functionality
KirillDogadin-std Nov 11, 2022
81859b0
latest
KirillDogadin-std Nov 14, 2022
c354a73
explicitly defined the chain id
KirillDogadin-std Nov 15, 2022
d441c42
improve chain id arg
KirillDogadin-std Nov 15, 2022
c5c6c01
lint
KirillDogadin-std Nov 15, 2022
26c5d5e
Merge remote-tracking branch 'origin/main' into multi-callee
KirillDogadin-std Nov 15, 2022
70c954f
Use the quote if awailable
KirillDogadin-std Nov 15, 2022
87dfced
Demo of too long test
KirillDogadin-std Nov 15, 2022
0c06187
Revert "Demo of too long test"
valiafetisov Nov 17, 2022
b2decf4
Merge branch 'main' into multi-callee
valiafetisov Nov 17, 2022
2cfe37e
Merge branch 'main' into multi-callee
valiafetisov Nov 17, 2022
5ee3d39
fix autorouter info on the dashboard
valiafetisov Nov 17, 2022
c0f6ad0
adjust typing to more optimal;
KirillDogadin-std Nov 23, 2022
eb52d1b
use the preloaded pools
KirillDogadin-std Nov 23, 2022
8d87f08
seems to work
KirillDogadin-std Nov 28, 2022
f7c745e
fix frontend typing
KirillDogadin-std Nov 28, 2022
ab0f839
This line was problematic
KirillDogadin-std Nov 28, 2022
3d1d528
use fees
KirillDogadin-std Nov 28, 2022
49d6788
lint
KirillDogadin-std Nov 28, 2022
94a6e6d
fix: frontend generate fake auction
KirillDogadin-std Nov 28, 2022
86e5988
Merge branch 'main' into multi-callee
KirillDogadin-std Nov 28, 2022
40420fe
hardcode fake pools
KirillDogadin-std Nov 28, 2022
a4fd7a2
lint
KirillDogadin-std Nov 28, 2022
f75d338
as above
KirillDogadin-std Nov 28, 2022
3337a56
fix: remove autorouter during tests
KirillDogadin-std Nov 29, 2022
10fb6c0
upd: hardhat
KirillDogadin-std Nov 29, 2022
f74531a
adjust test command
KirillDogadin-std Nov 29, 2022
41a4138
quickie patch with enabling and disabling of the autorouter
KirillDogadin-std Nov 30, 2022
9cbe6a0
spin the icon if no value
KirillDogadin-std Nov 30, 2022
e921cfe
caching for the sake of performance
KirillDogadin-std Nov 30, 2022
bd5253d
refactor: use `NODE_ENV=test` to let know that test is running
KirillDogadin-std Dec 1, 2022
5689a41
Throw if preloaded pools are not present in crvlp1
KirillDogadin-std Dec 1, 2022
6b7c41a
as above for several other callees
KirillDogadin-std Dec 1, 2022
64a00ff
feat: stricter typing
KirillDogadin-std Dec 1, 2022
e958161
refactor: dont check for autorouter being enabled for curvelp callee
KirillDogadin-std Dec 1, 2022
671c0e3
as above for reth callee
KirillDogadin-std Dec 1, 2022
300bac2
refactor: extract pool generation call to the higher level
KirillDogadin-std Dec 1, 2022
33844b1
refactor: caching and minor frontend adjustments
KirillDogadin-std Dec 1, 2022
04011c9
fix: lint
KirillDogadin-std Dec 1, 2022
77bc448
refactor: i removed the wrong caching 😭
KirillDogadin-std Dec 1, 2022
011292d
feat: add autorouters everywhere
KirillDogadin-std Dec 1, 2022
44e2dc7
refactor: avoid comparing by name
KirillDogadin-std Dec 1, 2022
8383784
fix: build core
KirillDogadin-std Dec 1, 2022
344daad
fix: wait longer before vault liquidation in the test
KirillDogadin-std Dec 1, 2022
8da5335
fix: ui enable button
KirillDogadin-std Dec 1, 2022
4a46d32
fix: frontend
KirillDogadin-std Dec 1, 2022
0618459
adjust the import
KirillDogadin-std Dec 1, 2022
7a0ccfc
fix _getMarketPrice export
valiafetisov Dec 1, 2022
eed3c37
hardcode block number in the past
valiafetisov Dec 1, 2022
76f647d
Merge branch 'main' into multi-callee
KirillDogadin-std Dec 1, 2022
f2861a3
fix: route generation
KirillDogadin-std Dec 5, 2022
923522f
Merge branch 'main' into multi-callee
valiafetisov Dec 5, 2022
c250c8f
fix console error from upstream
valiafetisov Dec 5, 2022
4ff3d92
reorder simulations
valiafetisov Dec 5, 2022
1a887f5
fix MarketPriceSelection enable button
valiafetisov Dec 5, 2022
cc8dfb7
properly pass fees to the get pools
valiafetisov Dec 5, 2022
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
7 changes: 6 additions & 1 deletion core/src/auctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type {
TakeEvent,
MarketData,
ExchangeFees,
Pool,
} from './types';
import BigNumber from './bignumber';
import fetchAuctionsByCollateralType, {
Expand Down Expand Up @@ -128,6 +129,9 @@ export const enrichMarketDataRecordsWithValues = async function (
...enrichedMarketDataRecords,
[marketId]: { ...marketData },
};
if (marketData) {

}
}
return enrichedMarketDataRecords;
};
Expand Down Expand Up @@ -335,10 +339,11 @@ export const bidWithCallee = async function (
auction: Auction,
marketId: string,
profitAddress: string,
pools?: Pool[],
notifier?: Notifier
): Promise<string> {
const calleeAddress = getCalleeAddressByCollateralType(network, auction.collateralType, marketId);
const calleeData = await getCalleeData(network, auction.collateralType, marketId, profitAddress);
const calleeData = await getCalleeData(network, auction.collateralType, marketId, profitAddress, pools);
const contractName = getClipperNameByCollateralType(auction.collateralType);
const contractParameters = [
convertNumberTo32Bytes(auction.index),
Expand Down
8 changes: 5 additions & 3 deletions core/src/calleeFunctions/CurveLpTokenUniv3Callee.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CalleeFunctions, CollateralConfig } from '../types';
import type { CalleeFunctions, CollateralConfig, Pool } from '../types';
import { ethers } from 'ethers';
import BigNumber from '../bignumber';
import { getContractAddressByName, getJoinNameByCollateralType } from '../contracts';
Expand All @@ -11,10 +11,12 @@ const getCalleeData = async function (
network: string,
collateral: CollateralConfig,
marketId: string,
profitAddress: string
profitAddress: string,
_pools?: Pool[]
): Promise<string> {
const marketData = collateral.exchanges[marketId];
if (marketData?.callee !== 'CurveLpTokenUniv3Callee') {
const isAutorouted = 'automaticRouter' in marketData;
if (marketData?.callee !== 'CurveLpTokenUniv3Callee' || isAutorouted) {
valiafetisov marked this conversation as resolved.
Show resolved Hide resolved
throw new Error(`Can not encode route for the "${collateral.ilk}"`);
}
const route = await encodeRoute(network, marketData.route);
Expand Down
5 changes: 3 additions & 2 deletions core/src/calleeFunctions/UniswapV2CalleeDai.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CalleeFunctions, CollateralConfig } from '../types';
import type { CalleeFunctions, CollateralConfig, Pool } from '../types';
import { ethers } from 'ethers';
import BigNumber from '../bignumber';
import { getContractAddressByName, getJoinNameByCollateralType } from '../contracts';
Expand All @@ -8,7 +8,8 @@ const getCalleeData = async function (
network: string,
collateral: CollateralConfig,
marketId: string,
profitAddress: string
profitAddress: string,
_pools?: Pool[]
): Promise<string> {
const marketData = collateral.exchanges[marketId];
if (marketData?.callee !== 'UniswapV2CalleeDai') {
Expand Down
5 changes: 3 additions & 2 deletions core/src/calleeFunctions/UniswapV2LpTokenCalleeDai.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CalleeFunctions, CollateralConfig } from '../types';
import type { CalleeFunctions, CollateralConfig, Pool } from '../types';
import { ethers } from 'ethers';
import BigNumber from '../bignumber';
import { getContractAddressByName, getJoinNameByCollateralType } from '../contracts';
Expand All @@ -14,7 +14,8 @@ const getCalleeData = async function (
network: string,
collateral: CollateralConfig,
marketId: string,
profitAddress: string
profitAddress: string,
_pools?: Pool[]
): Promise<string> {
const marketData = collateral.exchanges[marketId];
if (marketData?.callee !== 'UniswapV2LpTokenCalleeDai') {
Expand Down
13 changes: 9 additions & 4 deletions core/src/calleeFunctions/UniswapV3Callee.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
import type { CalleeFunctions, CollateralConfig } from '../types';
import type { CalleeFunctions, CollateralConfig, Pool } from '../types';
import { ethers } from 'ethers';
import BigNumber from '../bignumber';
import { getContractAddressByName, getJoinNameByCollateralType } from '../contracts';
import { convertCollateralToDaiUsingRoute, encodeRoute } from './helpers/uniswapV3';
import { convertCollateralToDaiUsingRoute, encodePools } from './helpers/uniswapV3';

const getCalleeData = async function (
network: string,
collateral: CollateralConfig,
marketId: string,
profitAddress: string
profitAddress: string,
pools?: Pool[]
): Promise<string> {
const marketData = collateral.exchanges[marketId];
if (marketData?.callee !== 'UniswapV3Callee') {
throw new Error(`getCalleeData called with invalid collateral type "${collateral.ilk}"`);
}
if (!pools) {
throw new Error(`getCalleeData called with invalid pools`);
}
const joinAdapterAddress = await getContractAddressByName(network, getJoinNameByCollateralType(collateral.ilk));
const minProfit = 1;
const uniswapV3route = await encodeRoute(network, [collateral.symbol, ...marketData.route]);
const uniswapV3route = await encodePools(pools);
console.log('uniswapV3route', uniswapV3route);
const typesArray = ['address', 'address', 'uint256', 'bytes', 'address'];
return ethers.utils.defaultAbiCoder.encode(typesArray, [
profitAddress,
Expand Down
5 changes: 3 additions & 2 deletions core/src/calleeFunctions/WstETHCurveUniv3Callee.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CalleeFunctions, CollateralConfig } from '../types';
import type { CalleeFunctions, CollateralConfig, Pool } from '../types';
import { ethers } from 'ethers';
import BigNumber from '../bignumber';
import { getContractAddressByName, getJoinNameByCollateralType } from '../contracts';
Expand All @@ -10,7 +10,8 @@ const getCalleeData = async function (
network: string,
collateral: CollateralConfig,
_marketId: string,
profitAddress: string
profitAddress: string,
_pools?: Pool[]
): Promise<string> {
const joinAdapterAddress = await getContractAddressByName(network, getJoinNameByCollateralType(collateral.ilk));
const minProfit = 1;
Expand Down
20 changes: 20 additions & 0 deletions core/src/calleeFunctions/helpers/pools.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { getTokenAddressByNetworkAndSymbol } from "../../tokens";
import { Pool } from "../../types";

const getRouteSteps = (route: string[]) => {
const routeSteps = [];
for (let i = 0; i < route.length - 1; i++) {
routeSteps.push([route[i], route[i + 1]]);
}
return routeSteps;
};

export const routeToPool = async (network: string, route: string[], fee: number): Promise<Pool[]> => {
const routeSteps = getRouteSteps(route);
return await Promise.all(
routeSteps.map(async step => ({
addresses: await Promise.all(step.map(symbol => getTokenAddressByNetworkAndSymbol(network, symbol))),
fee,
}))
);
};
14 changes: 11 additions & 3 deletions core/src/calleeFunctions/helpers/uniswapAutoRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,25 @@ export const fetchAutoRouteInformation = async function (
try {
const token = await getUniswapTokenBySymbol(network, collateralSymbol);
const autoRouteData = await getUniswapAutoRoute(network, collateralSymbol, inputAmount, walletAddress);
const routes = autoRouteData.route[0].tokenPath.map(p => p.symbol);
const route = autoRouteData.route[0].tokenPath.map(p => {
if (!p.symbol) {
throw new Error(`Could not get symbol for token "${p.address}".`);
valiafetisov marked this conversation as resolved.
Show resolved Hide resolved
}
return p.symbol;
});
const quote = new BigNumber(autoRouteData.quote.toFixed());

return {
totalPrice: new BigNumber(autoRouteData.quote.toFixed(token.decimals)),
routes,
route,
quote,
errorMessage: undefined,
};
} catch (error: any) {
return {
totalPrice: undefined,
routes: undefined,
route: undefined,
quote: undefined,
errorMessage: error.toString(),
};
}
Expand Down
5 changes: 4 additions & 1 deletion core/src/calleeFunctions/helpers/uniswapV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ const EXCHANGE_RATE_CACHE = 20 * 1000;

const getCalleeConfig = function (collateral: CollateralConfig, marketId: string): RegularCalleeConfig {
const marketData = collateral.exchanges[marketId];
if (marketData?.callee === 'UniswapV2CalleeDai' || marketData?.callee === 'UniswapV3Callee') {
const isUniswapTokenNonAutoRouted =
(marketData?.callee === 'UniswapV2CalleeDai' || marketData?.callee === 'UniswapV3Callee') &&
valiafetisov marked this conversation as resolved.
Show resolved Hide resolved
!('automaticRouter' in marketData);
if (isUniswapTokenNonAutoRouted) {
return marketData;
}
throw new Error(`"${collateral.symbol}" is not an UniSwap token`);
Expand Down
21 changes: 20 additions & 1 deletion core/src/calleeFunctions/helpers/uniswapV3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { getContractAddressByName } from '../../contracts';
import { DAI_NUMBER_OF_DIGITS, MKR_NUMBER_OF_DIGITS } from '../../constants/UNITS';
import { getCollateralConfigBySymbol } from '../../constants/COLLATERALS';
import { getTokenAddressByNetworkAndSymbol } from '../../tokens';
import { Pool } from '../../types';

const UNISWAP_V3_QUOTER_ADDRESS = '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6';
export const UNISWAP_FEE = 3000; // denominated in hundredths of a bip
Expand All @@ -15,6 +16,23 @@ const getUniswapV3quoterContract = async function (network: string): Promise<eth
return new ethers.Contract(UNISWAP_V3_QUOTER_ADDRESS, UNISWAP_V3_QUOTER_ABI, provider);
};

export const encodePools = async function (pools: Pool[]): Promise<string> {
const types = [] as string[];
const values = [] as Array<string | number>;

types.push('address');
values.push(pools[0].addresses[0]);
for (const pool of pools) {
types.push('address');
values.push(pool.addresses[1]);

types.push('uint24');
values.push(pool.fee);
}

return ethers.utils.solidityPack(types, values);
};

export const encodeRoute = async function (network: string, collateralSymbols: string[]): Promise<string> {
const types = [] as string[];
const values = [] as Array<string | number>;
Expand All @@ -40,7 +58,8 @@ export const convertCollateralToDaiUsingRoute = async function (
): Promise<BigNumber> {
const collateral = getCollateralConfigBySymbol(collateralSymbol);
const marketData = collateral.exchanges[marketId];
if (marketData?.callee !== 'UniswapV3Callee') {
const isAutorouted = 'automaticRouter' in marketData;
if (marketData?.callee !== 'UniswapV3Callee' || isAutorouted) {
valiafetisov marked this conversation as resolved.
Show resolved Hide resolved
throw new Error(`getCalleeData called with invalid collateral type "${collateral.ilk}"`);
}
const collateralIntegerAmount = collateralAmount.shiftedBy(collateral.decimals).toFixed(0);
Expand Down
50 changes: 44 additions & 6 deletions core/src/calleeFunctions/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CalleeNames, CalleeFunctions, MarketData, CollateralConfig } from '../types';
import type { CalleeNames, CalleeFunctions, MarketData, CollateralConfig, CollateralSymbol, CalleeConfig, Pool, MarketDataUniswapV2LpToken, MarketDataRegular, MarketDataUniswapV3Automatic } from '../types';
import memoizee from 'memoizee';
import BigNumber from '../bignumber';
import UniswapV2CalleeDai from './UniswapV2CalleeDai';
Expand All @@ -8,6 +8,9 @@ import CurveLpTokenUniv3Callee from './CurveLpTokenUniv3Callee';
import UniswapV3Callee from './UniswapV3Callee';
import rETHCurveUniv3Callee from './rETHCurveUniv3Callee';
import { getCollateralConfigByType, getCollateralConfigBySymbol } from '../constants/COLLATERALS';
import { routeToPool } from './helpers/pools';
import { fetchAutoRouteInformation } from './helpers/uniswapAutoRouter';
import { UNISWAP_FEE } from './helpers/uniswapV3';

const MARKET_PRICE_CACHE_MS = 10 * 1000;

Expand All @@ -24,15 +27,44 @@ export const getCalleeData = async function (
network: string,
collateralType: string,
marketId: string,
profitAddress: string
profitAddress: string,
pools?: Pool[]
): Promise<string> {
const collateral = getCollateralConfigByType(collateralType);
const marketData = collateral.exchanges[marketId];
if (!marketData || !marketData.callee || !allCalleeFunctions[marketData.callee]) {
throw new Error(`Unsupported collateral type "${collateralType}"`);
}
return await allCalleeFunctions[marketData.callee].getCalleeData(network, collateral, marketId, profitAddress);
return await allCalleeFunctions[marketData.callee].getCalleeData(network, collateral, marketId, profitAddress, pools);
};
const getCalleeAutoRoute = async (
network: string,
collateral: CollateralConfig,
marketId: string,
amount: BigNumber = new BigNumber('1')
): Promise<string[] | undefined> => {
const calleeConfig = collateral.exchanges[marketId];
if (!('automaticRouter' in calleeConfig)) {
return undefined;
}
return (await fetchAutoRouteInformation(network, collateral.symbol, amount.toFixed())).route || [];
}

const getMarketDataWithoutPrice = (calleeConfig: CalleeConfig, route: string[] | undefined, pools: Pool[] | undefined) => {
valiafetisov marked this conversation as resolved.
Show resolved Hide resolved
if (!route && calleeConfig.callee === 'UniswapV2LpTokenCalleeDai') {
const uniswapV2LpMarketData: Omit<MarketDataUniswapV2LpToken, 'marketUnitPrice'> = calleeConfig;
return uniswapV2LpMarketData;
}
if ('route' in calleeConfig && pools) {
const regularMarketData: Omit<MarketDataRegular, 'marketUnitPrice'> = {...calleeConfig, pools};
return regularMarketData;
}
if ('automaticRouter' in calleeConfig && route && pools) {
const autorouterMarketData: Omit<MarketDataUniswapV3Automatic, 'marketUnitPrice'> = {...calleeConfig, route, pools};
return autorouterMarketData;
}
throw new Error('Unexpected market data parameters. Failed to determine the callee type.');
}

export const getMarketDataById = async function (
network: string,
Expand All @@ -44,6 +76,10 @@ export const getMarketDataById = async function (
if (!allCalleeFunctions[calleeConfig?.callee]) {
throw new Error(`Unsupported callee "${calleeConfig?.callee}" for collateral symbol "${collateral.symbol}"`);
}

const route = 'route' in calleeConfig ? calleeConfig.route : await getCalleeAutoRoute(network, collateral, marketId, amount);
const pools = route ? await routeToPool(network, route, UNISWAP_FEE) : undefined;
valiafetisov marked this conversation as resolved.
Show resolved Hide resolved

let marketUnitPrice: BigNumber;
try {
marketUnitPrice = await allCalleeFunctions[calleeConfig.callee].getMarketPrice(
Expand All @@ -56,20 +92,20 @@ export const getMarketDataById = async function (
const errorMessage = error?.message;
marketUnitPrice = new BigNumber(NaN);
return {
...calleeConfig,
...getMarketDataWithoutPrice(calleeConfig, route, pools),
marketUnitPrice,
errorMessage,
};
}
return {
...calleeConfig,
...getMarketDataWithoutPrice(calleeConfig, route, pools),
marketUnitPrice: marketUnitPrice ? marketUnitPrice : new BigNumber(NaN),
};
};

export const getMarketDataRecords = async function (
network: string,
collateralSymbol: string,
collateralSymbol: CollateralSymbol,
amount: BigNumber = new BigNumber('1')
): Promise<Record<string, MarketData>> {
const collateral = getCollateralConfigBySymbol(collateralSymbol);
Expand All @@ -83,6 +119,7 @@ export const getMarketDataRecords = async function (
errorMessage: error?.message,
marketUnitPrice: new BigNumber(NaN),
route: [], // dummy value: MarketData requires either a route or tokens
pools: [],
};
}
marketDataRecords = {
Expand Down Expand Up @@ -118,6 +155,7 @@ const _getMarketPrice = async function (
collateralSymbol: string,
amount: BigNumber = new BigNumber('1')
): Promise<BigNumber> {
// get collateral config and if exchanges contains automaticRouter, use that
const marketDataRecords = await getMarketDataRecords(network, collateralSymbol, amount);
const bestMarketId = await getBestMarketId(marketDataRecords);
return marketDataRecords[bestMarketId].marketUnitPrice;
Expand Down
12 changes: 7 additions & 5 deletions core/src/calleeFunctions/rETHCurveUniv3Callee.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ethers } from 'ethers';
import type { CalleeFunctions, CollateralConfig } from '../types';
import type { CalleeFunctions, CollateralConfig, Pool } from '../types';
import BigNumber from '../bignumber';
import { getContractAddressByName, getJoinNameByCollateralType } from '../contracts';
import { encodeRoute, convertCollateralToDai } from './helpers/uniswapV3';
Expand All @@ -12,13 +12,15 @@ const getCalleeData = async function (
network: string,
collateral: CollateralConfig,
marketId: string,
profitAddress: string
profitAddress: string,
_pools?: Pool[]
): Promise<string> {
const marketData = collateral.exchanges[marketId];
if (marketData?.callee !== 'rETHCurveUniv3Callee') {
const calleeConfig = collateral.exchanges[marketId];
const isAutorouted = 'automaticRouter' in calleeConfig;
if (calleeConfig?.callee !== 'rETHCurveUniv3Callee' || isAutorouted) {
throw new Error(`Can not encode route for the "${collateral.ilk}"`);
}
const route = await encodeRoute(network, marketData.route);
const route = await encodeRoute(network, calleeConfig.route);
const joinAdapterAddress = await getContractAddressByName(network, getJoinNameByCollateralType(collateral.ilk));
const minProfit = 1;
const typesArray = ['address', 'address', 'uint256', 'bytes', 'address'];
Expand Down
Loading