Inspiration
We wanted to take advantage of the inefficiencies in the dual listing to arbitrage the differences in price
What it does
Arbitrage keeping to the limits set by the exchange. Calculates volume to trade based on linear transforms of expansions of sigmoid functions to weight both the value of the arbitrage as well as the exposure limits, to minimize the portfolios average exposure to the market.
How we built it
We firstly made a simple arbitrage checking function that worked on one side of the exchange and flagged when there was an opportunity for arbitrage. Then we made the do Arbitrage function which completes the trade. Once we confirmed that this was working as intended, we expanded the function to both sides of the possible arbitrage, encountering some issues which we managed to resolve (See next section). We had the arbitrage working albeit with fixed volumes and then added some simple checks to stay within the limits . At this point, we needed a way of adapting our volumes to more actively ‘zero’ our position. Initially, we had a small margin/big margin strategy which provided good returns and was based on hard limits on the trading volume when our profit from the arbitrage was 0.1 or 0.3 per stock.
Challenges we ran into
We faced challenges when our code would not execute in the way we intended for example it was one sided on the buy A Sell B arbitrage. To get to the route of these problems we placed print checks at all key points so we could track where the code diverged from our intended outcome. Through this we were able to see that a return in an if statement was causing the doArbitrage function to end prematurely, before having the chance to execute a buy A Sell B Arbitrage. Regrading the order type, we encountered situations where we were not filled on our limit trades would it remain in the books, changing our delta and unbalancing our arbitrage. In order to counter this we changed the order type to ioc so that the volume of the order would take the max possible at the set price and ignore the rest. Another challenge we encountered was a tendency for the first weight functions to allow trading to go beyond the set limits or led us to keep far from the limits. This led us to refine the Limit Weight function from binary (either we can trade or we cannot), to linear to piecewise linear to finally a sigmoid (or rather the expansion of one for speed). These improvements allowed us to refine the algorithm to be able to get close to the preset limit.
Accomplishments that we're proud of
Competing against other arbitrage trading bots and being competitive through out the night placing top 3 consistently
What's next for Optibook_Team_34_Code_9KGaKyF5
Possibly adapting the volume weightings using a function to more effectively rebalance or positions Creating a momentum field to minimize loss if the portfolio becomes unbalanced and to keep the portfolio delta neutral Looking into market making for a more constant cash flow
Log in or sign up for Devpost to join the conversation.