nautechsystems / nautilus_trader

A high-performance algorithmic trading platform and event-driven backtester
https://nautilustrader.io
GNU Lesser General Public License v3.0
2.22k stars 507 forks source link

Support of perpetual futures contract #1484

Open quant2008 opened 10 months ago

quant2008 commented 10 months ago

Could nautilus support crypto perpetual futures contract . Trading of perpetual futures contract implies paying (or receiving) funding payments periodically based on the funding rate - usually every 8-24 hours. Open positions with perpetual futures contract must be collateralized with USD pegged stablecoins (linear) or with the crypto asset itself like BTC or ETH (inverse).

https://en.wikipedia.org/wiki/Perpetual_futures

cjdsellers commented 9 months ago

Hi @quant2008

The platform supports crypto perpetual futures contracts, we have the instruments defined and these can be traded live or backtest. What isn't simulated for backtesting however is the funding rates.

This is likely to come in a future upgrade to accounting, with extendable commission/fee models - but is too far down on the priority list to be able to give an accurate estimate for.

I'd be happy to discuss any ideas you may have though on how we could incorporate this into the current codebase, as it shouldn't be too hard to just add funding rate data and periodic account state events as the backtest progresses.

lukeg826 commented 2 months ago

Has there been any movement to add support for funding fees? I'm happy to do some of the heavy lifting here if it hasn't been started yet.

cjdsellers commented 2 months ago

Hey @lukeg826

Thanks for reaching out.

There's some discussion related to this currently happening on the discord https://discord.com/channels/924497682343550976/1275044082883756092/1287651355535740980