Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Coursera

Advanced Trading Bot on DYDX with AWS & Python

Packt via Coursera

Overview

Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
This course features Coursera Coach! A smarter way to learn with interactive, real-time conversations that help you test your knowledge, challenge assumptions, and deepen your understanding as you progress through the course. Build a sophisticated automated trading bot from scratch with this advanced course combining Python, AWS, and the DYDX decentralized exchange. Learn the core principles of algorithmic trading, statistical arbitrage, and cloud deployment while gaining hands-on experience in designing and coding your own trading system. Your journey begins with mastering manual trading on DYDX and understanding key concepts such as cointegration, Z-score trading, and risk management. You’ll then set up the trading environment, connect to DYDX APIs, and progressively build your bot in multiple stages — from constants configuration to live order execution. Next, you’ll integrate Telegram messaging for real-time alerts and deploy your bot to AWS EC2 for full cloud automation. You’ll also learn essential DevOps practices like code versioning with GitHub, CRON scheduling, and ongoing bot improvements for long-term scalability and performance. This advanced course is ideal for developers, data scientists, and trading enthusiasts who have intermediate Python knowledge and a basic understanding of trading concepts. Prior experience with APIs and cloud platforms will be beneficial but not mandatory. By the end of the course, you will be able to design, code, and deploy a fully automated trading bot on DYDX, manage real-time trading operations on AWS, implement statistical trading strategies, and automate alerts and maintenance workflows efficiently.

Syllabus

  • Introduction
    • In this module, we will introduce you to the course and set the stage for your learning journey. You’ll understand what to expect, what not to expect, and the course structure. We’ll also show you how to connect with the community on Discord and explain how to manually trade on DYDX, offering valuable insights for creating your own advanced trading bot later in the course.
  • Strategy
    • In this module, we will explore the key strategies used in pairs trading, starting with statistical arbitrage and cointegration to identify profitable trading pairs. You will learn how to apply the Z-Score for entry and exit points, calculate the hedge ratio to manage market risk, and understand the concept of half-life in mean-reverting strategies. Additionally, we’ll cover position sizing and risk management, ensuring you’re equipped to manage risk effectively while maximizing potential returns.
  • DYDX FastTrack
    • In this module, we will take you through the technical setup needed to interact with the DYDX platform. From installing MetaMask and setting up the Alchemy HTTP provider, to securely accessing your DYDX credentials, you’ll be ready to programmatically trade on the platform. We’ll walk you through connecting to DYDX using Python and Colab, interpreting the API documentation, and retrieving crucial market data. By the end of this module, you'll know how to place and manage orders on DYDX using the platform’s private API.
  • Environment Setup
    • In this module, we will guide you through setting up your development environment for building the trading bot. You’ll learn how to configure VS Code and Python virtual environments, ensuring a clean and manageable workspace. We’ll also walk you through creating a GitHub repository for version control, and show you how to securely store sensitive information, like API keys, as environment variables to protect your data.
  • Bot Build - Stage 1
    • In this module, we will guide you through the initial steps of building your trading bot. You'll begin by configuring the bot constants, followed by an overview of the plan for Stage 1. We will walk you through securely connecting your bot to the DYDX platform and then dive into developing the close all positions function, split across two parts. By the end of this stage, your bot will be able to connect to DYDX and manage open positions.
  • Bot Build - Stage 2
    • In this module, we will dive into Stage 2 of building the trading bot. You'll begin by understanding the plan of attack for gathering and processing key data, such as ISO times and market prices. We’ll walk you through constructing market prices, followed by implementing cointegration functions to identify asset pairs that move together. Finally, we’ll guide you on how to store and manage cointegrated pairs data, ensuring your bot can make informed decisions based on this critical information.
  • Bot Build - Stage 3
    • In this module, we’ll focus on the final stages of building your trading bot. You’ll start by initializing and completing the BotAgent class, which will allow your bot to interact with the trading platform and execute trades. We’ll guide you through setting up open trades, implementing trade triggers based on your trading strategy, and automating the execution process. Additionally, we’ll cover managing trade exits with various strategies to ensure effective risk management. Finally, you’ll build a test run to evaluate your bot’s performance before deploying it using Git for live trading.
  • Telegram Messaging Inclusion
    • In this module, we’ll integrate Telegram messaging into your trading bot for real-time notifications. You’ll start by setting up a Telegram bot and learning how to send messages via URL for basic communication. We’ll then guide you through sending messages programmatically using Python for more flexibility. Finally, we’ll discuss the strategic placement of messages within your code and how to use GitHub for version control, ensuring smooth integration and collaboration for your project.
  • AWS Cloud Deployment
    • In this module, we’ll walk you through the process of deploying your trading bot on AWS, starting with an overview of AWS and signing up for an account. You will learn how to launch an EC2 instance, create a security group for secure communication, and install Python. Once your bot is running on AWS, we’ll show you how to test, update, and iterate on your code. Finally, we’ll introduce CRON for automating your trading bot, ensuring that it runs continuously and autonomously in the cloud.
  • Next Steps
    • In this final module, we will explore the next steps you can take to improve your trading bot. You’ll gain insights on enhancing its strategies, adding new features, and adjusting to dynamic market conditions. This video will serve as a guide for ongoing development, ensuring that your trading bot remains effective and optimized as you continue to evolve its performance over time.

Taught by

Packt - Course Instructors

Reviews

Start your review of Advanced Trading Bot on DYDX with AWS & Python

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.