Inspiration
Optiver market trading platform.
What it does
- Improves the alignment of ETF buckets with their underlying stocks while making money.
- Market Making -- increases the liquidity of the ETFs by decreasing the sell-buy spread while making money.
How we built it
- python bot using the Optiver
module
- tested on a market simulation
Challenges we ran into
- self trading while using limit orders
- risk management (keeping our stock hedged, so that we are not exposed to the stock market fluctuations)
- there is no feedback on whether an instant transaction went through in the response (the
successdoes not indicate, whether the order was fulfilled)
Accomplishments that we're proud of
- positive money income in the simulation
What we learned
- more in-depth workings of stock markets, especially ETFs
Detailed look into the insides
We started by simple bot that detects, when ETFs lag behind their stocks in a way that allows as to make money while lowering the lag in the process. Here we learned how to stay within the bounds of position limits (amount of stock owned) and the importance and utility of hedging.
Later we learned that using limit orders for the lag reduction leads to slightly better performance and better hedging. However there is still a risk of a stale order remaining unfulfilled and leading to risky, unhedged portfolio.
Finally, we implemented a spread reduction (reduce_gap, Market Making) technique, that increases the liveness of the traded ETF by tying it to the underlying stocks. It is similar to the lag reduction with limit orders, but we allow the bot to post its own buy/sell orders, not just react to the market. We also added a re-hedging algorithm, that keeps us hedged when some transactions did not go through.
However this meant that we needed to revert to using instant orders in the lag reducing technique, as we ran into self-trading, which is forbidden.
We have several constants that allow us to manage risks, like the maximum order volume, maximum position boundaries, how aggressive the re-hedging algorithm is (how much losses it is allowed to make in order to re-hedge) and the margin of the spread reduction algorithm.
We see two big opportunities for improving our algorithm:
- smarter market modeling in re-hedging (better than exponential mean, better tracking of actual losses)
- decouple read and write market operations to find better opportunities in the market while not going over the transaction limit
Built With
- amazon-web-services
- optibook
- python
Log in or sign up for Devpost to join the conversation.