Inspiration
Enabling everyone to trade ESG compliant stocks and ETFs requires liquidity in the market. To provide this, market makers can use different strategies to ensure this. In this challenge we had to act as exactly such a market maker.
We explored possible trading algorithms suited to market makers and built a trading system to work under different market conditions.
What it does
We built a trading bot that acts as a market maker and provides fair prices to market participants, especially in regards to ESG trading.
The algorithm is capable of doing arbitrage, quoting and portfolio rebalancing combined with hedging where applicable.
To do arbitrage, we spot price inbalances in the market and exploit these by comparing the ETF price with the individual stock price it's basket consists of. When seeing an opportunity, We use IOC orders to trade the ETF and sell it in favor of stocks or vice versa.
Our quoting algorithm calculates a fair bid and ask price for a basket instrument and calculates the ETF score based up on it. Afterward, looking at the order book of the ETF, we calculate a risk score to evaluate which margins are applicable without taking too much of a risk. The risk score is based on order volume and prices in the order books and enables the bot to estimate suitable prices. When the quoting limit order is executed, we hedge it as fast as possible.
Hedging and non-fully executed orders can lead to an imbalance in our portfolio, which limits the amount of stocks / ETFs we can buy due to the inventory limit. To cope with this situation, we developed an algorithm that rebalances our portfolio while also trying to make a profit. For that matter we take the current market situation as well as the price at which assets were bought into consideration.
In our role as a market maker, we decided not to actively acquire long or short positions, as our focus is to make the market more liquid.
How we built it
To compete in a live-trading environment, we build a trading bot using the Optibook framework. It enabled us to compete against other trading bots, as wells as work with other market participants. Thus, it was possible to measure how our algorithm performs in different market situations and improve it on the go.
Challenges we ran into
During the development, we needed to be faster than everybody else when trading. Adding to that, we tried to avoid sleeps, unless absolutely necessary, to be able to trade when necessary.
When developing a trading bot, one of the main requirements is to balance our risks. To do so, we compared potential profit against potential money to lose.
Further challenges were that markets are not predictable, which led to things going wrong, suddenly crashing markets, market manipulating competitors or unbalanced inventories.
In the process of the project, we tackled the above mentioned challenges
Accomplishments that we're proud of
Fast implementation of a working trading bot that outperformed the market. With more competition, we gradually improved to algorithm by including more advanced trading strategies and tried out different ones to reach our goal.
What we learned
During the project, we learned how market making in the stock market works. This was especially interesting due
What's next for stonksmaker
Our next steps are to further improve the algorithms to cope with more complex market conditions, and for example include shorting strategies if applicable
Log in or sign up for Devpost to join the conversation.