Gelato-automations/test/helpers/services/getRoute.js

11 lines
351 B
JavaScript
Raw Normal View History

async function getRoute(token, tokenDebtToMove, instaPoolResolver) {
const rData = await instaPoolResolver.getTokenLimit(token);
if (rData.dydx > tokenDebtToMove) return 0;
if (rData.maker > tokenDebtToMove) return 1;
if (rData.compound > tokenDebtToMove) return 2;
if (rData.aave > tokenDebtToMove) return 3;
}
module.exports = getRoute;