Repository navigation
Conversation
x402-paid DeFi safety checks: pre-sign transaction simulation, sanctions and scam address screening, pre-trade token checks, a risk-scored new-launch feed, batch token risk scoring, and Aave liquidation risk.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds an AgentForge action provider: DeFi safety checks that agents pay for per call in USDC on Base over x402, from the agent's own wallet. No API key.
simulate_transactioneth_simulateV1): decoded revert reasons, net asset changes for the sender, approvals granted, counterparty sanctions/scam screening, proceed/caution/avoid verdictcheck_addressescheck_token_before_tradeget_new_token_launchessincescore_tokenscheck_lending_healthDesign notes:
x402provider:registerExactEvmSchemewithwalletProvider.toSigner(). AregisterPolicyfilter drops any payment option abovemaxPaymentUsdc(default 0.05, or theAGENTFORGE_MAX_PAYMENT_USDCenv var) before anything is signed.simulate_transaction.fromandcheck_lending_health.addressdefault to the agent's own wallet.supportsNetworkisbase-mainnet, because payments settle there. The checked transactions and tokens can be on Ethereum, Base, Arbitrum, Optimism, or Polygon via each action'schainargument.The API is live at https://agentforge-taupe.vercel.app and listed in the CDP x402 Bazaar. Every paid route answers an unpaid request with 402 and its exact price, and failed calls (4xx/5xx) are never settled.
Tests
jest src/action-providers/agentforge: 5/5 passing. Covers the request shape per action, defaulting to the wallet address, GET query encoding, the spending-cap policy (filters 50001 atomic units at a 0.05 cap), and JSON errors for both HTTP failures and thrown errors.tsc --noEmit,eslint, andprettier -care clean for the new files.ViemWalletProvideronbase-mainnetand a fresh empty wallet.I haven't run a funded end-to-end session through the example chatbots. Happy to add one if reviewers want it.
Checklist
@coinbase/agentkitminor)action-providers/index.ts(alphabetical)🤖 Generated with Claude Code