The IPOR Fusion SDK for Python
Project description
IPOR Fusion Python SDK
ipor_fusion
package is the official IPOR Fusion Software Development Kit (SDK) for Python. It allows Python
developers to
write software, that interacts with IPOR Fusion Plasma Vaults smart contracts deployed on Ethereum Virtual
Machine (EVM) blockchains.
ipor-fusion.py
repository is maintained by IPOR Labs AG.
Workflow | |
Social | |
Code |
Install dependencies
poetry install
Setup ARBITRUM_PROVIDER_URL environment variable
Some node providers are not supported. It's working with QuickNode but not with Alchemy.
export ARBITRUM_PROVIDER_URL="https://..."
Run tests
poetry run pytest -v -s
Run pylint
poetry run pylint --rcfile=pylintrc.toml --verbose --recursive=y .
Run black
poetry run black ./
Example of usage
import time
from ipor_fusion.PlasmaVaultSystemFactory import PlasmaVaultSystemFactory
# Variables
PROVIDER_URL = "https://arb-mainnet.g.alchemy.com/v2/XXXXXXXXXXXXXXXXXXXXXXXX"
PRIVATE_KEY = "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
PLASMA_VAULT = "0x3F97CEa640B8B93472143f87a96d5A86f1F5167F"
# Setup PlasmaVault System
system = PlasmaVaultSystemFactory(
PROVIDER_URL,
PRIVATE_KEY,
).get(PLASMA_VAULT)
# Get swap fuse action
swap = system.uniswap_v3().swap(
token_in_address=system.usdc().address(),
token_out_address=system.usdt().address(),
fee=100,
token_in_amount=int(500e6),
min_out_amount=0,
)
# Get new position fuse action
new_position = system.ramses_v2().new_position(
token0=system.usdc().address(),
token1=system.usdt().address(),
fee=50,
tick_lower=-100,
tick_upper=100,
amount0_desired=int(499e6),
amount1_desired=int(499e6),
amount0_min=0,
amount1_min=0,
deadline=int(time.time()) + 100,
ve_ram_token_id=0,
)
# Execute fuse actions on PlasmaVault in batch
tx_result = system.plasma_vault().execute([swap, new_position])
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
ipor_fusion-0.3.0.tar.gz
(22.6 kB
view details)
Built Distribution
File details
Details for the file ipor_fusion-0.3.0.tar.gz
.
File metadata
- Download URL: ipor_fusion-0.3.0.tar.gz
- Upload date:
- Size: 22.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 574c0a00969da6a912ab6696f4a0e18787e608d8d6f400fa7677783bae0205d9 |
|
MD5 | a6ebd6d655eda7a5a9c9597b92d5997f |
|
BLAKE2b-256 | 9c76818b199e21d15992da40b25dad6e153a3b9f57f1f24c81d66de70f7b84fa |
File details
Details for the file ipor_fusion-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: ipor_fusion-0.3.0-py3-none-any.whl
- Upload date:
- Size: 40.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ecb74813a707b4a21f650f022759b4e86cf2b1b407ae52beecfa488b4773cfc |
|
MD5 | 5f25b725d605b418a09e349d12fb4395 |
|
BLAKE2b-256 | 1f986f5e45b97df500ef2d85f9450cb47c245b911bcec4b7ff05fcb9199f1d1d |