Dex Trader - SDK
This package has been designed to make it easier to use Vesta's Dex Trader and trying to give the best path possible. Dex Trader Doc
Installation
npm i @vesta-finance/dex-trader-sdk
Setup Envrionment Variables
- ONE_INCH_API_KEY (Get your key)
How to use
import { DexTrader } from '@vesta-finance/dex-trader-sdk';
const [expectingAmountOut, manualExchanges] = await DexTrader.quote(
'arbitrum',
'0x82af49447d8a07e3bd95bd0d56f35241523fbab1',
'0x64343594ab9b56e99087bfa6f2335db24c2d1f17',
10,
1,
provider
);
Todo
Open to contribution, here are the things that is currently missing
- Unit tests
- Amount discovery on uniswapV3 to we use the correct pool fee
- Currently it uses 1 ether.
- Route discovery on sushiswap
- Currently it tries to find a pair, if it doesn't exit, it hops to WETH.
- Route discovery on gmx
- Currently it ignores gmx multi-hop, hoping that if an aggregator gives gmx, it will be single path.