Skip to main content

A Python SDK for interacting with Orion Finance smart contracts

Project description

Orion

codecov Sourcery Github Actions Ape

LinkedIn X Telegram Discord

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.

Documentation

For comprehensive documentation, including setup guides, API references, and developer resources, visit sdk.orionfinance.ai.

License

This software is distributed under the BSD-3-Clause license. See the LICENSE file for the full text.

Setup for Development

If you're working on the SDK itself:

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

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

orion --help
orion deploy-vault --help
orion submit-order --help

Deploy a new Orion vault

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)
  • Inline: a JSON object or Python dict literal string (no file needed)
# 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

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

Update the fee model for a vault

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

orion_finance_sdk_py-1.3.1.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

orion_finance_sdk_py-1.3.1-py3-none-any.whl (2.0 MB view details)

Uploaded Python 3

File details

Details for the file orion_finance_sdk_py-1.3.1.tar.gz.

File metadata

  • Download URL: orion_finance_sdk_py-1.3.1.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for orion_finance_sdk_py-1.3.1.tar.gz
Algorithm Hash digest
SHA256 6683a79ba1123cd8eac83abb69fc74ddb8242733517ceace2d2460e4c799a2e0
MD5 adf624b799713a200f2d5193174e1263
BLAKE2b-256 9d9215a4d5aa27ff5c60de7afff1c91ea71184c36fbbb1a43626ad4a77a9a9d1

See more details on using hashes here.

File details

Details for the file orion_finance_sdk_py-1.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for orion_finance_sdk_py-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 489c60ef36f812cadb09aed163a779b9c2f7b2635191dfbbb26f819668fcfcb9
MD5 5fecc2a1f1e8c1cc5ad621875493261e
BLAKE2b-256 212f5218ab44ea8418cdbe82c51e71d1827d3e41eafbcb84e1f8d19fd764fcf8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page