Metadata-Version: 2.4
Name: orion-finance-sdk-py
Version: 1.3.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.14,>=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,>=1.21.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: parquet
Requires-Dist: pyarrow<20.0.0,>=14.0.0; extra == "parquet"
Provides-Extra: dev
Requires-Dist: pyarrow<20.0.0,>=14.0.0; extra == "dev"
Requires-Dist: eth-ape>=0.8.0; extra == "dev"
Requires-Dist: ape-hardhat<2.0.0,>=0.8.0; extra == "dev"
Requires-Dist: ape-alchemy<2.0.0,>=0.8.0; extra == "dev"
Requires-Dist: ape-etherscan<2.0.0,>=0.8.0; 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: ty>=0.0.1; 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"
Requires-Dist: sphinx-llms-txt>=0.7.0; extra == "docs"
Dynamic: license-file

<div align="center">

<img src="./assets/Orion_Logo_white_horizontal.png" alt="Orion" width="75%">

[![codecov][codecov-badge]][codecov] [![Sourcery][sourcery-badge]][sourcery] [![Github Actions][gha-badge]][gha] [![Ape][ape-badge]][ape]

[![LinkedIn][linkedin-badge]][linkedin] [![X][x-badge]][x] [![Telegram][telegram-badge]][telegram] [![Discord][discord-badge]][discord]

</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

[sourcery]: https://sourcery.ai
[sourcery-badge]: https://img.shields.io/badge/Sourcery-enabled-brightgreen

[ape]: https://docs.apeworx.io/
[ape-badge]: https://img.shields.io/badge/Built%20with-Ape-8C52FF.svg

[linkedin]: https://www.linkedin.com/company/orionfinance/
[linkedin-badge]: https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white

[x]: https://x.com/OrionFinanceAI
[x-badge]: https://img.shields.io/badge/X-000000?style=for-the-badge&logo=x&logoColor=white

[telegram]: https://t.me/orionfinance_ai
[telegram-badge]: https://img.shields.io/badge/Telegram-2CA5E0?style=for-the-badge&logo=telegram&logoColor=white

[discord]: https://discord.gg/8bAXxPSPdw
[discord-badge]: https://img.shields.io/badge/Discord-5865F2?style=for-the-badge&logo=discord&logoColor=white

[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 (includes coverage)
make test

# 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 uses `RPC_URL` from your `.env` if set; otherwise it uses a default public RPC. See [SDK Installation](https://sdk.orionfinance.ai/) for optional RPC setup.

Additional variables depend on what you do:
- **Deploy a vault:** `STRATEGIST_ADDRESS`, `MANAGER_PRIVATE_KEY`
- **Submit orders:** `ORION_VAULT_ADDRESS`, `STRATEGIST_PRIVATE_KEY`
- **Update strategist / fee model / deposit access:** `ORION_VAULT_ADDRESS`, `MANAGER_PRIVATE_KEY`

## Examples of Usage

The SDK supports **transparent** Orion vaults: deploy, read state, submit order intents, and manage fees/strategist via the CLI or Python API.

### List available commands

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

### Deploy a new Orion vault

```bash
orion deploy-vault --strategist-address 0x... --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

`submit-order` accepts **`--order-intent`** (alias **`--order-intent-path`**):

- **File:** `.json` (object mapping addresses → weights that sum to 1), `.csv` / `.parquet` (tabular; see [docs](https://sdk.orionfinance.ai/))
- **Inline:** a JSON object or Python `dict` literal string (no file needed)

```bash
# From a JSON file
echo '{"0x...": 0.4, "0x...": 0.2, "0x...": 0.15, "0x...": 0.15, "0x...": 0.1}' > order_intent.json
orion submit-order --order-intent order_intent.json

# Inline
orion submit-order --order-intent '{"0x...": 0.4, "0x...": 0.6}'
```

Parquet support requires **pyarrow** (`pip install 'orion-finance-sdk-py[parquet]'` or it is included in the dev extra).

### 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
```
