Mantle defi operator

From Starchild-ai-agent/official-skills · View interactive version

Mantle defi operator is an AI agent skill from the GitHub repository Starchild-ai-agent/official-skills. Use when a Mantle DeFi task needs discovery, venue comparison, or execution-ready planning with verified contracts, preflight evidence, and an external handoff.

How to use this skill

Skill file

Mantle Defi Operator

Overview

Coordinate deterministic pre-execution planning for Mantle DeFi intents. This skill should orchestrate verified address lookup, preflight evidence, and execution handoff steps instead of duplicating specialized address, risk, or portfolio analysis.

CLI-First Transaction Building

ALWAYS use mantle-cli commands to build unsigned transactions. The CLI produces correct calldata with verified addresses and ABI encoding. Do NOT:

Tool Discovery via Capability Catalog

Before building any transaction, consult the Capability Catalog via CLI for the authoritative list of available tools, their read/write nature, wallet requirements, and call ordering:

mantle-cli catalog list --json                    # all capabilities
mantle-cli catalog list --category execute --json  # only tx-building commands
mantle-cli catalog search "swap" --json            # keyword search
mantle-cli catalog show mantle_buildSwap --json    # full details + CLI command template

Each entry includes:

Available CLI commands for DeFi operations:

# Swap operations
mantle-cli swap build-swap --provider <dex> --in <token> --out <token> --amount <n> --recipient <addr> --json
mantle-cli swap approve --token <token> --spender <router> --amount <n> --json
mantle-cli swap wrap-mnt --amount <n> --json
mantle-cli swap unwrap-mnt --amount <n> --json
mantle-cli swap pairs --json

# Aave V3 lending
mantle-cli aave supply --asset <token> --amount <n> --on-behalf-of <addr> --json
mantle-cli aave borrow --asset <token> --amount <n> --on-behalf-of <addr> --json
mantle-cli aave repay --asset <token> --amount <n|max> --on-behalf-of <addr> --json
mantle-cli aave withdraw --asset <token> --amount <n|max> --to <addr> --json
mantle-cli aave markets --json

# Liquidity provision
mantle-cli lp find-pools --token-a <t> --token-b <t> --json           # ALWAYS START HERE — discover ALL pools
mantle-cli lp pool-state <pool-or-tokens> --json
mantle-cli lp suggest-ticks <pool-or-tokens> --json
mantle-cli lp analyze <pool-or-tokens> [--investment-usd <n>] --json  # Deep pool analysis: APR, risk, range comparison
mantle-cli lp positions --owner <addr> --json
mantle-cli lp add --provider <dex> --token-a <t> --token-b <t> (--amount-a <n> --amount-b <n> | --amount-usd <n>) --recipient <addr> --json
mantle-cli lp remove --provider <dex> --recipient <addr> --token-id <id> (--liquidity <n> | --percentage <1-100>) --json
mantle-cli lp collect-fees --provider <p> --token-id <id> --recipient <addr> --json

# Read operations (no signing needed)
mantle-cli defi swap-quote --in <token> --out <token> --amount <n> --provider best --json
mantle-cli defi lending-markets --json
mantle-cli account balance <addr> --tokens USDC,USDT0 --json

All --json outputs contain unsigned_tx with to, data, value, chainId — pass this directly to the signer without adding from.

When Not to Use

Quick Checklist

Workflow

  1. Normalize intent:
  1. Run prep checks from references/defi-execution-guardrails.md.
  2. Resolve candidate protocol contracts from mantle-address-registry-navigator using the required registry key or protocol role for the requested action.
  3. Classify the planning mode:
  1. Build the candidate set from references/curated-defaults.yaml; carry forward each default's freshness metadata and rationale, and if the user names another protocol, keep it compare_only until its contracts are verified.
  2. Rank only eligible candidates with live signals from references/protocol-selection-policy.md:
  1. Pull supporting evidence before execution planning:
  1. Structure the result per planning_mode using the Quick Checklist:
  1. Load operation SOP only for execution_ready planning:
  1. Resolve quote, pool, or market route only after the protocol choice is gated by verified contracts and supporting evidence.
  2. If an approval is required, carry forward the allowance evidence and prepare the smallest viable approve step.
  3. If account supports batching (for example ERC-4337 smart account), note whether approve+action can be safely batched by the external executor.
  4. Produce an execution handoff plan (calls, parameters, sequencing, and risk notes). Do not sign, broadcast, deploy, or claim execution.
  5. Define post-execution verification checks (balances, allowances, slippage) to run after the user confirms external execution.

Guardrails

Output Format

MANDATORY: Every response MUST use this exact structured template. Do not use prose or free-form text instead of this template. Fill every field; use "not applicable in {planning_mode} mode" for fields that do not apply to the current mode. In discovery_only mode, fields under Execution Handoff and Post-Execution Verification Plan must all say "not applicable in discovery_only mode."

Mantle DeFi Pre-Execution Report
- operation_type:
- planning_mode: discovery_only | compare_only | execution_ready
- environment:
- intent_summary:
- analyzed_at_utc:

Preparation
- supporting_skills_used:
- address_resolution_ref:
- risk_report_ref:
- portfolio_report_ref:
- curated_defaults_considered:
- quote_source:
- expected_output_min:
- allowance_status:
- approval_plan:

Protocol Selection
- recommended:
- also_viable:
- discovery_only:
- rationale:
- data_freshness:
- confidence: high | medium | low

Execution Handoff
- recommended_calls:
- calldata_inputs:
- registry_key:
- sequencing_notes:
- batched_execution_possible: yes | no
- handoff_available: yes | no

Post-Execution Verification Plan
- balances_to_recheck:
- allowances_to_recheck:
- slippage_checks:
- anomalies_to_watch:

Status
- preflight_verdict: pass | warn | block | unknown
- readiness: ready | blocked | needs_input
- blocking_issues:
- next_action:

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.