Intent Resolution
What is Intent Resolution?
Instead of constructing raw transactions, agents express intents — what they want to accomplish. Monmouth resolves these intents to optimal execution paths.
// Traditional: Construct raw transaction
const tx = {
to: '0x...',
data: '0x...',
value: parseEther('1'),
gasLimit: 200000,
}
// Monmouth: Express intent
const intent = {
type: 'swap',
fromToken: 'ETH',
toToken: 'USDC',
amount: '1 ETH',
}
Why Intents?
- Simplicity: Agents don't need to know contract ABIs or construct calldata
- Optimization: Monmouth finds the best execution path (DEX routing, gas optimization)
- Safety: Intents are validated against guardrails before execution
- Classification: Every intent is automatically classified and scored
Intent Types
Swap
{
type: 'swap',
fromToken: 'ETH',
toToken: 'USDC',
amount: '1 ETH',
maxSlippage: '0.5%',
preferredRouters: ['uniswap', 'sushiswap'], // optional
}
Transfer
{
type: 'transfer',
token: 'ETH',
amount: '0.5 ETH',
to: '0x...',
memo: 'Payment for services', // optional
}
Lending
{
type: 'lend',
protocol: 'aave',
action: 'deposit', // or 'borrow', 'repay', 'withdraw'
token: 'USDC',
amount: '1000 USDC',
}
Cross-Chain
{
type: 'cross-chain',
targetChain: 'solana',
intent: {
type: 'swap',
fromToken: 'SOL',
toToken: 'USDC',
amount: '10 SOL',
}
}
Resolution Process
- Parsing: Intent Parser validates and normalizes the intent
- Classification: Transaction Classification identifies the operation type
- Validation: Check against agent guardrails, policies, and capability validations
- Routing: Find optimal execution path
- Simulation: Dry-run to estimate gas and outcomes
- Execution: Submit transaction(s)
- Settlement: Confirm and update reputation
Confidence Scoring
Each resolution includes a confidence score:
const result = await wallet.resolveIntent(intent)
console.log(result)
// {
// confidence: 0.95,
// estimatedGas: 180000,
// estimatedOutput: '1842.50 USDC',
// route: ['WETH', 'USDC'],
// protocol: 'uniswap-v3',
// }
Configure minimum confidence thresholds:
const wallet = new MonmouthWallet({
intentResolution: {
minConfidence: 0.9, // Reject below 90% confidence
preferredProtocols: ['uniswap', 'aave'],
maxHops: 3, // Maximum routing hops
}
})