AEP Monetization

When to Use

  • User wants to configure treasury or fee collection
  • User asks about origination fee, setup fee, or API paywall
  • User needs fee-free mode for testnet

Treasury

All revenue flows to a single AEP Treasury address on Base (USDC).

  • Config: treasuryAddress in ~/.aep/config.json
  • Env: AEP_TREASURY_ADDRESS overrides config
  • Deployment: Set AEP_TREASURY_ADDRESS when running forge script script/DeployRelationships.s.sol to deploy factories with fee collection

Fee Details

See references/fees-and-env.md for revenue streams table, env vars, and relationship contract fee details.

REST API x402 paywall

On a server running packages/api, when AEP_TREASURY_ADDRESS and pricing env are set, POST /resolve (and premium tier POST /resolve/premium) return 402 until payment headers satisfy x402. Default list prices are $0.005 / $0.02 when using the stock env defaults. With treasury unset, the same server exposes resolution without that gate. MCP and CLI aep resolve use a local resolver in-process unless you pass --api-url.

Fee-Free Mode

Deploy factories with AEP_TREASURY_ADDRESS unset for testnet. When treasury is address(0), passing fee > 0 will revert. Use fee = 0 for all creates.

Deployment

# Deploy relationship factories with treasury (production)
AEP_TREASURY_ADDRESS=0x... PRIVATE_KEY=0x... forge script script/DeployRelationships.s.sol --rpc-url https://sepolia.base.org --broadcast

# Deploy without treasury (testnet, no fees)
PRIVATE_KEY=0x... forge script script/DeployRelationships.s.sol --rpc-url https://sepolia.base.org --broadcast

Backward Compatibility

  • Existing deployments: Factories deployed before this change have no constructor and no fee logic. They remain fee-free.
  • New deployments: Factories deployed with DeployRelationships.s.sol accept treasury in constructor. Pass fee = 0 for no fee when treasury is set.