Giter Site home page Giter Site logo

deribit_pnl's Introduction

Deribit PnL Calculator (realized + unrealized)

This is a Streamlit app that calculates and displays Profit and Loss (PnL) information for trades on the Deribit cryptocurrency exchange. It utilizes the Deribit API to fetch trade and price data, and a SQLite database to store transaction records. The app displays PnL summaries by currency and instrument, and allows users to refresh the PnL calculations.

Deribit PnL calculator

Features

  • Calculate and display PnL information for trades on Deribit.
  • Filter PnL data by date range.
  • Display PnL summaries by currency and instrument.
  • Refresh PnL calculations using the Deribit API.

Getting Started

  1. Clone the repository:

    git clone https://github.com/your-username/deribit-pnl-calculator.git
    cd deribit-pnl-calculator
  2. Install the required packages:

    pip install -r requirements.txt
  3. Configure the app:

    • Create a config.json file with your Deribit API credentials and other configuration options.
  4. Run the app:

    streamlit run streamlit_gui.py
  5. Use the app:

    • Select a date range for PnL calculations.
    • View PnL summaries by currency and instrument.
    • Click the "Refresh PnL" button to update calculations.

Dependencies

  • Python 3.7+
  • Streamlit
  • pandas
  • asyncio
  • websockets
  • SQLite

Configuration

Create a config.json file in the project root with the following structure:

{
  "db_path": "path/to/your/database.db",
  "deribit": {
    "client_id": "your_client_id",
    "client_secret": "your_client_secret",
    "client_url": "wss://www.deribit.com/ws/api/v2",
        "currencies": [
            "BTC",
            "ETH"
        ]
  }
}

Replace path/to/your/database.db with the path to your SQLite database.

License

This project is licensed under the MIT License.

deribit_pnl's People

Contributors

nostoz avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.