Skip to main content

Goat plugin for uniswap

Project description

Uniswap Plugin for GOAT SDK

A plugin for the GOAT SDK that provides Uniswap DEX functionality for token swaps and liquidity operations.

Installation

# Install the plugin
poetry add goat-sdk-plugin-uniswap

# Install required dependencies
poetry add goat-sdk-wallet-evm
poetry add goat-sdk-plugin-erc20

Usage

from goat_plugins.uniswap import uniswap, UniswapPluginOptions

# Initialize the plugin
options = UniswapPluginOptions(
    api_key="${UNISWAP_API_KEY}",  # Optional: API key for higher rate limits
    rpc_url="${RPC_PROVIDER_URL}"   # Your EVM RPC provider URL
)
plugin = uniswap(options)

# Get token price
price = await plugin.get_token_price(
    token_address="0x6B175474E89094C44Da98b954EedeAC495271d0F",  # DAI
    chain_id=1  # Ethereum mainnet
)

# Get swap quote
quote = await plugin.get_swap_quote(
    chain_id=1,
    token_in="0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",   # WETH
    token_out="0x6B175474E89094C44Da98b954EedeAC495271d0F",  # DAI
    amount="1000000000000000000",  # 1 WETH in wei
    slippage=50  # 0.5% slippage tolerance
)

Features

  • Token price discovery
  • Swap quote generation
  • Token swap execution
  • Liquidity pool information
  • Position management
  • Supported chains:
    • Ethereum
    • Polygon
    • Arbitrum
    • Optimism
    • Base
    • All Uniswap v3 supported networks

License

This project is licensed under the terms of the MIT license.

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

goat_sdk_plugin_uniswap-0.1.1.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

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

goat_sdk_plugin_uniswap-0.1.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file goat_sdk_plugin_uniswap-0.1.1.tar.gz.

File metadata

  • Download URL: goat_sdk_plugin_uniswap-0.1.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.12.4-1-MANJARO

File hashes

Hashes for goat_sdk_plugin_uniswap-0.1.1.tar.gz
Algorithm Hash digest
SHA256 64a0a55e0b7c8ac5df41c47efafd88af1767db5e8dfcabe4312b005e5a7ba9c4
MD5 c0b6e7cfba0994f32c5cd7335a6834a6
BLAKE2b-256 fadb9b25f0121b56294a7fd27a48b7613bff9acf78015c66cb9950909abc02c6

See more details on using hashes here.

File details

Details for the file goat_sdk_plugin_uniswap-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for goat_sdk_plugin_uniswap-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 169a38a429b463010a28dfd4ead1cf4f72f3df386395f80547b16c8e045e3e58
MD5 9ed434859fa02df063e169e574fcc96b
BLAKE2b-256 3c8b790b93a687290244151822ec023e0d23db5aa02422661d50f1bee6f298b6

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