Skip to main content

A Python SDK for interacting with Orion Finance smart contracts

Project description

orion-finance-sdk-py

codecov Github Actions

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

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

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

Deploy a new Transparent Orion vault

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

# Use off-chain stack to generate an order intent
echo '{"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238": 0.4, "0x662DE589197f56aE9231Feb4CF591572339a47D9": 0.2, "0x473c1c81d480E8A0C53797ABcA282447319180d7": 0.15, "0x5C737d4EE9E8ab58a79adDF3764F94064ef7f8F9": 0.15, "0xF35E36Ba9ebA6c4Da1547ba2D8D5AC1dfC354B68": 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

orion update-strategist --new-strategist-address 0x92Cc2706b5775e2E783D76F20dC7ccC59bB92E48

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.1.0.tar.gz (1.9 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.1.0-py3-none-any.whl (1.9 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: orion_finance_sdk_py-1.1.0.tar.gz
  • Upload date:
  • Size: 1.9 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.1.0.tar.gz
Algorithm Hash digest
SHA256 ea9bb809c85a204af2fe47b561fb70ee92776e353bf34090ad7e4f8450fce63a
MD5 12457649fdfac8694e80b88dea6a28d1
BLAKE2b-256 8c9b908c4444e9ffe33fe8beeeea85493d2cb9577cd6fd320c5c14cd337f3e72

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for orion_finance_sdk_py-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36eb4bf2721b7fa1e3d406fd6757bb6758b7380202c464599dc5c6de4eb55d68
MD5 d011457c53cbeac7771e9412aefab16b
BLAKE2b-256 0564abe142b63f0156175a4167f7e7c45b262f2af6a6d32b9df3f13208a84ec3

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