Skip to content

agent-tools-org/moonpay-cli-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MoonPay CLI Autonomous DCA Agent

Autonomous dollar-cost averaging agent for the Synthesis hackathon MoonPay CLI Agents track. The agent uses the MoonPay CLI MCP server as its execution layer for balances, market data, swaps, and bridge actions, then applies strategy logic for time-weighted buys, value averaging, and dip buying.

What It Does

  • Connects to mp mcp as the primary action layer
  • Tracks portfolio balances and rolling P&L across Ethereum, Base, Polygon, and Arbitrum
  • Executes scheduled DCA swaps with per-strategy decision logic
  • Bridges funding inventory across chains before swapping when the target chain is underfunded
  • Enforces safety checks for max spend, stop-loss, gas caps, and slippage
  • Includes a DCALog.sol contract and a gasless deployment script for Status Network Sepolia

Setup

  1. Install MoonPay CLI globally:
npm install -g @moonpay/cli
  1. Install project dependencies:
npm install
  1. Export the environment variables used by the agent:
export MOONPAY_ACCOUNT=0xYourAddress
export MOONPAY_SWAP_TOOL=swap_tokens
export MOONPAY_BRIDGE_TOOL=bridge_assets
export MOONPAY_BALANCES_TOOL=get_balances
export MOONPAY_MARKET_TOOL=get_market_data

The tool names are configurable because MoonPay CLI MCP tool ids may differ by environment or version.

Run Tests

npm test

Use the Agent

Create a DcaAgent, register one or more schedules, and run runCycle() on your preferred cadence. The tests show direct examples with mocked MCP responses. For real execution, create the MoonPay client with:

const client = await MoonPayMcpClient.connectStdio();

That launches mp mcp, initializes the MCP session, and uses MoonPay tools for balances, market data, swaps, and bridges.

Status Network Sepolia Deploy

Set:

export STATUS_PRIVATE_KEY=0x...
export STATUS_GASLESS_RELAY_URL=https://your-relay.example

Then run:

npm run deploy:status

The deploy script compiles contracts/DCALog.sol, prepares contract creation bytecode, and submits it to a sponsor relay targeting Status Network Sepolia RPC https://public.sepolia.status.im on chain id 1660.

About

Synthesis Hackathon submission

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors