Skip to main content

Automate token purchases with dollar cost averaging on Uniswap V3 & 1Shot API

Workflow preview

Workflow preview
100%
Automate token purchases with dollar cost averaging on Uniswap V3 & 1Shot API preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This workflow contains community nodes that are only compatible with the self hosted version of n8n. Dollar Cost Averaging with Uniswap V3 This workflow lets you set up ...

Best for

  • Crypto Trading automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.code, n8n-nodes-1shot.oneshot, n8n-nodes-1shot.oneshotsynch, n8n-nodes-base.scheduletrigger, n8n-nodes-base.telegram, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by 1Shot API.

Original n8n.io source

1.1 Workflow description

Title
Automate token purchases with dollar cost averaging on Uniswap V3 & 1Shot API
Workflow name
Automate token purchases with dollar cost averaging on Uniswap V3 & 1Shot API

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

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

  1. Create a free 1Shot API account, provision a server wallet to relay transactions, and generate an API key to connect to n8n.
  2. 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).
  3. 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).
  4. 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.
  5. Import the DCA workflow and use your 1Shot API key/secret to create a credential.
  6. Point the 1Shot API nodes at the appropriate smart contract functions you imported in steps 2 and 3.
  7. 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.
  8. 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.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Calculate TWAP

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 2 - Fetch Pool TWA Observations

Type / Role
n8n-nodes-1shot.oneShot - oneShot
Config choices
Version 1

Block 3 - Get Swap Qoute

Type / Role
n8n-nodes-1shot.oneShot - oneShot
Config choices
Version 1

Block 4 - Swap Tokens

Type / Role
n8n-nodes-1shot.oneShotSynch - oneShotSynch
Config choices
Version 1

Block 5 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 6 - Failure Details

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 7 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Give Approval to Router

Type / Role
n8n-nodes-1shot.oneShotSynch - oneShotSynch
Config choices
Version 1

Block 11 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Success Details

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 13 - Get Remaining DCA Funds Balance

Type / Role
n8n-nodes-1shot.oneShot - oneShot
Config choices
Version 1

Block 14 - Swap Configs

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 15 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Automate token purchases with dollar cost averaging on Uniswap V3 & 1Shot API
Complexity advanced
Nodes 16
Categories Crypto Trading, Multimodal AI
Author 1Shot API
Published 30 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8044/8044.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Automate token purchases with dollar cost averaging on Uniswap V3 & 1Shot API do?

This workflow contains community nodes that are only compatible with the self hosted version of n8n. Dollar Cost Averaging with Uniswap V3 This workflow lets you set up ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Crypto Trading, Multimodal AI use case.