atkinson / wagmi

An execution framework for systematic strategies
BSD 2-Clause "Simplified" License
10 stars 12 forks source link

FtxExchange should cater for futures and spot #4

Open atkinson opened 2 years ago

atkinson commented 2 years ago

The ftx API treats futures and spot differently; we should not conflate them.

execution.exchanges.Exchange defines a base class for Exchanges (currently the only implementation is execution.exchanges.ftx.FtxExchange which is incomplete).

We need to support strategies that work with spot, and futures.

atkinson commented 2 years ago

Also, implement some better execution logic.

CharlesFr commented 2 years ago

I think we should consider the use case where we know we want to trade an asset but acknowledge that it can be more profitable to get exposure via other instruments or even exchanges.

What do you think about removing the quote currency from the Security model and adding a symbol and exchange attribute to? That way, when a StrategyPositionRequest is created we can insert an additional piece of logic that will choose optimal symbol and eventually exchange.

Initially we can keep it simple, long = spot, short = perp

We will need to handle shifts from one symbol to another, and ensure frequency of this happening is as low as possible.