Back | Blog
Tudor M

Tudor M β€’ β€’ Tutorial

DCA Strategy: Swap ERC20 Tokens Automatically (Without Coding)

Cover Image for DCA Strategy: Swap ERC20 Tokens Automatically (Without Coding)

DCA, or Dollar Cost Averaging, is a popular DeFi strategy where you buy a fixed amount of a token on a regular basis. You can do this manually: Set a weekly reminder, sit down, and purchase or swap the usual number of tokens. You can also automate this on some CEX platforms, but these "recurring buy" features mean putting your funds into a wallet you don't hold the keys for.

If you already have crypto holdings that you can DCA from, you can set up an automatic, scheduled swap with Boto.io & Uniswap using your own wallet, so funds *never* sit on a centralized exchange.

You'll want to put the new Swap Token (ERC20) block to work. It can swap between ERC20 tokens from your wallet to any other token supported by Uniswap V2. Follow along to see a short tutorial of how to use it.

The recipe for this bot can be found here and you can see an overview of it in the screenshot below:

[object Object]

How Swap ERC20 to UNI Automatically

  1. Click on "Create new Bot" to open a new blank Canvas.

  2. Drag the "Crypto to USD" block from the library to the Canvas on the left.

  3. Type "UNI" in the Symbol field. Select "Token Ticker" in the Symbol Type field and enter "1" in the Amount Field.

  4. Next, drag in a "Filter" block into the Canvas and connect it to the existing "Crypto to USD" block. In the field labeled "Variable" enter the output from the previous block by selecting it from the floating menu. Once added, a green oval with the text "#1. Value in USD" should appear inside this field.

  5. In the "Operator" field select the less-than symbol `<` and in the "Criteria" field enter the USD value below which you want to buy UNI. At the time of writing 4.20 was a good example.

  6. Now the fun part: from the library of blocks on the right, drag in the "Swap Token (ERC20)" block. Connect it to the "Filter" block. As a reminder, the filter block prevents any actions that don't satisfy the configured criteria.

  7. In the "Source Wallet and Token" field select any combination you have previously approved. If this is the first time doing so, click on the "+" button and a new tab should open with the Boto Approvals Page.

  8. Once approved, enter a value in the "Source Token Amount". In my example, I've entered 10 in my example, which corresponds to 10 USDC.

  9. In the "Contract Address of Destination Token" I've pested the contract address of the UNI token, deployed at https://etherscan.io/address/0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984

  10. In the "Receiver Wallet Address" enter the wallet address when the result of the swap will land. Could be any wallet you wish, so not restricted to the source wallet.

  11. Give your bot a descriptive name. Click "Save" and turn on the switch on the top right. Once your bot is enabled, it will run as long as your wallet has approved funds.

  12. Congrats! You have a basic DCA bot ready to go! You can find the full recipe here.

Result

[object Object]

From this moment onward, your DCA bot will be buying tokens for you on a schedule. While this works well with UNI, it can be used by any ERC20 token supported by Uniswap V2.

Find all the details about how this block works in the official docs.

If you enjoy this tutorial please join the Boto Discord Server.

May the bots always be in your favour!

You might also like: Build a Base transaction notification bot with #nocode

What is an ERC20 Token?

ERC-20 is a widely adopted standard on the Ethereum blockchain for creating fungible tokens, facilitating the issuance and management of various digital assets within the Ethereum ecosystem. It defines the required functions and events for tokens to be compatible with the Ethereum network, enabling seamless interoperability and ease of integration.

boto-logo

Tutorial

No-code

DeFi

Web3

Share
Tudor MAbout Tudor

Head of Engineering at Boto.io

Holistic and deterministic views of tech. Hobby investor. Python is cool. Big fan of open-source and love contributing to the community, as well as leading by example. Bought my first crypto on MtGox.

​
Related Articles