Console client for SushiSwap V3 liquidity protocol
To launch project you need to set following environment variables:
PROVIDER_RPC- PRC Url for blockchain data providerUSER_PRIVATE_KEY- Private key for user wallet
Integration tests are run against Sepolia network. To launch them follow instructions:
- Start local fork of Sepolia:
anvil --fork-url $PROVIDER_RPC --chain-id 11155111 - Configure environment variables from previous chapter
- Run
npm run test
You can use this client to work with BSC. Following commands are availible:
- Show liquidity positions:
node dist/src/amm.js positions -c bsc - Add liquidity:
node dist/src/amm.js addLiquidity -c bsc - Withdraw liquidity
node dist/src/amm.js withdrawLiquidity -i 0 -c bsc - Collect fees
node dist/src/amm.js collectAllFees -t 1056 -c bsc - Reallocate liquidity:
node dist/src/amm.js reallocate -i 0 -c bscKeep in mind that before operations with liquidity you have to approve tokens to NonFungiblePositionManager contract
For sepolia network there is a special setUp command that will do all operations like token transfers and approvals: node dist/src/amm.js setUp -c sepolia
- Position index alias:
-i- the number of position in array - used for withdraw and reallocate operations - Private key alias:
-p- the private key of signer - could be used with any command - overrides environment variableUSER_PRIVATE_KEY - rpc Url alias
-r- url of rpc endpoint, could be used with any command - overrides environment variablePROVIDER_RPC - chain alias
-c- eithersepoliaorbscrequired with any command - Token id alias
-tNFT token id of liquidity position - used withcollectAllFeescommand