Workflow overview
Why this workflow matters
Supports knowledge capture and document intelligence use cases.
This workflow contains community nodes that are only compatible with the self-hosted version of AlekSystem. Dollar Cost Averaging with Uniswap V3 This workflow lets you set up an scheduled workflow to dollar cost average (DCA) into any token on a custom schedule using 1Shot API and the Uniswap V3 protocol. Choose your schedule input token and output token and optionally configure the workflow to send you notifications in Telegram everytime your workflow completes a swap. YouTube Tutorial You can watch the full end-to-end tutorial for this workflow on our YouTube channel. Wallet Delegation Importantly, this workflow uses Metamasks Delegation Framework which lets you DCA from an account you custody whithout ever exporting your private key or giving up control of your assets. Setup Create a free 1Shot API account, provision a server wallet to relay transactions, and generate an API key to connect to AlekSystem. Import the following Uniswap contracts into your 1Shot API account for the chain you want to swap on: QuoterV2, SwapRouter02, and the token pool (needed to compute time-weighted average price (TWAP). Import the approve function for the ERC-20 token you want to use to purchase your target asset (this should be the token0 or token1 of the pool you imported in step 2). Click on the server wallet details you created, fund it with enough gas tokens to pay for your transactions, then generate a delegation for the SwapRouter02 contract and the ERC-20 token from steps 2 and 3. Import the DCA workflow and use your 1Shot API key/secret to create a credential. Point the 1Shot API nodes at the appropriate smart contract functions you imported in steps 2 and 3. In the Swap Configs node, set the amount of the in token you want to spend on each purchase - for example, if you are using USDC (which has 6 decimals) and you want to purchase $10 every purchase, then amountDCA should be 10000000. Also set the correct addresses for the SwapRouterV2, token0, token1 and fee of the pool you are using. Lastly, set the frequency of your DCA in the trigger node and activate! Optional Telegram Notifications You can configure a Telegarm bot to notifiy you everytime the workflow completes to send you a transaction has and you remaining balance in your purchasing funds.
Best fit
Categories
Services
Use cases
Need another direction?