Gelato-automations/test/helpers/services/InstaDapp/getInstaPoolV2Route.js

9 lines
333 B
JavaScript
Raw Normal View History

2020-11-15 14:08:12 +00:00
module.exports = async function (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;
2020-11-15 14:08:12 +00:00
};