What it does

Our project is a sophisticated market-making and arbitrage trading bot designed to operate in financial markets. The bot aims to enhance liquidity in these markets by continuously providing bid and ask orders based on dynamic pricing strategies. These strategies included: Spread Targeting (dynamically adjust the bid-ask spread around the mid-price to respond to changes in market volatility and liquidity), Inventory Management and Arbitrage Pricing (In the case of arbitrage opportunities, our bot dynamically calculates the optimal bid and ask prices to capitalize on price differentials between related instruments in different markets). Accordingly, our tool identifies arbitrage opportunities between different instruments to exploit price discrepancies across markets, thereby generating profits.

How we built it

The project is built using Python and leverages the Optibook synchronous client library to interact with the exchange's API in a synchronous manner. Accordingly, the core functionalities of the bots we built were as follows:

Market Making Strategy: Implemented a market-making strategy that adjusts bid and ask prices based on inventory levels and spreads to enhance liquidity. The strategy involves dynamically adjusting prices and volumes to maintain a balanced inventory and respond to market conditions.

Arbitrage Trading: Developed an arbitrage trading algorithm that identifies and exploits price differentials between related instruments in different markets. The algorithm executes buy and sell orders simultaneously to capture profits from the price inefficiencies.

Challenges we ran into?

API Limitations: One of the major challenges we encountered was navigating the limitations and constraints imposed by the exchange's API. We had to carefully manage rate limits, handle API errors, and optimize API calls to ensure efficient data retrieval and order placement. Due to other users implementing the same strategies we also had execute our calls simultaneously via Pipelining after every API call.

Real-time Data Processing: Processing real-time market data and making timely trading decisions posed a significant challenge. We needed to implement efficient algorithms and data structures to handle large volumes of data and execute trades swiftly to capitalize on market opportunities.

Risk Management: Developing effective risk management mechanisms to mitigate potential losses and ensure the stability of the trading bot was a complex task. We had to carefully balance risk and reward, implement stop-loss mechanisms, and monitor position exposures to safeguard against adverse market movements. Additionally, we also failed to consider any transaction fees that exist in the market.

Market Dynamics: Understanding and adapting to the dynamic nature of financial markets posed ongoing challenges. We had to continuously monitor market conditions, adapt our strategies to evolving trends, and anticipate changes in liquidity, volatility, and price movements. We tried to go for a strategy where we try find patterns in previous market data, to predict where prices will go but that was simply not as effective as many other approaches we could have taken.

What we learned

Throughout the development of this project, we gained valuable insights into several key areas:

Algorithmic Trading Strategies: Explored various market-making and arbitrage strategies and gained a deep understanding of their implementation in real-world trading environments.

API Integration: Learned how to effectively integrate with exchange APIs to retrieve market data, place orders, and manage trading activities.

Risk Management: Developed skills in risk management by implementing inventory control mechanisms and order execution strategies to minimize losses and optimize profitability.

Accomplishments that we're proud of

Overall, this project provided us with hands-on experience in algorithmic trading, API integration, risk management, and market analysis, equipping us with valuable skills sought after in the finance and technology industries.

Built With

Share this project:

Updates