Skip to main content

Pythonized Uniswap V3

Project description

Pythonized Uniswap V3

This repository contains a pythonized version of the popular Uniswap V3 AMM.

The goal of this model is not to optimize the original design but rather to mirror the code and allow for easy debugging and further development. Therefore, only a few abstractions have been made for a more comprehensible and simplified model - e.g. using Python dictionary features instead of the BitMap library in Solidity. Moreover, some features that are not essential to the market making logic have been removed - most noticeably the flash and oracle functionality.

This implementation achieves a very high-accuracy model of the original Solidity code and it also includes the full testset.

Dependencies

Setup

First, ensure you have Poetry installed.

git clone git@github.com:chainflip-io/python-uniswap-v3.git
cd python-uniswap-v3
poetry shell
poetry install

Running Tests

Pytest is used to run the tests.

pytest
pytest <testfile-name>::<test-name>

Package Installation

To be able to easily use this code outside the repository itself, it has been included in a Python package that can be easily installed via any Python package manager.

Via Pip:

pip install -i https://pypi.org/simple/ uniswapV3Python

Via Poetry:

poetry add uniswapV3Python

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

uniswapV3Python-1.0.0.tar.gz (49.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uniswapV3Python-1.0.0-py3-none-any.whl (57.2 kB view details)

Uploaded Python 3

File details

Details for the file uniswapV3Python-1.0.0.tar.gz.

File metadata

  • Download URL: uniswapV3Python-1.0.0.tar.gz
  • Upload date:
  • Size: 49.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for uniswapV3Python-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d365d3e4038c37fdda0805dea6eaa7d29d35300237aef517edfb20e4e40c0ee9
MD5 85aa7e520a3166816fda953f948d32fa
BLAKE2b-256 32fea79c2fcbb2bc9e7cadf89bae83aa85c5cd10f17be904579136cb6903a5bc

See more details on using hashes here.

File details

Details for the file uniswapV3Python-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for uniswapV3Python-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 69dfca1fc7e81216aa113654de01c05cbb6a4fb8beb236ce3eaa392e728c35c2
MD5 26387ad8fa25839b4dceff13ce308f63
BLAKE2b-256 f1f70c6bc8c8d7c856e66ae02cdfb3df380fff3c328c8bec0721a3c79285d328

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page