{
  "name": "Automate token purchases with dollar cost averaging on Uniswap V3 & 1Shot API",
  "nodes": [
    {
      "id": "f43b592f-1203-47b8-9dac-61e8a9d3c9d3",
      "name": "Calculate TWAP",
      "type": "n8n-nodes-base.code",
      "position": [
        432,
        160
      ]
    },
    {
      "id": "bd180960-416b-48f8-b524-9841428a34e9",
      "name": "Fetch Pool TWA Observations",
      "type": "n8n-nodes-1shot.oneShot",
      "position": [
        -16,
        160
      ]
    },
    {
      "id": "46184b6b-263e-4e14-9518-2515e2d311a3",
      "name": "Get Swap Qoute",
      "type": "n8n-nodes-1shot.oneShot",
      "position": [
        208,
        160
      ]
    },
    {
      "id": "6b4d7900-7fae-4c1d-80cf-2900dfb4e299",
      "name": "Swap Tokens",
      "type": "n8n-nodes-1shot.oneShotSynch",
      "position": [
        880,
        80
      ]
    },
    {
      "id": "a11c7481-97bf-4cee-8a3f-e604cd09236d",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -464,
        160
      ]
    },
    {
      "id": "8c435f3f-72dc-4102-99bd-13cda1ea27c8",
      "name": "Failure Details",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1104,
        256
      ]
    },
    {
      "id": "d1512fe2-112f-48c0-8a98-cbbb08ab8f65",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -944,
        160
      ],
      "parameters": {
        "width": 320,
        "height": 224,
        "content": "## Set Your DCA Schedule\n\nn8n makes it really easy to set a recurring schedule for your DCA purchases. Click on the Schedule Trigger node and set your frequency. "
      }
    },
    {
      "id": "4f6661d0-978c-4554-97eb-f91519dd8c85",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -528,
        -160
      ],
      "parameters": {
        "width": 720,
        "height": 304,
        "content": "## DCA configs\n\nSince we are using the Uniswap protocol directly, you'll need to set a few parameters in the Swap Configs node. \n\n1. Decide on the amount you want to spend on each DCA buy. \n2. Put you"
      }
    },
    {
      "id": "4b46e786-07d6-4184-8a90-ff264686c075",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        608
      ],
      "parameters": {
        "width": 720,
        "height": 384,
        "content": "## Connect to Your 1Shot API Account\n\nCreate an API key and secret in your 1Shot API account and connect your n8n instance by creating a credential. \n\n1. The `Fetch Pool TWA Observactions` should poin"
      }
    },
    {
      "id": "bb585dd2-901b-4bb3-b822-5ddf3ad80be7",
      "name": "Give Approval to Router",
      "type": "n8n-nodes-1shot.oneShotSynch",
      "position": [
        656,
        160
      ]
    },
    {
      "id": "792928fb-59e5-44ba-a6b9-9f388c74f02a",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1344,
        224
      ],
      "parameters": {
        "width": 544,
        "height": 176,
        "content": "## Telegram Notifications\n\nIf you want to get notified on each DCA purchase, connect a Telegram bot. "
      }
    },
    {
      "id": "2edc9432-92f2-4feb-a44a-f6d6f5608db1",
      "name": "Success Details",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1328,
        32
      ]
    },
    {
      "id": "3147ded9-fc81-4d00-b230-c313c0c3501a",
      "name": "Get Remaining DCA Funds Balance",
      "type": "n8n-nodes-1shot.oneShot",
      "position": [
        1104,
        32
      ]
    },
    {
      "id": "4d7da856-78f7-4553-a9f7-2a372688712b",
      "name": "Swap Configs",
      "type": "n8n-nodes-base.code",
      "position": [
        -240,
        160
      ]
    },
    {
      "id": "326628a6-6b36-4f27-9af1-6fc5bc13d430",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        368
      ],
      "parameters": {
        "width": 576,
        "height": 192,
        "content": "## Contracts to Import to Your 1Shot API account:\n\n1. [Uniswap SwapRouterV2](https://app.1shotapi.com/1shot-prompts/ce849711-a23a-4d6b-8a85-f5787011893e)\n2. [Uniswap Quoter02](https://app.1shotapi.com"
      }
    },
    {
      "id": "be85f1ff-4ebf-4a5d-a3f2-aa62c6dc706e",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -944,
        432
      ],
      "parameters": {
        "width": 768,
        "height": 560,
        "content": "## YouTube Tutorial\n\n@[youtube](JiyLR5NtU7I)"
      }
    }
  ],
  "connections": {
    "Swap Tokens": {
      "main": [
        [
          {
            "node": "Get Remaining DCA Funds Balance",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Failure Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Swap Configs": {
      "main": [
        [
          {
            "node": "Fetch Pool TWA Observations",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate TWAP": {
      "main": [
        [
          {
            "node": "Give Approval to Router",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Swap Qoute": {
      "main": [
        [
          {
            "node": "Calculate TWAP",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Swap Configs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Give Approval to Router": {
      "main": [
        [
          {
            "node": "Swap Tokens",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Failure Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Pool TWA Observations": {
      "main": [
        [
          {
            "node": "Get Swap Qoute",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Remaining DCA Funds Balance": {
      "main": [
        [
          {
            "node": "Success Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}