import { getKuruPools, getEulerVaults, getBestSwapRoute } from 'rampart-monad'// Fetch live Kuru orderbook poolsconst pools = await getKuruPools()console.log(`${pools.length} active pools on Kuru`)// → 24 active pools on Kuru// Find the best swap route across 6 DEXesconst route = await getBestSwapRoute( '0x0000000000000000000000000000000000000000', // MON (native) '0xf817257fed379853cDe0fa4F97AB987181B1E5Ea', // USDC '1000000000000000000' // 1 MON)console.log(`Best route: ${route.bestDex} - ${route.amountOut} USDC`)// → Best route: kuru - 0.354 USDC// Get all Euler V2 vaults with live APRconst vaults = await getEulerVaults()console.log(`${vaults.length} Euler vaults, best APR: ${(vaults[0]?.apr * 100).toFixed(2)}%`)// → 108 Euler vaults, best APR: 12.40%
import { RampartAgent } from 'rampart-monad'import { generateText } from 'ai'import { anthropic } from '@ai-sdk/anthropic'const agent = new RampartAgent()const { text } = await generateText({ model: anthropic('claude-3-5-sonnet-20241022'), tools: agent.tools, system: 'You are a Monad DeFi analyst. Use the provided tools to answer questions.', prompt: 'What is the best yield strategy for 10,000 USDC on Monad right now?', maxSteps: 5,})console.log(text)// → "Based on current rates, the best yield for 10,000 USDC on Monad is Euler V2// at 12.4% APY via the USDC lending vault (0x...). Alternative: Morpho Blue// at 11.2% APY with slightly lower risk..."