uniswap-trader-mcp

by kukapay
Verified

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Enables token swaps on Uniswap DEX on the BNB Chain (Binance Smart Chain), supporting BNB as the native token.

  • Enables token swaps on Uniswap DEX on the Ethereum mainnet, with price quotes, swap execution, and trading suggestions.

  • Supports token swaps on Uniswap DEX on the Optimism Layer 2 network, with real-time price quotes and optimized routing.

ユニスワップトレーダーMCP

複数のブロックチェーンにわたる Uniswap DEX でのトークン交換を自動化する AI エージェント用の MCP サーバー。

特徴

  • 価格見積もり: マルチホップ ルート最適化によるトークン スワップのリアルタイムの価格見積もりを取得します。
  • スワップ実行: 設定可能なスリッページ許容値と期限を使用して、Uniswap V3 でスワップを実行します。
  • スワップ提案: 流動性、手数料、最適なパスに基づいて取引の提案を生成します。
  • マルチチェーンサポート: Ethereum、Optimism、Polygon、Arbitrum、Celo、BNB Chain、Avalanche、Base と互換性があります。

前提条件

  • Node.js : バージョン 14.x 以上。
  • npm : パッケージ管理用。
  • ウォレット: スワップを実行するための秘密鍵を備えた資金のあるウォレット。
  • RPC エンドポイント: サポートされているチェーンのブロックチェーン RPC URL (Infura、Alchemy など) へのアクセス。

インストール

  1. リポジトリのクローンを作成します:
    git clone https://github.com/kukapay/uniswap-trader-mcp.git cd uniswap-trader-mcp
  2. 依存関係をインストール:
    npm install

構成

{ "mcpServers": { "Uniswap-Trader-MCP": { "command": "node", "args": ["path/to/uniswap-trader-mcp/server/index.js"], "env": { "INFURA_KEY": "your infura key", "WALLET_PRIVATE_KEY": "your private key" } } } }

使用法

サポートされているチェーン

以下のchainConfigs.jsチェーンがサポートされています。chainConfigs.js で各チェーンが有効な RPC URL、WETH アドレス、SwapRouter アドレスで設定されていることを確認してください。

チェーンID名前注記
1イーサリアムUniswap取引で広く使用されているメインネット
10楽観レイヤー2、Optimism RPCが必要
137ポリゴン高速かつ低コスト、MATICをネイティブに使用
42161仲裁レイヤー2、アービトラムワンネットワーク
42220セロモバイルファーストブロックチェーン、CELOを使用
56BNBチェーンBinance Smart ChainはBNBを使用しています
43114雪崩高スループット、AVAXを使用
8453ベースコインベースのレイヤー2はオプティミズムに基づいて構築されています

ツールとプロンプト

1. getPrice

Uniswap スワップの価格見積を取得します。

スキーマ:

  • chainId : 数値(デフォルト: 1)
  • tokenIn : 文字列(例: "NATIVE"またはトークンアドレス)
  • tokenOut : 文字列(例: "NATIVE"またはトークンアドレス)
  • amountIn : 文字列(オプション、 "exactIn"の場合は必須)
  • amountOut : 文字列(オプション、 "exactOut"の場合は必須)
  • tradeType : "exactIn"または"exactOut" (デフォルト: "exactIn" )

プロンプトの例:

Get me a price quote for swapping 1 ETH to DAI on Ethereum.

出力:

{ "chainId": 1, "tradeType": "exactIn", "price": "3000.50", "inputAmount": "1.000000", "outputAmount": "3000.50", "minimumReceived": "2985.50", "maximumInput": "1.005000", "route": [ { "tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", "tokenOut": "0x6B175474E89094C44Da98b954EedeAC495271d0F", "fee": 3000 } ], "estimatedGas": "150000" }

2. executeSwap

Uniswap でスワップを実行します。

スキーマ:

  • chainId : 数値(デフォルト: 1)
  • tokenIn : 文字列
  • tokenOut : 文字列
  • amountIn : 文字列(オプション、 "exactIn"の場合は必須)
  • amountOut : 文字列(オプション、 "exactOut"の場合は必須)
  • tradeType : "exactIn"または"exactOut" (デフォルト: "exactIn" )
  • slippageTolerance : 数値(デフォルト: 0.5、パーセント)
  • deadline : 数値(デフォルト: 20、分単位)

プロンプトの例:

Swap 1 ETH for DAI on Ethereum with a 0.5% slippage tolerance and a 20-minute deadline.

出力:

{ "chainId": 1, "txHash": "0x1234...abcd", "tradeType": "exactIn", "amountIn": "1.000000", "outputAmount": "2990.75", "minimumReceived": "2985.50", "maximumInput": "1.005000", "fromToken": "NATIVE", "toToken": "0x6B175474E89094C44Da98b954EedeAC495271d0F", "route": [ { "tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", "tokenOut": "0x6B175474E89094C44Da98b954EedeAC495271d0F", "fee": 3000 } ], "gasUsed": "145000" }

ライセンス

MITライセンス。詳細はライセンスを参照してください。

-
security - not tested
A
license - permissive license
-
quality - not tested

複数のブロックチェーンにわたる Uniswap DEX でのトークン交換を自動化する AI エージェント用の MCP サーバー。

  1. Features
    1. Prerequisites
      1. Installation
        1. Configuration
          1. Usage
            1. Supported Chains
            2. Tools and Prompts
          2. License
            ID: wjbh1v7a2r