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.
Uniswap 交易者 MCP
一个用于 AI 代理的 MCP 服务器,用于跨多个区块链自动执行 Uniswap DEX 上的代币交换。
特征
- 价格报价:通过多跳路由优化获取代币交换的实时价格报价。
- 掉期执行:在 Uniswap V3 上执行掉期,具有可配置的滑点容忍度和期限。
- 掉期建议:根据流动性、费用和最佳路径生成交易建议。
- 多链支持:兼容以太坊、Optimism、Polygon、Arbitrum、Celo、BNB Chain、Avalanche 和 Base。
先决条件
- Node.js :版本 14.x 或更高版本。
- npm :用于包管理。
- 钱包:一个有资金的钱包,带有用于执行交换的私钥。
- RPC 端点:访问受支持链的区块链 RPC URL(例如 Infura、Alchemy)。
安装
- 克隆存储库:Copy
- 安装依赖项:Copy
配置
用法
支持的链
支持以下区块链。请确保在chainConfigs.js
中配置每个链的有效 RPC URL、WETH 地址和 SwapRouter 地址。
链ID | 姓名 | 笔记 |
---|---|---|
1 | 以太坊 | 主网,广泛用于 Uniswap 交易 |
10 | 乐观 | 第 2 层,需要 Optimism RPC |
137 | 多边形 | 快速且低成本,使用 MATIC 作为原生 |
42161 | 仲裁 | 第 2 层,Arbitrum One 网络 |
42220 | 塞洛 | 移动优先区块链,使用 CELO |
56 | BNB链 | 币安智能链,使用BNB |
43114 | 雪崩 | 高通量,使用 AVAX |
8453 | 根据 | Coinbase 的 Layer 2,基于 Optimism |
工具和提示
1. getPrice
获取 Uniswap 交换的报价。
架构:
chainId
:数字(默认值:1)tokenIn
:字符串(例如"NATIVE"
或代币地址)tokenOut
:字符串(例如"NATIVE"
或代币地址)amountIn
:字符串(可选,"exactIn"
必需)amountOut
:字符串(可选,"exactOut"
必需)tradeType
:"exactIn"
或"exactOut"
(默认值:"exactIn"
)
示例提示:
输出:
2. executeSwap
在 Uniswap 上执行交换。
架构:
chainId
:数字(默认值:1)tokenIn
:字符串tokenOut
:字符串amountIn
:字符串(可选,"exactIn"
必需)amountOut
:字符串(可选,"exactOut"
必需)tradeType
:"exactIn"
或"exactOut"
(默认值:"exactIn"
)slippageTolerance
:数字(默认值:0.5,百分比)deadline
:数字(默认值:20,以分钟为单位)
示例提示:
输出:
执照
MIT 许可证。详情请参阅许可证。
This server cannot be installed
一个用于 AI 代理的 MCP 服务器,用于跨多个区块链自动执行 Uniswap DEX 上的代币交换。