Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
@venusprotocol/keeper-bots
Advanced tools
The Token Converter Bot uses the [ConverterOperator](../smart-contracts/contracts/operators/TokenConverterOperator.sol) to perform swaps using the Venus TokenConverter contracts.
The Token Converter Bot uses the ConverterOperator to perform swaps using the Venus TokenConverter contracts.
Installation
yarn add @venusprotocol/token-converter-bot
You will also need to copy the .env.example file and add the appropriate values for the RPC and private key variables.
Start by querying available conversions by asset to send to the converter (assetIn), asset to receive from the converter (assetOut) or the converter you'd like to interact with. TokenConverter.queryConversions
also takes a releaseFunds: boolean
which will query using converter balances after releasing funds.
const potentialConversions = await tokenConverter.queryConversions({ assetIn, assetOut, converters, releaseFunds });
If you queried for conversions assuming the release of funds you'll want to release those funds before attempting conversions to ensure the converter balance is as you expect. An advanced version would be to check the amount you want to convert over the current balance and the balance after released to decide if you need to release the funds or not.
await tokenConverter.releaseFundsForConversions(potentialConversions);
Once you have the possible conversions, you can query for details on the flash swap required to execute conversion using TokenConverter.prepareConversion
. Based on the amount you want to receive from the converter it will return a pancakeSwap trade, an updated amount out and a min income required for the trade (the difference between the amount you will receive from the converter and the amount that will be send to pancake swap).
const { trade, amount, minIncome } = await tokenConverter.prepareConversion(
tokenConverter,
assetOutAddress,
assetInAddress,
amountOut,
);
Using these values you can call arbitrage which will simulate the transaction and if successful execute it.
await tokenConverter.arbitrage(tokenConverter, trade, amount, minIncome);
You can run a working example using the Venus Keeper Bot CLI .
FAQs
The Token Converter Bot uses the [ConverterOperator](../smart-contracts/contracts/operators/TokenConverterOperator.sol) to perform swaps using the Venus TokenConverter contracts.
We found that @venusprotocol/keeper-bots demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.