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 '{"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

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.2.0.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.2.0-py3-none-any.whl (2.0 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: orion_finance_sdk_py-1.2.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

Hashes for orion_finance_sdk_py-1.2.0.tar.gz
Algorithm Hash digest
SHA256 2febcede3d989a8ae09de16becd8dd86a7d19d5dc477be892938aa8bca016189
MD5 92626c7325606d26ff453174af9a4621
BLAKE2b-256 e3c2a1f460f550d85216b3dbab7bf5485da83e4c9b6fed8442091d3f5c99320d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for orion_finance_sdk_py-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b295107d5db0cbfcf1574aa8246cba55d57f2ca0e2c5f933ed640ae050b95a6a
MD5 5dd0755fec6e77d749f01fe681c7cf3a
BLAKE2b-256 76cfca56049d0988199279d0d41076d73c0f7c2464bb25bdf577c5d646522098

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