Dear Community,

Crypto-savvy members of the community have long asked for DeFi exchange integration on the platform. We’re pleased to share that our integration with dYdX Crypto Perpetuals is now live on QuantConnect!

This integration lets users do jupyter research, run backtests and optimizations, along with deploying strategies live to trade perpetuals on dYdX. At this time, dYdX perpetuals trading is not available in the United States, Canada, or other restricted jurisdictions. All use of dYdX is subject to Terms of Use.

Adding any of the 220 dYdX assets to your strategy is simple with the QuantConnect platform. Setting the brokerage model* configures all the fees, leverage, and dataset configuration required, allowing you to add the perpetuals you need.

# Set the correct dYdX exchange models *
self.set_brokerage_model(BrokerageName.DYDX)

# Request market rates for dYdX exchange:
self.add_crypto_future("BTCUSD", Resolution.MINUTE, market=Market.DYDX)
* dYdX is labeled as a "brokerage" solely for convenience, as this classification is used by QuantConnect’s API. dYdX is not a brokerage; it is a decentralized, disintermediated, and permissionless protocol. dYdX is not regulated by any government authority, and users trade at their own risk.

We have onboarded dYdX market data since the dYdX Chain began in May 2021, allowing you to backtest your strategies across various market regimes. Trades and quotes are available in tick, second, minute, hour, and daily resolutions.

This integration is available completely open-source, and available to users of the Cloud Platform, LEAN CLI, and Local Platform. We’ve implemented Market, Limit, Stop Market, and Stop Limit Order types.

To get started, check out the new dYdX documentation.

Happy Trading!

QuantConnect Team