algofi_amm
algofi-amm-py-sdk
Official Python SDK for the Algofi DEX
Documentation
https://algofi-amm-py-sdk.readthedocs.io/en/latest/index.html
Design Goal
This SDK is useful for developers who want to programatically interact with the Algofi DEX.
Status
This SDK is currently under active early development and should not be considered stable.
Installation
algofi-amm-py-sdk is not yet released on PYPI. It can be installed directly from this repository with pip:
pip install git+https://github.com/Algofiorg/algofi-amm-py-sdk
To run examples:
create an examples/.env file mnemonic=[25 char mnemonic]
Fund the account for mnemonic with test ALGO + test ASAs
Run examples (e.g. python3 add_liquidity.py). Be sure to set the correct asset ids and amounts.
Examples
Add liquidity (add_liquidity)
This example shows how to add liquidity to an existing pool
Burn LP token (burn)
This example shows how to burn LP tokens into their underlying assets
Create pool (create_pool)
This example shows how to create a new pool
Flash loan (flash_loan)
This example shows how to perform a flash loan from an Algofi DEX pool
Swap exact for (swap_exact_for)
This example shows how to swap an exact amount of an asset A into another asset B within a given pool (A, B)
Swap for exact (swap_for_exact)
This example shows how to swap an amount of asset A for an exact amount of asset B within a given pool (A, B)
License
algofi-amm-py-sdk is licensed under a MIT license except for the exceptions listed below. See the LICENSE file for details.