Skip to main content
Glama

DorkFiMCP

Protocol MCP server for the DorkFi lending protocol on Voi and Algorand.

Architecture

DorkFiMCP is a protocol-level MCP that sits above the infrastructure MCP layer:

UluCoreMCP / UluVoiMCP / UluAlgorandMCP / UluWalletMCP / UluBroadcastMCP
                                ↓
                           DorkFiMCP
                                ↓
                        DorkFi API (reads)
                        On-chain (writes)

Data sources:

  • DorkFi API (dorkfi-api.nautilus.sh) — Pre-indexed market data, user health factors, TVL, and position data. Used for all read operations.

  • On-chain (algod) — Used for transaction preparation (suggested params, ABI encoding).

DorkFiMCP handles:

  • Market discovery with live data from the DorkFi API

  • User position queries with pre-computed health factors

  • Liquidation candidate scanning (202+ indexed users on Voi)

  • TVL analytics across all chains and pools

  • Transaction preparation (unsigned)

DorkFiMCP does NOT:

  • Sign transactions (use UluWalletMCP)

  • Broadcast transactions (use UluBroadcastMCP)

  • Manage wallets

Related MCP server: AramidBridgeMCP

Tools

Markets

Tool

Description

get_markets

List lending markets with live rates, deposits, borrows, and prices

get_tvl

Get total value locked per market and aggregate totals

Positions

Tool

Description

get_position

Get a user's positions with per-pool health factors

get_health_factor

Check health factor and risk level per pool

Liquidations

Tool

Description

get_liquidation_candidates

Find undercollateralized accounts from pre-indexed health data

Transaction Preparation

Tool

Description

deposit_txn

Build unsigned transactions to deposit (supply) tokens

borrow_txn

Build unsigned transactions to borrow tokens

repay_txn

Build unsigned transactions to repay debt

withdraw_txn

Build unsigned transactions to withdraw supplied tokens

liquidate_txn

Build unsigned transactions to liquidate a position

Agent Workflow

Agent calls DorkFiMCP:  deposit_txn(chain, symbol, amount, sender)
       → returns { transactions: [base64, ...] }

Agent calls UluWalletMCP: wallet_sign_transactions(signerId, transactions)
       → returns signed transactions

Agent calls UluBroadcastMCP: broadcast_transactions(network, txns)
       → returns transaction IDs

Chain Support

All tools accept a chain parameter:

  • "voi" — Voi mainnet (pools: 47139778, 47139781)

  • "algorand" — Algorand mainnet (pools: 3333688282, 3345940978)

Project Structure

index.js              MCP server entry point (11 tools)
lib/
  api.js              DorkFi API client (dorkfi-api.nautilus.sh)
  client.js           Algod client factory, ABI definitions, simulation helpers
  markets.js          Market data from API with symbol resolution
  positions.js        User positions and health factors from API
  liquidation.js      Liquidation candidates from pre-indexed health data
  builders.js         Unsigned transaction group builders (on-chain)
data/
  contracts.json      Chain configs, pool IDs, and token definitions

Setup

npm install

Run

node index.js

Or configure as an MCP server in your agent:

{
  "mcpServers": {
    "dorkfi": {
      "command": "node",
      "args": ["/path/to/DorkFiMCP/index.js"]
    }
  }
}

DorkFi API

Read operations use the DorkFi API which provides pre-indexed data:

Endpoint

Used by

/market-data/{network}

get_markets

/user-health/user/{address}

get_position, get_health_factor

/user-health/{network}

get_liquidation_candidates

/analytics/tvl

get_tvl

Supported Markets

Voi (22 markets across 2 pools)

Pool 47139778: VOI, aUSDC, UNIT, POW, aALGO, aETH, aBTC, acbBTC, WAD (borrow-only)

Pool 47139781: WAD, GM, CORN, SHELLY, BUIDL, F, NODE, AMMO, IAT, bVOI, NV, EV, FV

Algorand (29 markets across 2 pools)

Pool 3333688282: ALGO, USDC, UNIT, POW, goBTC, aVOI, wBTC, goETH, wETH, LINK, SOL, AVAX, WAD (borrow-only)

Pool 3345940978: WAD, FINITE, FOLKS, COOP, HOG, USDt, xUSD, MONKO, HAY, BRO, ALPHA, COMPX, AKTA, PEPE, GOLD$, TINY

On-Chain ABI

Transaction preparation uses the verified ABI from DorkFiLendingPoolClient.ts:

Method

Signature

get_market

(uint64)(bool,uint256,uint256,uint64,uint64,uint64,uint64,uint64,uint64,uint256,uint256,uint256,uint256,uint64,uint256,uint256,uint64,uint64)

get_user

(address,uint64)(uint256,uint256,uint256,uint256,uint64,uint256)

get_global_user

(address)(uint256,uint256,uint64)

get_user_borrow_amount

(address,uint64)uint256

deposit

(uint64,uint256)uint256

withdraw

(uint64,uint256)uint256

borrow

(uint64,uint256)uint256

repay

(uint64,uint256)uint256

repay_all

(uint64)uint256

repay_on_behalf

(uint64,uint256,address)uint256

liquidate_cross_market

(uint64,uint64,address,uint256,uint256)uint256

Known Limitations

  1. WAD in multiple pools — WAD appears in two pools per chain. findMarket returns the first match. For borrow-only WAD pools, specify the pool ID explicitly if needed.

  2. Transaction groups — The prepare_* tools build simplified transaction groups. The DorkFi frontend uses ulujs CONTRACT class for more sophisticated group construction with automatic box funding and resource sharing.

  3. Price scale — Prices from the API use 18 decimal precision referenced against aUSDC = 1,000,000. USD values in health/position responses are approximated by dividing raw values by 10^12.

  4. API freshness — Read data comes from the DorkFi API which periodically refreshes from on-chain state. For the most current data, the API's POST endpoints can trigger a fresh blockchain query.

Available Tools

10 tools
borrow_txnA

Build unsigned transactions to borrow tokens from a DorkFi lending market. Requires sufficient collateral. Returns base64-encoded transactions for signing.

Inputs: chain (required), amount (required), sender (required), symbol (required).

deposit_txnA

Build unsigned transactions to deposit (supply) tokens into a DorkFi lending market. Returns base64-encoded transactions for signing via UluWalletMCP.

Inputs: chain (required), amount (required), sender (required), symbol (required).

get_health_factorA

Check a user's health factor and risk level per pool. Health factor <= 1.0 means the position is liquidatable.

Inputs: chain (required), address (required).

get_liquidation_candidatesA

Find accounts eligible for liquidation using pre-indexed health data. Returns those below the health factor threshold.

Inputs: chain (required), limit, addresses, threshold.

get_marketsA

List DorkFi lending markets with live data (rates, deposits, borrows, prices). Optionally filter by symbol.

Inputs: chain (required), symbol.

get_positionA

Get a user's DorkFi lending positions across all markets. Returns per-pool health factors and portfolio summary.

Inputs: chain (required), address (required), symbol.

get_tvlA

Get total value locked (TVL) across DorkFi lending pools. Returns TVL per market and aggregate totals.

Inputs: chain.

liquidate_txnA

Build unsigned transactions to liquidate an undercollateralized position. The liquidator repays part of the debt and receives collateral at a bonus. Returns base64-encoded transactions for signing.

Inputs: chain (required), amount (required), sender (required), borrower (required), +2 more.

repay_txnA

Build unsigned transactions to repay borrowed tokens to a DorkFi lending market. Returns base64-encoded transactions for signing.

Inputs: chain (required), amount (required), sender (required), symbol (required).

withdraw_txnA

Build unsigned transactions to withdraw supplied tokens from a DorkFi lending market. Returns base64-encoded transactions for signing.

Inputs: chain (required), amount (required), sender (required), symbol (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 10 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes: market data, positions, health checks, liquidation candidates, and transaction builders for specific actions. However, get_health_factor overlaps with get_position since get_position already returns per-pool health factors, creating minor ambiguity.

    Naming Consistency5/5

    Naming follows a consistent verb_noun pattern: get_ for read operations and <action>_txn for transaction builders. This makes the tool set predictable and easy to navigate.

    Tool Count5/5

    At 10 tools, the server is well-scoped for a lending protocol. It covers market discovery, position monitoring, liquidation screening, and all core lending actions without unnecessary bloat.

    Completeness5/5

    The tool surface covers the full lending lifecycle: deposit, borrow, repay, withdraw, and liquidate, plus the necessary read operations for markets, positions, health, and liquidation candidates. No obvious dead-end workflows remain for the stated domain.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables interaction with the DorkFi lending protocol on Voi and Algorand, supporting market queries, user positions, liquidation scanning, TVL analytics, and transaction preparation.
      21
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      A DeFi MCP server enabling AI agents to query lending rates, execute swaps/bridges, monitor positions, and access prediction markets across 30+ chains with a trust layer for calldata verification.
      -