We may earn an affiliate commission when you visit our partners.
Shaun McDonogh

Learn how to interact with the DYDX Layer 2 Ethereum trading exchange using Python by running a trading bot on AWS Elastic Cloud Compute (EC2). Your bot will be highly advanced in trading in being able to take advantage of statistical arbitrage opportunities in Pairs Trading. This is a great strategy to know given how closely linked many cryptocurrencies are in price behaviour.

Your bot will be able to message you via Telegram so that you can receive live notifications on how well the script is performing (or not performing). It will enable you to:

- Automatically close all existing open positions

Read more

Learn how to interact with the DYDX Layer 2 Ethereum trading exchange using Python by running a trading bot on AWS Elastic Cloud Compute (EC2). Your bot will be highly advanced in trading in being able to take advantage of statistical arbitrage opportunities in Pairs Trading. This is a great strategy to know given how closely linked many cryptocurrencies are in price behaviour.

Your bot will be able to message you via Telegram so that you can receive live notifications on how well the script is performing (or not performing). It will enable you to:

- Automatically close all existing open positions

- Find cointegrated (linked Crypto pairs) for trading and ascertain whether statistically it makes sense to open a trade

- Manage any open positions and look for exits

- Find and place new trading opportunities

- Alert you if something goes wrong

- Run your bot without your laptop whilst you sleep

Our Python code will interact heavily with the DYDX API and to ensure you understand how to use the API, a cheatsheet has been provided to fast-track you onto being able to use DYDX.

To do this course, you should have used Python in the past, having created and installed packages in a virtual environment and be familiar with basic programming concepts.

That said, you do NOT need to be an advanced Python programmer or advanced trader to do this course. Our strategy uses statistical arbitrage for Pairs Trading, of which you will be walked through the strategy and theory in the beginning in reasonable detail so you understand the nature of what is going on.

See you in Class.

About Your Instructor: Shaun McDonogh has been developing tools for traders for over 5 years at Crypto Wizards and is very close to where the action is in regards to trading Crypto. Shaun's passion is developing applications and teaching others and is delighted to bring this information to the retail market.

Enroll now

What's inside

Syllabus

Introduction
What to Expect
What NOT to Expect
Course Plan of Attack
Read more
Discord and Resources
Manually Trading on DYDX
US, UK and Canada Citizens - Please Read

Read Content Here (free links to help with course content) and Code Resources are attached here too

Strategy
Statistical Arbitrage and Cointegration
Trading the Spread Based on Z-Score
About the Hedge Ratio
About Half-Life

Homework: Please watch video on the "Kelly Criterion Crypto Wizards" via YouTube. This video is not available for uploading to Udemy.

Position Sizing and Risk Management
Test Your Knowledge
Understand how to get resources code working in line with 2024 V4 API updates
NEW CODE AND RESOURCES
2024 Code Updates
Downloading Code Package
DYDX Testnet Account Setup
Code Package Overview and Testing
APPENDIX - DYDX FastTrack - OLD (REFERENCE ONLY)
IMPORTANT: NEW DYDX VERSION 2024
MetaMask Setup
Alchemy HTTP Provider Setup
DYDX Credentials Access
Connect to DYDX in Python with Colab
Interpreting DYDX API Documentation
Get Public Candlestick Price Data
Place Orders on DYDX via Private API
Environment Setup - OLD (REFERENCE ONLY)
VS Code and Python VENV Setup
GitHub Repository Setup
Adding Environment Variables
Bot Build - Stage 1
Bot Constants Configuration Setup
Stage 1 - Plan of Attack
Connect_To_DYDX
Close All Positions Function - Part 1
Close All Positions Function - Part 2
Bot Build - Stage 2
Stage 2 - Plan of Attack
Get ISO Times
Construct Market Prices - Preparation
Construct Market Prices - Completion
Construct Cointegration Functions
Spread Calculation Update
Store Cointegrated Pairs Data
Bot Build - Stage 3
Stage 3 - Plan of Attack
BotAgent Class - Initialize
BotAgent Class - Completion
Open Trades - Initial Setup
Open Trades - Trade Trigger Logic
Open Trades - Engage BotAgent
Manage Exits - Part 1
Manage Exits - Part 2
Build Test Run
Git Deploy and Next Steps
Telegram Messaging Inclusion
Telegram Bot Setup
Sending First Message Via URL
Send Message Via Python
Message Placement and GitHub
AWS Cloud Deployment
About AWS and Signup
AWS EC2 - Plan of Attack
Create Security Group
Launch EC2 Instance
Connect to EC2 and Install Python
Download and Test Bot
Making Code Updates
Full Automation with CRON
Next Steps
Bot Improvements and Next Steps

Save this course

Save DYDX Pairs Trading Bot Build in Python Running in the Cloud to your list so you can find it easily later:
Save

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in DYDX Pairs Trading Bot Build in Python Running in the Cloud with these activities:
Review Python Fundamentals
Solidify your understanding of Python fundamentals to ensure a smooth learning experience when building the trading bot.
Browse courses on Python Programming
Show steps
  • Review basic Python syntax and data structures.
  • Practice writing simple Python functions.
  • Work through online Python tutorials or exercises.
Brush Up on Statistical Concepts
Revisit key statistical concepts like cointegration and Z-scores to better grasp the underlying principles of the pairs trading strategy.
Show steps
  • Review definitions of cointegration, Z-score, and hedge ratio.
  • Work through examples of calculating these values.
  • Understand how these concepts apply to pairs trading.
Mastering Python for Finance
Study this book to gain a deeper understanding of how Python can be applied to financial analysis and trading, including algorithmic trading strategies.
Show steps
  • Read the chapters related to time series analysis and algorithmic trading.
  • Experiment with the code examples provided in the book.
  • Apply the concepts learned to the DYDX trading bot project.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Follow DYDX API Tutorials
Practice interacting with the DYDX API using online tutorials to become more comfortable with the platform's interface and functionalities.
Show steps
  • Find tutorials that demonstrate placing orders and retrieving data from the DYDX API.
  • Follow the tutorials step-by-step, testing each function as you go.
  • Adapt the tutorial code to your own trading bot project.
Backtest a Simple Trading Strategy
Develop a simple backtesting framework to evaluate the performance of different trading strategies before implementing them in the DYDX bot.
Show steps
  • Gather historical price data for the crypto pairs you want to trade.
  • Implement a basic backtesting engine in Python.
  • Test different trading rules and parameters to optimize performance.
  • Analyze the backtesting results to identify profitable strategies.
Document Your Trading Bot Journey
Create a blog or video series documenting your experience building the DYDX trading bot, sharing insights and lessons learned with others.
Show steps
  • Choose a platform for your documentation (blog, video, etc.).
  • Document each step of the bot building process, including challenges and solutions.
  • Share your documentation with the online community and solicit feedback.
Contribute to a Crypto Trading Library
Contribute to an open-source Python library for crypto trading, enhancing your skills and giving back to the community.
Show steps
  • Find an open-source crypto trading library on GitHub.
  • Identify areas where you can contribute, such as bug fixes or new features.
  • Submit your contributions to the library maintainers for review.

Career center

Learners who complete DYDX Pairs Trading Bot Build in Python Running in the Cloud will develop knowledge and skills that may be useful to these careers:
Quantitative Trader
A quantitative trader develops and implements automated trading strategies. This career utilizes programming skills, statistical analysis, and knowledge of financial markets to identify profitable trading opportunities. The DYDX Pairs Trading Bot course helps build a foundation in this area, specifically focusing on statistical arbitrage in the cryptocurrency market. This course's hands-on experience with the DYDX API, Python, and cloud deployment on AWS EC2 provides the practical skills needed to develop and deploy automated trading systems. The course is designed to create a pairs trading bot, which will give learners a head start in quantitative trading. The concepts of cointegration, spread calculation, z-score trading, and risk management are also covered.
Algorithmic Trader
Algorithmic traders design, build, and deploy automated trading systems that execute trades based on predefined rules. This career requires a solid understanding of programming, financial markets, and trading strategies. The DYDX Pairs Trading Bot course provides a practical introduction to algorithmic trading, focusing on the development of a pairs trading bot for the DYDX exchange. The course helps a learner understand how to interact with the DYDX API, implement statistical arbitrage strategies, and deploy the bot to the cloud using AWS EC2. The course's emphasis on automated trade execution and risk management makes it particularly relevant for aspiring algorithmic traders.
Trading System Developer
A trading system developer builds and maintains the software infrastructure that supports trading operations. This career requires strong programming skills, knowledge of financial markets, and experience with real-time data processing. The DYDX Pairs Trading Bot course helps a learner gain hands-on experience in developing a complete trading system, from data acquisition to trade execution and cloud deployment. The course's focus on the DYDX API, Python programming, and AWS EC2 deployment provides the practical skills needed to succeed in this role. The course will provide the ability to maintain a trading infrastructure.
Cryptocurrency Trader
A cryptocurrency trader analyzes market trends, executes trades, and manages risk in the cryptocurrency market. This career requires knowledge of blockchain technology, trading platforms, and market analysis techniques. The DYDX Pairs Trading Bot course helps a learner gain practical experience in cryptocurrency trading by building an automated trading bot for the DYDX exchange. This course's focus on statistical arbitrage, automated trade execution, and cloud deployment provides valuable skills for anyone looking to trade cryptocurrencies. Learning how to use Python, the DYDX API, and AWS EC2 will be helpful. The course provides a solid foundation in automated cryptocurrency trading strategies.
Financial Engineer
A financial engineer designs and develops new financial products and trading strategies, often using quantitative methods. The DYDX Pairs Trading Bot course helps a person to gain practical experience in developing and implementing an automated trading strategy. The course's focus on statistical arbitrage, Python programming, and cloud deployment provides valuable skills for designing and testing new trading models. Additionally, understanding how to use APIs will be helpful. The course's practical approach makes it beneficial for aspiring financial engineers.
Quantitative Analyst
A quantitative analyst, often called a quant, develops and implements mathematical models for pricing derivatives, managing risk, or identifying trading opportunities. This role requires strong analytical skills and knowledge of financial markets. The DYDX Pairs Trading Bot course helps a quantitative analyst better understand how to implement statistical arbitrage strategies in the cryptocurrency market. The course's coverage of cointegration, spread calculation, and z-score trading can complement a quantitative analyst's existing knowledge of financial modeling, and may enhance the ability to create trading strategies. The course provides a practical application of these concepts.
Financial Data Analyst
A financial data analyst gathers, cleans, and analyzes financial data to provide insights and support decision-making. The DYDX Pairs Trading Bot course may help a financial data analyst gain experience in working with APIs to access real-time market data and applying statistical analysis techniques to identify trading opportunities. The course's focus on data acquisition, processing, and analysis can be valuable for improving skills in financial data analysis. The concepts of cointegration, spread calculation, and z-score trading will also be helpful.
Data Scientist
A data scientist uses statistical and machine learning techniques to analyze data, identify patterns, and build predictive models. Data scientists are often involved in developing trading algorithms or risk management systems for financial institutions. The DYDX Pairs Trading Bot course helps a data scientist gain experience in applying statistical analysis to financial data and building automated trading strategies. The course's coverage of cointegration, spread calculation, and z-score trading may be valuable for building predictive models in finance. Furthermore, the course will teach learners how to use APIs.
Market Risk Analyst
A market risk analyst identifies, measures, and manages the market risks faced by a financial institution. Understanding automated trading strategies and their potential risks is crucial. The DYDX Pairs Trading Bot course may help a market risk analyst gain insights into the workings of algorithmic trading systems and the risks associated with automated strategies. The course's focus on risk management and automated trade execution can provide a valuable perspective for assessing market risks. The risk assessment concepts taught in this course will also be valuable.
Software Engineer
A software engineer designs, develops, and maintains software applications. While not directly related to finance, a software engineer with an interest in trading systems can find relevant skills in developing trading infrastructure or supporting algorithmic trading platforms. The DYDX Pairs Trading Bot course may help a software engineer improve their skills in Python programming, API interaction, and cloud deployment using AWS EC2. The course's focus on building an automated trading bot can provide experience in developing real-time data processing and automated decision-making systems. The course can improve your skills in coding.
Blockchain Developer
A blockchain developer designs and develops applications that leverage blockchain technology. While this role doesn't focus solely on trading, understanding how to interact with decentralized exchanges like DYDX is beneficial. The DYDX Pairs Trading Bot course may help a blockchain developer gain experience with the DYDX API and understand how to build applications that interact with a Layer 2 Ethereum exchange. This knowledge can be valuable for developing decentralized finance applications or building tools for cryptocurrency traders. The course can help developers learn how to interact with APIs.
Data Engineer
A data engineer builds and maintains the data infrastructure that supports data analysis and machine learning. In the context of trading, this involves building systems for collecting, processing, and storing real-time market data. The DYDX Pairs Trading Bot course may help a data engineer gain experience in working with APIs to access market data and deploying applications to the cloud using AWS EC2. The course's focus on data acquisition and processing can be valuable for building data pipelines for trading systems. The course will provide the opportunity to learn how to gather information through an application programming interface.
Financial Analyst
A financial analyst analyzes financial data, identifies trends, and provides insights to inform investment decisions. This role often involves building financial models and forecasting market behavior. While a financial analyst may not directly build trading bots, understanding automated trading strategies and market dynamics can be advantageous. The DYDX Pairs Trading Bot course may help a financial analyst gain insights into quantitative trading techniques and the use of APIs for data analysis. Additionally, the course's coverage of statistical arbitrage and cointegration may broaden the understanding of market relationships. The knowledge gained from learning the principles of the trading bot can be applied when dealing with financial models.
Investment Strategist
An investment strategist analyzes market trends and economic data to develop investment recommendations for clients or firms. While not directly building trading bots, understanding quantitative trading strategies can be advantageous. The DYDX Pairs Trading Bot course may help an investment strategist gain insights into the use of statistical arbitrage and automated trading in the cryptocurrency market. This knowledge can inform investment decisions and provide a deeper understanding of market dynamics. The course may also help in Python development.
Portfolio Manager
A portfolio manager constructs and manages investment portfolios to meet specific client objectives. While a portfolio manager might not directly code trading bots, understanding various trading strategies is essential. The DYDX Pairs Trading Bot course may help a portfolio manager gain insights into quantitative trading strategies and the use of APIs for data analysis, especially in the cryptocurrency market. The portfolio manager may find that understanding how these models work from a technical level is advantageous. The course will provide a basis to improve an awareness of automated cryptocurrency trading strategies.

Reading list

We've selected one books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in DYDX Pairs Trading Bot Build in Python Running in the Cloud.
Provides a comprehensive guide to using Python for financial analysis and trading. It covers topics such as data analysis, time series analysis, and algorithmic trading. It is particularly useful for understanding how to apply Python to real-world financial problems. This book valuable reference for students looking to deepen their understanding of financial applications using Python.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser