MoonMaker API

PayGate

ETH → USDC on-ramp for AI agents — swap and pay in one flow

PayGate

PayGate lets agents swap ETH to USDC automatically. If your agent has ETH but no USDC, PayGate handles the conversion so you can pay for MoonMaker (or any x402/ACP service).

Why PayGate?

  • No DEX integration needed — Don't build Uniswap routing into your agent
  • No token approvals — Just send ETH
  • One transaction — ETH in, USDC out
  • Low fee — 0.5% on ETH amount
  • Open sourcegithub.com/Sol-agent/paygate

Deployed Contracts

Option 1: Direct Contract Call

Call swapETHToUSDC with ETH as msg.value:

function swapETHToUSDC(
    address recipient,     // Where to send USDC
    uint256 minUsdcOut,    // Minimum USDC (6 decimals) — sandwich protection
    bytes32 jobRef         // Optional reference ID (use 0x0 if not needed)
) external payable returns (uint256 usdcOut);

Example (ethers.js)

const paygate = new ethers.Contract(
  "0x8dcFb0F5981BE9B8943C6d6aeeed6000C44B0583",
  ["function swapETHToUSDC(address,uint256,bytes32) payable returns (uint256)"],
  signer
);

const tx = await paygate.swapETHToUSDC(
  myWalletAddress,  // recipient
  1,                // minUsdcOut (set higher for production!)
  ethers.ZeroHash,  // jobRef
  { value: ethers.parseEther("0.002") }  // ~$5 worth of ETH
);

Example (cast / Foundry)

cast send 0x8dcFb0F5981BE9B8943C6d6aeeed6000C44B0583 \
  "swapETHToUSDC(address,uint256,bytes32)" \
  YOUR_ADDRESS \
  1 \
  0x0000000000000000000000000000000000000000000000000000000000000000 \
  --value 0.002ether \
  --rpc-url https://mainnet.base.org \
  --private-key YOUR_KEY

Option 2: HTTP API

For agents that prefer HTTP over direct contract calls.

Step 1: Request a swap

POST https://api.moonmaker.cc/paygate/request
Content-Type: application/json

{
  "ethAmount": "0.002",
  "recipientAddress": "0xYourAddress"
}

Returns payment instructions with the contract call data.

Step 2: Check status

GET https://api.moonmaker.cc/paygate/status/{requestId}

Step 3: Claim (after sending ETH)

POST https://api.moonmaker.cc/paygate/claim/{requestId}
Content-Type: application/json

{
  "txHash": "0x..."
}

Get contract info

GET https://api.moonmaker.cc/paygate/info

Returns contract address, fee, supported tokens.

View Functions

// Estimate USDC output for a given ETH amount
function getExpectedOutput(uint256 ethAmount) external view returns (uint256 usdcAmount);

// Current fee in basis points (50 = 0.5%)
function feeBps() external view returns (uint256);

// Current Uniswap pool fee tier
function poolFee() external view returns (uint24);

Fee

  • 0.5% of ETH amount (taken before swap)
  • Adjustable by contract owner, max 5%
  • Example: Send 1 ETH → 0.005 ETH fee → 0.995 ETH swapped to USDC

Security

  • ReentrancyGuard on all state-changing functions
  • SafeERC20 for token transfers
  • Pausable by owner in emergencies
  • Ownable2Step — two-step ownership transfer
  • Verified on Sourcify (full match)
  • Open source: GitHub

On this page