ipor-fusion


Nameipor-fusion JSON
Version 0.5.0 PyPI version JSON
download
home_pagehttps://ipor.io
SummaryThe IPOR Fusion SDK for Python
upload_time2024-12-10 14:08:36
maintainerNone
docs_urlNone
authorAdam Mydlarz
requires_python<4.0,>=3.10
licenseBSD-3
keywords ethereum solidity testing development framework
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
    <img height="80px" width="80px" src="https://ipor.io/images/ipor-fusion.svg" alt="IPOR Fusion Python SDK"/>
    <h1 align="center">IPOR Fusion Python SDK</h1>
</p>

`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 <a href="https://ipor.io">IPOR Labs AG</a>.

<table>
  <tr>
    <td><strong>Workflow</strong></td>
    <td>
        <a href="https://github.com/IPOR-Labs/ipor-fusion.py/actions/workflows/ci.yml">
            <img src="https://github.com/IPOR-Labs/ipor-fusion.py/actions/workflows/ci.yml/badge.svg" alt="CI">
        </a>
        <a href="https://github.com/IPOR-Labs/ipor-fusion.py/actions/workflows/cd.yml">
            <img src="https://github.com/IPOR-Labs/ipor-fusion.py/actions/workflows/cd.yml/badge.svg" alt="CD">
        </a>
        <a href="https://github.com/IPOR-Labs/ipor-fusion.py/actions/workflows/release.yml">
            <img src="https://github.com/IPOR-Labs/ipor-fusion.py/actions/workflows/release.yml/badge.svg" 
alt="Release">
        </a>
    </td>
  </tr>
  <tr>
    <td><strong>Social</strong></td>
    <td>
        <a href="https://discord.com/invite/bSKzq6UMJ3">
            <img alt="Chat on Discord" src="https://img.shields.io/discord/832532271734587423?logo=discord&logoColor=white">
        </a>
        <a href="https://x.com/ipor_io">
            <img alt="X (formerly Twitter) URL" src="https://img.shields.io/twitter/url?url=https%3A%2F%2Fx.com%2Fipor_io&style=flat&logo=x&label=%40ipor_io&color=green">
        </a>
        <a href="https://t.me/IPOR_official_broadcast">
            <img alt="IPOR Official Broadcast" src="https://img.shields.io/badge/-t?logo=telegram&logoColor=white&logoSize=%3D&label=ipor">
        </a>
    </td>
  </tr>
  <tr>
    <td><strong>Code</strong></td>
    <td>
        <a href="https://pypi.org/project/ipor-fusion/">
            <img alt="PyPI version" src="https://img.shields.io/pypi/v/ipor-fusion?color=blue">
        </a>
        <a href="https://github.com/IPOR-Labs/ipor-fusion.py/blob/main/LICENSE">
            <img alt="GitHub License" src="https://img.shields.io/github/license/IPOR-Labs/ipor-fusion?color=blue">
        </a>
        <a href="https://pypi.org/project/ipor-fusion/">
            <img alt="Python Version" src="https://img.shields.io/pypi/pyversions/ipor-fusion">
        </a>
        <a href="https://github.com/IPOR-Labs/ipor-fusion.py/blob/main/pyproject.toml">
            <img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg">
        </a>
    </td>
  </tr>
</table>

#### Install dependencies

```bash
poetry install
```

#### Setup ARBITRUM_PROVIDER_URL environment variable

Some node providers are not supported. It's working with QuickNode but not with Alchemy.

```bash
export ARBITRUM_PROVIDER_URL="https://..."
```

#### Run tests

```bash
poetry run pytest -v -s
```

#### Run pylint

```bash 
poetry run pylint --rcfile=pylintrc.toml --verbose --recursive=y .
```

#### Run black

```bash 
poetry run black ./
```

## Example of usage

```python
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])


```


            

Raw data

            {
    "_id": null,
    "home_page": "https://ipor.io",
    "name": "ipor-fusion",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "ethereum, solidity, testing, development, framework",
    "author": "Adam Mydlarz",
    "author_email": "amydlarz@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/7d/42/8974c49438a9b14dfa59f59342fe439a46c6b4e0de3cea137a72e8ed895d/ipor_fusion-0.5.0.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n    <img height=\"80px\" width=\"80px\" src=\"https://ipor.io/images/ipor-fusion.svg\" alt=\"IPOR Fusion Python SDK\"/>\n    <h1 align=\"center\">IPOR Fusion Python SDK</h1>\n</p>\n\n`ipor_fusion` package is the official IPOR Fusion Software Development Kit (SDK) for Python. It allows Python \ndevelopers to \nwrite software, that interacts with **IPOR Fusion Plasma Vaults** smart contracts deployed on Ethereum Virtual \nMachine (EVM) blockchains.\n\n`ipor-fusion.py` repository is maintained by <a href=\"https://ipor.io\">IPOR Labs AG</a>.\n\n<table>\n  <tr>\n    <td><strong>Workflow</strong></td>\n    <td>\n        <a href=\"https://github.com/IPOR-Labs/ipor-fusion.py/actions/workflows/ci.yml\">\n            <img src=\"https://github.com/IPOR-Labs/ipor-fusion.py/actions/workflows/ci.yml/badge.svg\" alt=\"CI\">\n        </a>\n        <a href=\"https://github.com/IPOR-Labs/ipor-fusion.py/actions/workflows/cd.yml\">\n            <img src=\"https://github.com/IPOR-Labs/ipor-fusion.py/actions/workflows/cd.yml/badge.svg\" alt=\"CD\">\n        </a>\n        <a href=\"https://github.com/IPOR-Labs/ipor-fusion.py/actions/workflows/release.yml\">\n            <img src=\"https://github.com/IPOR-Labs/ipor-fusion.py/actions/workflows/release.yml/badge.svg\" \nalt=\"Release\">\n        </a>\n    </td>\n  </tr>\n  <tr>\n    <td><strong>Social</strong></td>\n    <td>\n        <a href=\"https://discord.com/invite/bSKzq6UMJ3\">\n            <img alt=\"Chat on Discord\" src=\"https://img.shields.io/discord/832532271734587423?logo=discord&logoColor=white\">\n        </a>\n        <a href=\"https://x.com/ipor_io\">\n            <img alt=\"X (formerly Twitter) URL\" src=\"https://img.shields.io/twitter/url?url=https%3A%2F%2Fx.com%2Fipor_io&style=flat&logo=x&label=%40ipor_io&color=green\">\n        </a>\n        <a href=\"https://t.me/IPOR_official_broadcast\">\n            <img alt=\"IPOR Official Broadcast\" src=\"https://img.shields.io/badge/-t?logo=telegram&logoColor=white&logoSize=%3D&label=ipor\">\n        </a>\n    </td>\n  </tr>\n  <tr>\n    <td><strong>Code</strong></td>\n    <td>\n        <a href=\"https://pypi.org/project/ipor-fusion/\">\n            <img alt=\"PyPI version\" src=\"https://img.shields.io/pypi/v/ipor-fusion?color=blue\">\n        </a>\n        <a href=\"https://github.com/IPOR-Labs/ipor-fusion.py/blob/main/LICENSE\">\n            <img alt=\"GitHub License\" src=\"https://img.shields.io/github/license/IPOR-Labs/ipor-fusion?color=blue\">\n        </a>\n        <a href=\"https://pypi.org/project/ipor-fusion/\">\n            <img alt=\"Python Version\" src=\"https://img.shields.io/pypi/pyversions/ipor-fusion\">\n        </a>\n        <a href=\"https://github.com/IPOR-Labs/ipor-fusion.py/blob/main/pyproject.toml\">\n            <img alt=\"Code style: black\" src=\"https://img.shields.io/badge/code%20style-black-000000.svg\">\n        </a>\n    </td>\n  </tr>\n</table>\n\n#### Install dependencies\n\n```bash\npoetry install\n```\n\n#### Setup ARBITRUM_PROVIDER_URL environment variable\n\nSome node providers are not supported. It's working with QuickNode but not with Alchemy.\n\n```bash\nexport ARBITRUM_PROVIDER_URL=\"https://...\"\n```\n\n#### Run tests\n\n```bash\npoetry run pytest -v -s\n```\n\n#### Run pylint\n\n```bash \npoetry run pylint --rcfile=pylintrc.toml --verbose --recursive=y .\n```\n\n#### Run black\n\n```bash \npoetry run black ./\n```\n\n## Example of usage\n\n```python\nimport time\n\nfrom ipor_fusion.PlasmaVaultSystemFactory import PlasmaVaultSystemFactory\n\n# Variables\nPROVIDER_URL = \"https://arb-mainnet.g.alchemy.com/v2/XXXXXXXXXXXXXXXXXXXXXXXX\"\nPRIVATE_KEY = \"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80\"\nPLASMA_VAULT = \"0x3F97CEa640B8B93472143f87a96d5A86f1F5167F\"\n\n# Setup PlasmaVault System\nsystem = PlasmaVaultSystemFactory(\n    PROVIDER_URL,\n    PRIVATE_KEY,\n).get(PLASMA_VAULT)\n\n# Get swap fuse action\nswap = system.uniswap_v3().swap(\n    token_in_address=system.usdc().address(),\n    token_out_address=system.usdt().address(),\n    fee=100,\n    token_in_amount=int(500e6),\n    min_out_amount=0,\n)\n\n# Get new position fuse action\nnew_position = system.ramses_v2().new_position(\n    token0=system.usdc().address(),\n    token1=system.usdt().address(),\n    fee=50,\n    tick_lower=-100,\n    tick_upper=100,\n    amount0_desired=int(499e6),\n    amount1_desired=int(499e6),\n    amount0_min=0,\n    amount1_min=0,\n    deadline=int(time.time()) + 100,\n    ve_ram_token_id=0,\n)\n\n# Execute fuse actions on PlasmaVault in batch\ntx_result = system.plasma_vault().execute([swap, new_position])\n\n\n```\n\n",
    "bugtrack_url": null,
    "license": "BSD-3",
    "summary": "The IPOR Fusion SDK for Python",
    "version": "0.5.0",
    "project_urls": {
        "Documentation": "https://docs.ipor.io/ipor-fusion/fusion-introduction",
        "Homepage": "https://ipor.io",
        "Repository": "https://github.com/IPOR-Labs/ipor-fusion.py"
    },
    "split_keywords": [
        "ethereum",
        " solidity",
        " testing",
        " development",
        " framework"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "13b04522fe992ee692f30eae63d04cc3ae6261c3494e9f346ec3b50e3583d545",
                "md5": "e12724b7866f05e53b1bd06722c4fa8c",
                "sha256": "593e9d9fd1b09a655faa98ab14f0d7d2749ace979389a0e56578d98e68514fd0"
            },
            "downloads": -1,
            "filename": "ipor_fusion-0.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e12724b7866f05e53b1bd06722c4fa8c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 40469,
            "upload_time": "2024-12-10T14:08:35",
            "upload_time_iso_8601": "2024-12-10T14:08:35.196992Z",
            "url": "https://files.pythonhosted.org/packages/13/b0/4522fe992ee692f30eae63d04cc3ae6261c3494e9f346ec3b50e3583d545/ipor_fusion-0.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7d428974c49438a9b14dfa59f59342fe439a46c6b4e0de3cea137a72e8ed895d",
                "md5": "dc7822f035be83537909db41711c35c3",
                "sha256": "7e269cea7440cfd2ea4ded1db6121f80f1b83a0225320152ca611aaea1ac8057"
            },
            "downloads": -1,
            "filename": "ipor_fusion-0.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "dc7822f035be83537909db41711c35c3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 23081,
            "upload_time": "2024-12-10T14:08:36",
            "upload_time_iso_8601": "2024-12-10T14:08:36.323346Z",
            "url": "https://files.pythonhosted.org/packages/7d/42/8974c49438a9b14dfa59f59342fe439a46c6b4e0de3cea137a72e8ed895d/ipor_fusion-0.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-10 14:08:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "IPOR-Labs",
    "github_project": "ipor-fusion.py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ipor-fusion"
}
        
Elapsed time: 0.41711s