Uniswap SDK
NOTE: Work In Progress
Usage
NOTE: Sketch of potential usage
from ape_tokens import tokens
from uniswap_sdk import v2 as uni_v2
price = uni_v2.price(base=tokens["USDC"], quote=tokens["YFI"])
print(f"Buying 100k USDC worth of YFI at {price} USDC/YFI")
uni_v2.swap(base=tokens["USDC"], quote=tokens["YFI"], amount_in="100_000 USDC", sender=trader)
import uniswap_sdk as uni
price = uni.price(base=tokens["USDC"], quote=tokens["YFI"])
uni.swap(base=tokens["USDC"], quote=tokens["YFI"], amount_in="100_000 USDC", sender=trader)
Dependencies
- python3 version 3.7 or greater, python3-dev
Installation
via pip
You can install the latest release via pip
:
pip install uniswap_sdk
via setuptools
You can clone the repository and use setuptools
for the most up-to-date version:
git clone https://github.com/SilverBackLtd/uniswap-sdk.git
cd uniswap-sdk
python3 setup.py install
Quick Usage
TODO: Describe library overview in code
Development
This project is in development and should be considered a beta.
Things might not be in their final state and breaking changes may occur.
Comments, questions, criticisms and pull requests are welcomed.
License
This project is licensed under the Apache 2.0.