PactFi
БесплатноНе проверенEnables interaction with the PactFi AMM DEX on Algorand, including pool discovery, quote computation, and building swap/liquidity transactions. Integrates with
Описание
Enables interaction with the PactFi AMM DEX on Algorand, including pool discovery, quote computation, and building swap/liquidity transactions. Integrates with UluOS wallet and broadcast servers for signing and submission.
README
MCP (Model Context Protocol) server for the PactFi AMM DEX on Algorand. Part of the UluOS agent ecosystem.
Architecture
┌──────────────┐ ┌──────────────┐ ┌──────────────────┐
│ PactFi MCP │────▶│ UluWalletMCP │────▶│ UluBroadcastMCP │
│ (this repo) │ │ (signing) │ │ (submit to net) │
└──────┬───────┘ └──────────────┘ └──────────────────┘
│
├── PactFi REST API (api.pact.fi) ── pool discovery & metadata
└── Algorand algod (algonode.cloud) ── on-chain state & tx params
No PactFi SDK dependency — pools are queried via the PactFi REST API, quotes are computed locally using constant-product AMM math, and transactions are built directly with algosdk.
Tools
| Tool | Description |
|---|---|
get_pools |
List PactFi pools with optional filters (symbol, verified, pool type) |
get_pool |
Get detailed pool info by app ID (on-chain reserves + API metadata) |
get_quote |
Compute swap quote with expected output, fee, price impact, and slippage |
swap_txn |
Build unsigned swap transaction group |
add_liquidity_txn |
Build unsigned add-liquidity transaction group |
remove_liquidity_txn |
Build unsigned remove-liquidity transaction group |
Tool Details
get_pools
List PactFi liquidity pools. Supports filtering by token symbol, verification status, pool type (CONST or STABLE), and result limit.
get_pool
Fetch on-chain pool state (reserves A/B, LP supply, fee configuration) merged with API metadata (token names, prices, TVL, APR).
get_quote
Simulate a swap without building transactions. Provide fromToken/toToken symbols and an amount. Optionally specify poolAppId to target a specific pool, or let it auto-discover the highest-TVL pool for the pair.
swap_txn
Build a 2-transaction atomic group:
- Deposit (payment or asset transfer) to pool escrow
- Application call with
SWAP+ minimum received
add_liquidity_txn
Build a 3-transaction atomic group:
- Deposit primary asset to pool escrow
- Deposit secondary asset to pool escrow
- Application call with
ADDLIQ+ minimum LP tokens
remove_liquidity_txn
Build a 2-transaction atomic group:
- Deposit LP tokens to pool escrow
- Application call with
REMLIQ+ minimum primary + minimum secondary
Agent Flow Example
Agent: get_quote(fromToken="ALGO", toToken="USDC", amount="100")
→ { expectedOutput: "8.52", minimumReceived: "8.47", poolAppId: 1073557308, ... }
Agent: swap_txn(fromToken="ALGO", toToken="USDC", amount="100", sender="ABC...")
→ { transactions: ["base64...", "base64..."], details: { ... } }
Agent: UluWalletMCP.sign_transactions(signerId="my-signer", transactions=["base64..."])
→ { signedTransactions: ["base64..."] }
Agent: UluBroadcastMCP.broadcast_transactions(network="algorand-mainnet", txns=["base64..."])
→ { txIds: ["TXID..."] }
Setup
npm install
Usage
node index.js
Adding to a Client
{
"mcpServers": {
"pactfi-mcp": {
"command": "node",
"args": ["/absolute/path/to/pactfi-mcp/index.js"]
}
}
}
Data Sources
- PactFi REST API (
api.pact.fi): pool listing, token metadata, TVL, volume, APR - Algorand algod (
mainnet-api.algonode.cloud): on-chain pool state, transaction parameters
Supported Pool Types
- Constant Product (
CONST): Standard x·y=k AMM pools — fully supported for quotes and transactions - NFT Constant Product: Same AMM math as constant product — fully supported
- Stableswap (
STABLE): Curve-style stable pools —get_quotereturns an approximate result (with warning);swap_txnrejects stableswap pools since the constant-product math cannot produce correct minimum-received values for on-chain execution
Known Limitations
- Stableswap transactions: Building swap/liquidity transactions for stableswap pools is not supported. The on-chain contract uses the StableSwap (Curve) invariant which requires different math than constant-product.
get_quoteprovides an approximation with a warning. - Pool discovery: The PactFi API is used for token metadata (symbols, decimals, prices). For specific pools, use the
appIdparameter directly.
License
MIT
Установка PactFi
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/NautilusOSS/PactFiMCPFAQ
PactFi MCP бесплатный?
Да, PactFi MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для PactFi?
Нет, PactFi работает без API-ключей и переменных окружения.
PactFi — hosted или self-hosted?
Доступен hosted-вариант: Unyly запускает сервер в облаке, локальная установка не обязательна.
Как установить PactFi в Claude Desktop, Claude Code или Cursor?
Открой PactFi на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectCompare PactFi with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
