Closed andreimerfu closed 1 year ago
Hi @andreimerfu, I am planning to support Binance Futures. But this will take a while. I'm working alone on the project.
Let me know how I can help with this feature. I'm not sure how do you want to include this feature in the current codebase. I'm wondering how we can change the Balance struct by using terms like Wallet Balance
, Margin Balance
, and Unrealized PNL
without damaging the SPOT market. Also, I'm not sure where we'll introduce the leverage details for each asset.
Any feedback, ideas from your side will be helpful. Thanks! 🙇🏻
I do not have any idea yet. The logic is more complex for Futures Market. Maybe we can split in different brokers. Split the wallets and exchanges into two different kinds. The backtesting is more complex too. The project needs a big refactoring for this feature.
@andreimerfu we can create a new branch to explore some ideias, what you think?
Currently, this is the structure of the bot
We can use all the structure of Data Feeds, Order Feeds, Plugins and Storage.
We have to modify controllers and exchange modules. The exchange is an interface composed by two parts
When we are in a backtesting, we use Broker = Paperwallet
, Feeder = CSV Feeder
When we are in a simulation with live data, we use Broker = Paperwallet
, Feeder = Binance
When we are in production environment, we user Broker = Binance
, Feeder = Binance
Theses abstractions helps to create different scenarios.
All the orders and candles are transmitted with pub-sub pattern in "feeds". For exemple, the chart moduele receives candles
and orders
, then it requires a subscription in OrderFeed
and DataFeed
.
The concept is simple, but we have a big issue with the leverage token and isolation of wallets.
Now we have a testnet for futures market, it will be great in the module implementation: https://testnet.binancefuture.com/en/futures/BTCUSDT
Initial support available
binance, err := exchange.NewBinanceFuture(ctx,
exchange.WithBinanceFutureCredentials(cfg.BinanceKey, cfg.BinanceSecret),
)
Do you have any plan to add support for Binance futures in the near future? Thanks!