Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

uniswap-sdk

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uniswap-sdk

uniswap-sdk: SDK for Uniswap smart contracts

  • 0.1.0b3
  • PyPI
  • Socket score

Maintainers
1

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

# Uses v2's TWAP oracle pricing algorithm
price = uni_v2.price(base=tokens["USDC"], quote=tokens["YFI"])
print(f"Buying 100k USDC worth of YFI at {price} USDC/YFI")

# Will automatically discover best possible route for given trade on Uniswap v2
# NOTE: Slippage and timeout are configurable
uni_v2.swap(base=tokens["USDC"], quote=tokens["YFI"], amount_in="100_000 USDC", sender=trader)
# Eventual goal?
import uniswap_sdk as uni

# Finds most liquid price across v2 and v3
price = uni.price(base=tokens["USDC"], quote=tokens["YFI"])

# Performs best swap between v2 and v3
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.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc