Metadata-Version: 2.4
Name: orion-finance-sdk-py
Version: 1.2.0
Summary: A Python SDK for interacting with Orion Finance smart contracts
Author: Orion Finance
License: BSD 3-Clause License
        
        Copyright (c) 2025, Orion Finance
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: python-dotenv<2.0.0,>=1.1.0
Requires-Dist: numpy<3.0.0,>=2.2.0
Requires-Dist: typer<1.0.0,>=0.16.0
Requires-Dist: web3<8.0.0,>=7.12.0
Requires-Dist: questionary<3.0.0,>=2.0.0
Provides-Extra: dev
Requires-Dist: pre-commit<4.6.0,>=4.1.0; extra == "dev"
Requires-Dist: ruff<1.0.0,>=0.9.10; extra == "dev"
Requires-Dist: pydocstyle<6.4.0,>=6.3.0; extra == "dev"
Requires-Dist: pytest<9.1.0,>=8.3.5; extra == "dev"
Requires-Dist: pytest-cov<8.0.0,>=6.0.0; extra == "dev"
Requires-Dist: pydeps<4.0.0,>=3.0.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx<10.0.0,>=8.1.0; extra == "docs"
Requires-Dist: pydata-sphinx-theme<1.0.0,>=0.16.0; extra == "docs"
Requires-Dist: myst-parser<6.0.0,>=4.0.0; extra == "docs"
Requires-Dist: sphinx-copybutton<1.0.0,>=0.5.0; extra == "docs"
Requires-Dist: sphinx-design<1.0.0,>=0.6.0; extra == "docs"
Requires-Dist: sphinx-autodoc-typehints<4.0.0,>=3.0.0; extra == "docs"
Dynamic: license-file

# orion-finance-sdk-py

<div align="center">

[![codecov][codecov-badge]][codecov] [![Github Actions][gha-badge]][gha]


</div>

[gha]: https://github.com/OrionFinanceAI/orion-finance-sdk-py/actions
[gha-badge]: https://github.com/OrionFinanceAI/orion-finance-sdk-py/actions/workflows/build.yml/badge.svg

[codecov]: https://codecov.io/gh/OrionFinanceAI/orion-finance-sdk-py/graph/badge.svg?token=SJLL2VVQDS
[codecov-badge]: https://codecov.io/gh/OrionFinanceAI/orion-finance-sdk-py/branch/main/graph/badge.svg

[docs]: https://sdk.orionfinance.ai/
[docs-badge]: https://img.shields.io/badge/Documentation-Read%20the%20Docs-blue?style=for-the-badge&logo=readthedocs&logoColor=white

## About

A Python Software Development Kit (SDK) to facilitate interactions with the Orion Finance protocol. This repository provides tools and utilities for quants and developers to seamlessly integrate with Orion's [on-chain portfolio management infrastructure](https://github.com/OrionFinanceAI/protocol).

<div align="center">
  
[![Documentation][docs-badge]][docs]

</div>

For comprehensive documentation, including setup guides, API references, and developer resources, visit [sdk.orionfinance.ai](https://sdk.orionfinance.ai/).

## License

This software is distributed under the BSD-3-Clause license. See the [`LICENSE`](./LICENSE) file for the full text.

## Setup for Development

If you're working on the SDK itself:

```bash
# Clone the repository
git clone https://github.com/OrionFinanceAI/orion-finance-sdk-py.git
cd orion-finance-sdk-py

# Install dependencies
make uv-download
make venv
source .venv/bin/activate
make install

# Run tests
make test

# Run tests with coverage
make test  # Coverage is included automatically

# Run code style checks
make codestyle

# Run docstring checks
make docs
```

### Installation from PyPI

For end users, install the latest stable version from PyPI:

```bash
pip install orion-finance-sdk-py
```

## Environment Variables Setup

The SDK requires the user to specify an `RPC_URL` environment variable in the `.env` file of the project. Follow the [SDK Installation](https://sdk.orionfinance.ai/) to get one.

Based on the usage, additional environment variables may be required, e.g.:
- `STRATEGIST_ADDRESS`: The address of the strategist account.
- `MANAGER_PRIVATE_KEY`: The private key of the vault manager account.
- `STRATEGIST_PRIVATE_KEY`: The private key of the strategist account.
- `ORION_VAULT_ADDRESS`: The address of the Orion vault.

## Examples of Usage

### List available commands

```bash
orion --help
orion deploy-vault --help
orion submit-order --help
```

### Deploy a new Transparent Orion vault

```bash
orion deploy-vault --vault-type transparent --name "Algorithmic Liquidity Provision & Hedging Agent" --symbol "ALPHA" --fee-type hard_hurdle --performance-fee 10 --management-fee 1
```

### Submit an order intent to a vault

```bash
# Use off-chain stack to generate an order intent
echo '{"0x...": 0.4, "0x...": 0.2, "0x...": 0.15, "0x...": 0.15, "0x...": 0.1}' > order_intent.json

# Submit the order intent to the Orion vault
orion submit-order --order-intent-path order_intent.json
```

### Update the strategist address for a vault

```bash
orion update-strategist --new-strategist-address 0x...
```

### Update the fee model for a vault

```bash
orion update-fee-model --fee-type high_water_mark --performance-fee 5.5 --management-fee 0.1
```
