Skip to content

Interactive Brokers

Table of Contents

Overview

Interactive Brokers is a project designed to interface with stock markets, providing real-time stock prices and facilitating order placement and information retrieval. The project consists of two main services:

  1. Data Service: Responsible for collecting real-time stock prices.
  2. Web Service: Handles order placements and provides information about shares. This service is accessible from outside and is protected using authentication mechanisms.

Technologies

This project is built using the following technologies:

  • Python: The core programming language for developing both services.
  • FastAPI: A modern, fast (high-performance), web framework for building APIs with Python.
  • IB (Interactive Brokers API): Used for accessing market data and trading functionalities. Using ib_insync, a Python wrapper for the IB API.
  • PostgreSQL: Used for storing and managing data.
  • SQLAlchemy: An SQL toolkit and ORM that gives application developers the full power and flexibility of SQL.

Application Architecture

Data Service

The Data Service is designed to continuously collect and update real-time stock prices. It utilizes the Interactive Brokers API to fetch the latest market data and can be extended to include other data sources.

Web Service

The Web Service provides endpoints for placing orders, retrieving share information, and managing user accounts. This service is designed to be accessed securely from outside the organization using authentication methods.

Authentication

The Web Service is protected using authentication. Users must provide valid credentials to access the API endpoints. This ensures that only authorized users can place orders and retrieve share information.

API Reference

Refer to the API Documentation for detailed information on each endpoint, including request and response formats, and examples.