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.
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 probes default public Sepolia RPCs in order (1rpc.io → 0xrpc.io → publicnode), matching install.sh. For long historical queries, set your own RPC_URL (e.g. Alchemy/Infura). 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 - Read vault data: pass
contract_address=or setORION_VAULT_ADDRESS
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
dictliteral 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...
PIT prices and portfolio %TVL (Python)
from orion_finance_sdk_py import OrionTransparentVault, PriceAdapterRegistry
prices = PriceAdapterRegistry().get_prices() # full investment universe
vault = OrionTransparentVault()
weights = vault.get_portfolio_pct_tvl() # portfolio as fractions of PIT TVL
Discover vaults, metadata, and intent (Python)
from orion_finance_sdk_py import OrionConfig, OrionTransparentVault
config = OrionConfig()
for addr in config.orion_transparent_vaults:
vault = OrionTransparentVault(contract_address=addr)
print(vault.name, vault.symbol, vault.share_price)
intent = vault.get_intent() # target weights (fractions, sum ≈ 1)
current = vault.get_portfolio_pct_tvl() # PIT allocation
# Compare intent vs current for expected rebalancing (in your notebook)
Vault share price history (notebook)
The SDK reads on-chain share prices (live or historical). Use pandas in your notebook for correlation analysis:
from datetime import datetime, timezone, timedelta
from orion_finance_sdk_py import OrionConfig, OrionTransparentVault
config = OrionConfig()
vault_addr = config.orion_transparent_vaults[0]
vault = OrionTransparentVault(contract_address=vault_addr)
end = datetime.now(timezone.utc)
start = end - timedelta(days=30)
series = vault.share_price_history(start=start, end=end, interval="1d")
# series: [{"timestamp", "block", "share_price"}, ...]
# Optional — analytics stay in the notebook:
# import pandas as pd
# df = pd.DataFrame(series).set_index("timestamp")
# df["share_price"].pct_change().corr(...)
Update the fee model for a vault
orion update-fee-model --fee-type high_water_mark --performance-fee 5.5 --management-fee 0.1
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file orion_finance_sdk_py-1.4.0.tar.gz.
File metadata
- Download URL: orion_finance_sdk_py-1.4.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41a6a402e771d160c1848f32445a172be58ab21f94f799d3426d69eed5c3641d
|
|
| MD5 |
c2c7724a2684cd50f210ee6431b4f5f0
|
|
| BLAKE2b-256 |
d5c7425c2d926da0e79aa967d06d4d4c342bf80437d3bb6fdbcb3299718a5c06
|
File details
Details for the file orion_finance_sdk_py-1.4.0-py3-none-any.whl.
File metadata
- Download URL: orion_finance_sdk_py-1.4.0-py3-none-any.whl
- Upload date:
- Size: 2.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09bf8853d85cc8f1e1d34b16debdfca9d9dd450942c7600430275c68ec6bad23
|
|
| MD5 |
db121f4e761147847fe9dd981cc3292e
|
|
| BLAKE2b-256 |
1ac447c4bfc68cd2aab452c11321726169523dd20add7e4671e71ca17e826911
|