Skip to main content

IPOR Fusion Python SDK

IPOR Fusion Python SDK

ipor_fusion is the official Python SDK for IPOR Fusion Plasma Vaults — typed abstractions for DeFi protocol interactions on EVM chains through a fuse adapter pattern.

Maintained by IPOR Labs AG.

Workflow CI CD Release
Social Chat on Discord X (formerly Twitter) URL IPOR Official Broadcast
Code PyPI version GitHub License Python Version Linter: Ruff DeepWiki

Quickstart

Install

pip install ipor-fusion

Connect and execute

from ipor_fusion import Web3Context, PlasmaVault, AaveV3SupplyFuse
from web3 import Web3

# 1. Create a Web3 context with your provider and private key
ctx = Web3Context.from_url(
    url="https://arb-mainnet.g.alchemy.com/v2/YOUR_KEY",
    private_key="0x...",
)

# 2. Wrap the PlasmaVault contract
vault = PlasmaVault(ctx, Web3.to_checksum_address("0xVAULT_ADDRESS"))

# 3. Build a fuse action (e.g. supply USDC to Aave V3)
fuse = AaveV3SupplyFuse(Web3.to_checksum_address("0xFUSE_ADDRESS"))
action = fuse.supply(
    asset=Web3.to_checksum_address("0xUSDC_ADDRESS"),
    amount=1_000_000,  # 1 USDC (6 decimals)
)

# 4. Execute on-chain
receipt = vault.execute([action])

CLI Quickstart

The SDK ships with a fusion CLI for inspecting and managing Plasma Vaults from the terminal.

You need an RPC provider URL — get a free key at Alchemy or Infura.

# Install with CLI extras (pipx keeps dependencies isolated)
pipx install 'ipor-fusion[cli]'

# Configure an RPC provider (auto-detects chain ID)
fusion config set-provider https://arb-mainnet.g.alchemy.com/v2/YOUR_KEY

# Inspect a vault (auto-saves to config on first use)
fusion vault info 0xB8a451107A9f87FDe481D4D686247D6e43Ed715e --chain-id ethereum

# List saved vaults
fusion vault list

MCP Server

The SDK includes an MCP server that exposes CLI tools to any MCP-compatible AI assistant (Claude Code, Cursor, Windsurf, etc.).

# Install with MCP extras (pipx keeps dependencies isolated)
pipx install 'ipor-fusion[mcp]'

Add to your MCP client configuration (e.g. .mcp.json):

{
  "mcpServers": {
    "ipor-fusion": {
      "command": "fusion-mcp",
      "type": "stdio"
    }
  }
}

Available tools:

Tool Description
config_show Show current configuration (providers, vaults, API key status)
config_set_provider Set RPC provider URL for a chain (auto-detects chain ID)
config_set_etherscan_key Set Etherscan API key (enables contract name resolution)
vault_info Full on-chain vault state — assets, fuses, balances, fees, lending health, reconciliation
vault_list List all saved vaults
vault_add Save a vault to the local config (auto-fetches on-chain name)
vault_remove Remove a vault from the local config

Configure providers and vaults via fusion config or the MCP config tools first.

Architecture

The SDK uses a fuse adapter pattern:

  • Fuses encode protocol-specific calls into FuseAction objects (pure calldata, no state)
  • PlasmaVault batches and executes FuseAction sequences on-chain via execute()
  • Web3Context manages provider connections, signing, and transaction dispatch
Fuse.method()  -->  FuseAction  -->  PlasmaVault.execute([actions])  -->  on-chain tx

Core modules (ipor_fusion.core)

Module Purpose
Web3Context Provider connection, signing, tx dispatch
PlasmaVault ERC-4626 vault — execute, deposit, withdraw
AccessManager Role-based access control
RewardsManager Claim and vest rewards
WithdrawManager Time-windowed withdrawal requests
FeeManager Deposit, performance, and management fee configuration
FeeAccount Fee escrow account, resolves its FeeManager
PriceOracleMiddleware Asset price feeds
PriceOracleMiddlewareManager Per-vault price-source overrides

Supported protocols (ipor_fusion.fuses)

Protocol Fuses
Aave V3 AaveV3SupplyFuse, AaveV3BorrowFuse
Morpho MorphoSupplyFuse, MorphoCollateralFuse, MorphoBorrowFuse, MorphoFlashLoanFuse, MorphoClaimFuse
Uniswap V3 UniswapV3SwapFuse, UniswapV3NewPositionFuse, UniswapV3ModifyPositionFuse, UniswapV3CollectFuse
Ramses V2 RamsesV2NewPositionFuse, RamsesV2ModifyPositionFuse, RamsesV2CollectFuse, RamsesClaimFuse
Compound V3 CompoundV3SupplyFuse
Gearbox V3 GearboxSupplyFuse, GearboxStakeFuse
ERC-4626 ERC4626SupplyFuse
Fluid Instadapp FluidInstadappSupplyFuse, FluidInstadappStakingFuse
Universal UniversalTokenSwapperFuse

Supported networks

  • Ethereum mainnet
  • Arbitrum One
  • Base

Development

uv sync --all-extras                                       # Install dependencies
uv run pytest tests/test_fuse_encoding.py -n auto -v       # Unit tests (fast, offline)
uv run pytest -v -s                                        # All tests (needs `.*_PROVIDER_URL` variables in `.env`)
uv run ruff format ./                                      # Format
uv run ruff check ./                                       # Lint
uv run pyright                                             # Type check

Integration tests need provider URLs in .env (eth_simulateV1 at a pinned fork block — no local node):

cp .env.example .env
# Edit .env with ARBITRUM_PROVIDER_URL, ETHEREUM_PROVIDER_URL, BASE_PROVIDER_URL

Examples

For full usage patterns, see the example repository: ipor-fusion-alpha-example

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipor_fusion-3.6.5.tar.gz (502.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ipor_fusion-3.6.5-py3-none-any.whl (181.2 kB view details)

Uploaded Python 3

File details

Details for the file ipor_fusion-3.6.5.tar.gz.

File metadata

  • Download URL: ipor_fusion-3.6.5.tar.gz
  • Upload date:
  • Size: 502.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ipor_fusion-3.6.5.tar.gz
Algorithm Hash digest
SHA256 7e69b12f287111d45825aae35ca00cb3b49faaafe7115481de68f823fc270790
MD5 4f8723422b36584dc03828469df2d939
BLAKE2b-256 8ef3b61dd151534034f1dea7c52966ba84be208acacac05497847d0728f00038

See more details on using hashes here.

File details

Details for the file ipor_fusion-3.6.5-py3-none-any.whl.

File metadata

  • Download URL: ipor_fusion-3.6.5-py3-none-any.whl
  • Upload date:
  • Size: 181.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ipor_fusion-3.6.5-py3-none-any.whl
Algorithm Hash digest
SHA256 871a06a17bba65ee81fb30b13f106384b78b991cb6e71e657a1c1d69af16052c
MD5 ffa95e968ad4dae3f946310f539ae25a
BLAKE2b-256 5b1dd4d7ade598020ab972c2de3e260ca4b296c3fe863c493de7008da8f1c3e8

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

3.6.5 This release

2 files

3.6.4

2 files

3.6.3

2 files

3.6.2

2 files

3.6.1

2 files

3.6.0

2 files

3.5.0

2 files

3.4.0

2 files

3.3.1

2 files

3.3.0

2 files

3.2.0

2 files

3.1.0

2 files

3.0.3

2 files

3.0.2

2 files

3.0.1

2 files

2.2.0

2 files

2.1.1

2 files

2.1.0

2 files

2.0.0

2 files

0.23.0

2 files

0.22.0

2 files

0.21.0

2 files

0.20.0

2 files

0.19.0

2 files

0.18.0

2 files

0.17.0

2 files

0.16.0

2 files

0.15.0

2 files

0.14.0

2 files

0.13.0

2 files

0.12.0

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page