mirror of
https://github.com/Instadapp/Gelato-automations.git
synced 2024-07-29 22:28:07 +00:00
11 lines
351 B
JavaScript
11 lines
351 B
JavaScript
|
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;
|