Skip to content

dYdX Accounting #9239

@AlexCatarino

Description

@AlexCatarino

Expected Behavior

Trading BTCUSD/BTCUSDT in dYdX and Bybit shouldn't have very different results

Actual Behavior

Trading B&H BTCUSD with dYdX has $1.00 of Holdings and Volume. In Bybit, we have ₮89,511.75 of Holdings .

Potential Solution

N/A

Reproducing the Problem

from AlgorithmImports import *
class dYdXBrokerageExampleAlgorithm(QCAlgorithm):
    def initialize(self):
        self.set_start_date(2026, 1, 19)
        self.set_account_currency("USD", 100000)
        self.set_brokerage_model(BrokerageName.DYDX, AccountType.MARGIN)
        self._btc = self.add_crypto_future("BTCUSD")
    def on_data(self, data):
        if self._btc.invested or not self._btc.has_data:
            return
        self.market_order(self._btc, 1)
from AlgorithmImports import *

class dYdXBrokerageExampleAlgorithm(QCAlgorithm):
    def initialize(self):
        self.set_start_date(2026, 1, 19)
        self.set_account_currency("USDT", 100000)
        self.set_brokerage_model(BrokerageName.BYBIT, AccountType.MARGIN)
        self._btc = self.add_crypto_future("BTCUSDT")
    def on_data(self, data):
        if self._btc.invested or not self._btc.has_data:
            return
        self.market_order(self._btc, 1)

Checklist

  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions