Orion Finance SDK#

This guide shows how to install the Orion SDK locally. The source code is publicly available on GitHub.


Workflow Overview#

The typical workflow for using the Orion Finance SDK:

  1. Install SDK - Install the Orion Finance SDK package (see below);

  2. Deploy Vault - Create a new vault using orion deploy-vault;

  3. Set Strategist (if needed) - If you want to submit intents as a manager, set yourself as the strategist for your vault;

  4. Submit Intents - Submit portfolio allocation intents using orion submit-order.


Install#

The package CLI can be installed simply running:

curl -sSfL https://sdk.orionfinance.ai/cli/install.sh | sh

Check available CLI commands any time:

orion --help

Install from PyPI#

Alternatively, install the latest stable version from PyPI:

pip install "orion-finance-sdk-py>=1.3.1"

Configure Environment#

Create a .env file in your project directory with the following variables:

Required for Vault Deployment#

  • RPC_URL (optional) - Chain RPC endpoint. If not set, the SDK uses a default public RPC (e.g. 1rpc.io, 0xrpc.io, or publicnode). Set this only if you want to use your own endpoint.

  • MANAGER_PRIVATE_KEY - Manager private key for signing vault deployment transactions;

  • MANAGER_ADDRESS - Manager address for fees/ownership (must match the address derived from MANAGER_PRIVATE_KEY).

Quick Start#

Example usage of the Orion Finance SDK:

from orion_finance_sdk_py.contracts import OrionConfig

config = OrionConfig()
print(f"Risk-free Rate: {config.risk_free_rate}")

Required for Intent Submission#

  • ORION_VAULT_ADDRESS - Address of the deployed Orion vault to interact with (obtained after vault deployment);

Note: Keep your .env file private and never commit it to version control.

Vault Deployment#

Deploy a new vault using the Orion CLI.

Who Can Create Vaults?#

  • Managers can create vaults using the Orion CLI.

What is an RPC URL?#

An RPC URL is the endpoint the SDK uses to communicate with contracts on the blockchain network.

It’s provided by a node or node service provider (e.g., Alchemy) and allows the SDK to send transactions and query blockchain data. You do not have to set one — if RPC_URL is omitted, the SDK uses a default public RPC. Set it only if you want to use your own endpoint (e.g. for higher rate limits or a specific chain).

Getting an RPC URL (optional)#

If you want to use your own RPC endpoint, you can get one from multiple providers. Below are two popular options:

1. Alchemy#

  1. Go to Alchemy and create a free account.

  2. Click “Create App” in your dashboard.

  3. Select:

    • Chain - Ethereum;

    • Network - Sepolia Testnet.

  4. Once created, click your app and copy the HTTP URL — this is your RPC URL.

  5. Add it to your .env file (optional):

RPC_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY

2. Infura#

  1. Go to Infura and sign up.

  2. Create a new project in your dashboard.

  3. Select the Sepolia network.

  4. Copy the HTTPS endpoint and add it to your .env file (optional):

RPC_URL=https://sepolia.infura.io/v3/YOUR_API_KEY

Deploy a Transparent Vault#

orion deploy-vault \
  --name "Algorithmic Liquidity Provision & Hedging Agent" \
  --symbol "ALPHA" \
  --fee-type hard_hurdle \
  --performance-fee 100 \
  --management-fee 10 \
  --strategist-address 0x...

What this does:

  • Deploys an ERC-7540 vault smart contract;

  • Registers the manager address set in your .env;

  • Sets the fee type and fees amounts;

  • Makes allocations visible onchain.


Verify Deployment#

  • The CLI outputs the vault contract address;

  • Add it to your manager records and share it with users.

Submit Rebalancing Order Intents#

Submit portfolio allocation intents that the protocol executes on the next rebalancing cycle.

Prerequisites#

  • A deployed vault;

  • Portfolio file generated by your strategy.

Who Can Submit Intents?#

  • Strategists can submit portfolio intents for vaults they are assigned to.

  • Managers who have set themselves as the strategist for their vault can also submit intents directly.


Intent Submission#

Use --order-intent (alias --order-intent-path) with either a file or an inline intent:

  • JSON file: a single object mapping token addresses to weights (fractions that sum to 1).

  • CSV / Parquet: tabular format; see column names below. Parquet needs pyarrow (pip install 'orion-finance-sdk-py[parquet]').

  • Inline string: same object as JSON, or a Python dict literal, e.g. '{"0x...": 0.5, "0x...": 0.5}'.

orion submit-order --order-intent order_intent.json

orion submit-order --order-intent '{"0x...": 0.5, "0x...": 0.5}'

Notes#

  • Intents are collected and executed at the next rebalance, enabling bundling, batching, and netting.

  • Ensure portfolio inputs match the expected schema for your strategy/vault.

Expected Portfolio File Schema#

Column Name

Type

Description

address

string

Token contract address (checksummed).

percentage_of_tvl

decimal

Percentage of total vault value to allocate (0-100).

For CSV/Parquet you can also use token / addr for the address column, and weight, value, or percentage for weights. Weights in a percentage_of_tvl (or percentage) column are treated as 0–100 and normalized to fractions.

{
  "0x...": 0.25,
  "0x...": 0.02,
  "0x...": 0.015,
  "0x...": 0.0255,
  "0x...": 0.06,
  "0x...": 0.4,
  "0x...": 0.22,
  "0x...": 0.0095
}

Note:

  • For transparent vaults, these values will be visible onchain once submitted.

  • For private vaults, values are encrypted and only known to managers.

API Reference#