Skip to main content

A Python SDK for interacting with Orion Finance smart contracts

Project description

orion-finance-sdk Github Actions

About

A Python Software Development Kit (SDK) to ease interactions with the Orion Finance protocol and its Vaults. This repository provides tools and utilities for quants and developers to seamlessly integrate with Orion's portfolio management on-chain infrastructure.

For additional information, please refer to the Orion documentation, and the curator section in particular.

Licence

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

Installation

From PyPI (Recommended)

Install the latest stable version from PyPI:

pip install orion-finance-sdk

From Source

For development or to install the latest development version:

# Clone the repository
git clone https://github.com/OrionFinanceAI/orion-finance-sdk.git
cd orion-finance-sdk

# Using uv (recommended)
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate
uv pip install -e .

Or using make:

make uv-download
make venv
source .venv/bin/activate
make install

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

  • CURATOR_ADDRESS: The address of the curator account.
  • VAULT_DEPLOYER_PRIVATE_KEY: The private key of the vault deployer account.
  • CURATOR_PRIVATE_KEY: The private key of the curator 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

Deploy a new Encrypted Orion vault

orion deploy-vault --vault-type encrypted --name "Quantitative Uncertainty Analysis of Network Topologies" --symbol "QUANT" --fee-type high_water_mark --performance-fee 0 --management-fee 2

Submit an order intent to a vault

# Use off-chain stack to generate an order intent
echo '{"0x5BA134aBc8BA11Cf7868F4Dfb02497A3f1544Eb5": 0.25, "0x490a81a1939762E6AA87C68C346A0be5E21B466c": 0.02, "0x8A359aAfbf0DF440B34bb97445d981C1944CD053": 0.015, "0xbD39EeAd46c3f28EB8309A74641ab9Ef947FFc83": 0.0255, "0x6b2741F97Ea3EA9C5bFeEa33575d1E73c4481010": 0.06, "0x58f7aaE7B2c017F74B7403C9e89537f43B13bE87": 0.40, "0x28345814d210f2FE11C8de03236f0Ba7b603D282": 0.22, "0x484fF4FB5Ca053b47e5e0490C363b5ea38bB2adF": 0.0095}' > order_intent.json

# Submit the order intent to the Orion vault
orion submit-order --order-intent-path order_intent.json

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

Uploaded Python 3

File details

Details for the file orion_finance_sdk-0.4.2.tar.gz.

File metadata

  • Download URL: orion_finance_sdk-0.4.2.tar.gz
  • Upload date:
  • Size: 1.7 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-0.4.2.tar.gz
Algorithm Hash digest
SHA256 958631c6b366c5bca84cbbb00255d229a78450b7650622c31427fed2f71a7fc9
MD5 7648b7a119b6b55c0183f1676704e4d5
BLAKE2b-256 51f69bd90326918ad3c88be937f04e69d5a26a43509496a56d096a0e6936e873

See more details on using hashes here.

File details

Details for the file orion_finance_sdk-0.4.2-py3-none-any.whl.

File metadata

File hashes

Hashes for orion_finance_sdk-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d4cf40180860c371ce2bcd29dbf40154949df25b2980fc0b0e197ebf472a9043
MD5 2d281e0289a53340575633da2cd140f9
BLAKE2b-256 d72c83710ea0ed969bfcb21c32df7ab8bb8f030ae5378b586a76c1fe6455cd48

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