Package: uniswap-python
uniswap-pythonThe unofficial Python client forUniswap.Documentation is available athttps://uniswap-python.com/Want to help implement support for Uniswap v4?Seeissue #337FunctionalityA simple to use Python wrapper for all available contract functions and variablesA basic CLI to get prices and token metadataSimple parsing of data returned from the Uniswap contractSupportsUniswap v3 (as of v0.5.0)Including beta support for Arbitrum & Optimism deployments (as of v0.5.4)Uniswap v2 (as of v0.4.0)Uniswap v1 (deprecated)Various forks (untested, but should work)Honeyswap (xDai)Pancakeswap (BSC)Sushiswap (mainnet)Getting StartedSee ourGetting started guidein the documentation.TestingUnit tests are under development using the pytest framework. Contributions are welcome!Test are run on a fork of the main net using ganache-cli. You need to install it withnpm install -g ganache-clibefore running tests.To run the full test suite, in the project directory set thePROVIDERenv variable to a mainnet provider, and run:poetryinstallexportPROVIDER=# URL of provider, e.g. https://mainnet.infura.io/v3/...maketest# or...poetryrunpytest--capture=no# doesn't capture output (verbose)Support our continued work!You can support us onGitcoin Grants.AuthorsShane FontaineErik Bjäreholt@liquid-8...andothersWant to help out with development? We have funding to those that do! See#181Contributors also earn this beautifulGitPOAPfor their contributions!Changelog0.5.4added use of gas estimation instead of a fixed gas limit (to support Arbitrum)addeduse_estimate_gasconstructor argument (used in testing)added constants/basic support for Arbitrum, Optimism, Polygon, and Fantom. (untested)incomplete changelog0.5.3incomplete changelog0.5.2incomplete changelog0.5.1Updated dependenciesFixed minor typing issues0.5.0Basic support for Uniswap V3Added new methodsget_price_inputandget_price_outputMade a lot of previously public methods privateAdded documentation siteRemoved ENS support (which was probably broken to begin with)0.4.6Bug fix: Update bleach package from 3.1.4 to 3.3.00.4.5Bug fix: Use .eth instead of .ens0.4.4General: Add new logo for Uniswap V2Bug fix: Invalid balance check (#25)Bug fix: Fixed error when passing WETH as token0.4.3Allow kwargs inapproveddecorator.0.4.2Add note about Uniswap V2 support0.4.1Update changelog for PyPi and clean up0.4.0A huge thank youErik Bjäreholtfor adding Uniswap V2 support, as well as all changes in this version!Added support for Uniswap v2Handle arbitrary tokens (by address) using the factory contractSwitched from setup.py to pyproject.toml/poetrySwitched from Travis to GitHub ActionsFor CI to work in your repo, you need to set the secret MAINNET_PROVIDER. I use Infura.Running tests on a local fork of mainnet using ganache-cli (started as a fixture)Fixed tests for make_trade and make_trade_outputAdded type annotations to the entire codebase and check them with mypy in CIFormatted entire codebase with blackMoved stuff around such that the basic import becomes from uniswap import Uniswap (instead of from uniswap.uniswap import UniswapWrapper)Fixed misc bugs0.3.3Provide token inputs as addresses instead of names0.3.2Add ability to transfer tokens after a tradeAdd tests for this new functionality0.3.1Add tests for all types of trades0.3.0Add ability to make all types of tradesAdd example to README0.2.1Add liquidity tests0.2.0Add liquidity and ERC20 pool methods0.1.1Major README update0.1.0Add market endpointsAdd tests for market endpoints