{"at":"2026-11-23T03:08:46.201Z","dir":"sent","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"didrun-lab","version":"0.1.0"},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T03:08:46.623Z","dir":"received","era":"server_discover","message":{"error":{"code":-32601,"message":"Method not found"},"id":1,"jsonrpc":"2.0"}}
{"at":"2026-11-23T03:08:46.724Z","dir":"sent","era":"initialize","message":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"didrun-lab","version":"0.1.0"},"protocolVersion":"2025-11-25"}}}
{"at":"2026-11-23T03:08:47.124Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"resources":{"listChanged":true},"tools":{"listChanged":true}},"protocolVersion":"2025-11-25","serverInfo":{"name":"spectra-finance","version":"1.0.0"}}}}
{"at":"2026-11-23T03:08:47.124Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T03:08:47.124Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T03:08:47.129Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"tools":[{"description":"Get detailed information about a specific Spectra Principal Token (PT).\nReturns: maturity date, TVL, implied APY, PT/YT prices, pool liquidity, LP APY breakdown,\nunderlying asset info, IBT protocol, and yield leverage.\nUse this when you know the specific PT address and chain.\n\nProtocol context:\n- PT trades at a discount to its underlying (the discount IS the fixed yield).\n  At maturity, PT redeems 1:1 for the underlying asset.\n- PT + YT = 1 underlying at maturity. YT price = 1 - PT price (in underlying terms).\n- YT leverage shows how much yield exposure 1 unit of YT provides relative to holding\n  the underlying directly. Higher leverage = more amplified yield exposure.\n\nUse compare_yield to compare fixed vs. variable rates. Use get_looping_strategy to\ncalculate leveraged fixed yield via Morpho. Use get_portfolio to check wallet holdings.\nUse get_pool_activity to see trading patterns on this pool.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"chain":{"description":"The blockchain network","enum":["mainnet","base","arbitrum","optimism","avalanche","katana","sonic","flare","bsc","monad","ethereum"],"type":"string"},"pt_address":{"description":"The PT contract address (0x...)","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"}},"required":["chain","pt_address"],"type":"object"},"name":"get_pt_details"},{"description":"List all active Spectra pools on a given chain.\nReturns a summary of each pool including: asset name, maturity, TVL, implied APY,\nLP APY, and pool liquidity. Useful for discovering available yield opportunities.\n\nEach pool is a Curve StableSwap-NG AMM pair of IBT (interest-bearing token) and PT\n(Principal Token). Implied APY is the fixed rate you lock in by buying PT at discount.\nLP APY is the yield from providing liquidity to the pool (fees + gauge emissions).\n\nFor multi-chain discovery, use get_best_fixed_yields (raw APY ranking) or\nscan_opportunities (capital-aware with price impact and looping analysis).\nUse get_pool_activity on a specific pool to see recent trading patterns.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"chain":{"description":"The blockchain network to query","enum":["mainnet","base","arbitrum","optimism","avalanche","katana","sonic","flare","bsc","monad","ethereum"],"type":"string"},"compact":{"default":false,"description":"If true, return one-line-per-pool output (much shorter). Use for quick scanning; omit for full details.","type":"boolean"},"min_tvl_usd":{"default":0,"description":"Minimum TVL in USD to include in results","type":"number"},"sort_by":{"default":"implied_apy","description":"Sort results by this metric (descending)","enum":["implied_apy","tvl","lp_apy","maturity"],"type":"string"}},"required":["chain"],"type":"object"},"name":"list_pools"},{"description":"Find the best fixed-rate yield opportunities across all Spectra chains.\nScans all supported networks and returns the top opportunities ranked by implied APY.\nFilters by asset type if specified.\n\nImportant: This ranks by raw implied APY without considering your capital size or pool\nliquidity. These rankings will often disagree with scan_opportunities (which ranks by\neffective APY after entry cost). That disagreement is intentional -- raw APY reflects\nthe pool's headline rate while effective APY reflects what you actually capture at your\ncapital size. Neither ranking is \"correct\" -- they measure different things. Use both to\ndevelop conviction about which pools genuinely serve your strategy.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"asset_filter":{"description":"Optional: filter by underlying asset symbol (e.g., 'USDC', 'ETH', 'GHO')","maxLength":100,"type":"string"},"compact":{"default":false,"description":"If true, return one-line-per-opportunity output (much shorter). Use for quick scanning; omit for full details.","type":"boolean"},"min_liquidity_usd":{"default":5000,"description":"Minimum pool liquidity in USD (default $5,000)","type":"number"},"min_tvl_usd":{"default":10000,"description":"Minimum pool TVL in USD (default $10,000)","type":"number"},"top_n":{"default":10,"description":"Number of top results to return (default 10, max 50)","type":"number"}},"type":"object"},"name":"get_best_fixed_yields"},{"description":"Compare Spectra's fixed yield (via PT) against the variable yield of the underlying\ninterest-bearing token. Helps users decide if locking in a fixed rate is worthwhile\nversus staying in the variable-rate position.\n\nProtocol context:\n- The fixed rate comes from buying PT at a discount. Entry cost (price impact from the\n  AMM trade) is amortized over days to maturity — shorter maturity means higher annualized\n  entry cost, longer maturity spreads the cost thin.\n- Variable rate (IBT APR) fluctuates continuously. The fixed rate locks in at purchase.\n- LP alternative: providing liquidity to the Curve pool earns trading fees + SPECTRA\n  gauge emissions. This is a third option alongside fixed (PT) and variable (IBT).\n\nUse get_looping_strategy to lever up the fixed yield via Morpho. Use get_portfolio to\ncheck your current positions. Use scan_opportunities for multi-chain comparison.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"capital_usd":{"default":10000,"description":"Your deposit size in USD (default $10,000). Used with ve_spectra_balance to compute per-pool boost.","exclusiveMinimum":0,"type":"number"},"chain":{"description":"The blockchain network","enum":["mainnet","base","arbitrum","optimism","avalanche","katana","sonic","flare","bsc","monad","ethereum"],"type":"string"},"pt_address":{"description":"The PT contract address to compare","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"ve_spectra_balance":{"description":"Your veSPECTRA token balance. Computes real boost using B = min(2.5, 1.5*(v/V)*(D/d)+1).","minimum":0,"type":"number"}},"required":["chain","pt_address"],"type":"object"},"name":"compare_yield"},{"description":"Calculate a leveraged fixed-yield strategy using Spectra PT + Morpho looping.\n\nStrategy: Deposit asset -> mint PT on Spectra -> use PT as collateral on Morpho ->\nborrow underlying -> deposit again -> repeat. Each loop multiplies yield exposure.\n\nReturns projected yields at different leverage levels (1x to max safe leverage),\neffective APY, and risk parameters.\n\nAutomatically fetches the live Morpho borrow rate and LLTV when a matching market\nexists. You can still override morpho_ltv and borrow_rate manually if needed.\n\nNOTE: Looping requires a Morpho market that accepts the specific PT as collateral.\n\nRisk context:\n- Borrow rates are variable. A 5% spread (7% yield - 2% borrow) can turn negative if\n  borrow rates spike above your fixed yield. Monitor rates in Morpho.\n- Higher leverage amplifies both returns and liquidation risk. Consider keeping 1-2\n  loops below maximum for safety buffer.\n- Entry cost (price impact) compounds across loops — each iteration faces degraded\n  effective pool liquidity.\n\nUse get_morpho_markets to find available Morpho markets. Use scan_opportunities to\ndiscover the best looping opportunities across all chains with capital-aware sizing.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"borrow_rate":{"description":"Override Morpho borrow rate in % APY. If omitted, fetched live from Morpho.","type":"number"},"chain":{"description":"The blockchain network","enum":["mainnet","base","arbitrum","optimism","avalanche","katana","sonic","flare","bsc","monad","ethereum"],"type":"string"},"max_loops":{"default":5,"description":"Maximum number of loop iterations to calculate (default 5)","maximum":20,"minimum":1,"type":"number"},"morpho_ltv":{"description":"Override Morpho LTV ratio (e.g. 0.86 = 86%). If omitted, auto-detected from Morpho.","exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"},"pt_address":{"description":"The PT contract address to loop","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"}},"required":["chain","pt_address"],"type":"object"},"name":"get_looping_strategy"},{"description":"Get wallet positions on Spectra for a specific address.\nReturns PT, YT, and LP balances with USD values, claimable yield,\nand current rates. Queries a single chain or all chains.\nUse this to understand what a wallet currently holds on Spectra.\n\nProtocol context:\n- Depositing IBT always mints BOTH PT and YT in equal amounts. If a wallet holds\n  YT but no PT, it sold or LPed its PT. If it holds PT but no YT, it sold its YT.\n- PT + YT = 1 underlying at maturity. This identity is fundamental to all strategies.\n- Balance ratios are the key signal. Output shows Position Shape (e.g., \"YT/PT 4:1\")\n  so you can reason about what the holder's position implies given the mechanics above.\n- When investigating a strategy, ALWAYS cross-reference portfolio with\n  get_pool_activity. Activity shows the HOW (transaction patterns), portfolio\n  shows the WHAT (resulting position). Neither alone tells the full story.\n- Strategies often span multiple wallets. If get_pool_activity shows concentrated\n  activity from several addresses, check each one to build the full picture.\n- For activity analysis, use get_pool_activity with the address parameter — it will\n  automatically cross-reference portfolio data and provide flow accounting, contract\n  detection, gas estimates, and pool impact analysis.\n- Use get_address_activity to scan all pools for an address's activity in one call.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"address":{"description":"The wallet address (0x...)","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"chain":{"description":"Specific chain to query. Omit to scan all chains.","enum":["mainnet","base","arbitrum","optimism","avalanche","katana","sonic","flare","bsc","monad","ethereum"],"type":"string"}},"required":["address"],"type":"object"},"name":"get_portfolio"},{"description":"Get historical trading volume for a specific Spectra pool.\nReturns timestamped buy/sell volume in USD. Use list_pools first to find pool addresses.\nUseful for assessing pool activity and liquidity depth before entering a position.\n\nContext: Volume alone doesn't indicate capital efficiency — $1M volume in a $5M liquidity\npool is very different from $1M in a $500K pool. Combine volume data with pool liquidity\n(from list_pools or get_pt_details) to assess real trading conditions.\n\nOutput includes volume/liquidity ratio analysis when pool data is available. For\nindividual transaction details and whale activity, use get_pool_activity instead.\nUse quote_trade to estimate price impact for a specific trade size.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"chain":{"description":"The blockchain network","enum":["mainnet","base","arbitrum","optimism","avalanche","katana","sonic","flare","bsc","monad","ethereum"],"type":"string"},"pool_address":{"description":"The Curve pool address (0x...) OR a PT address. If a PT address is given, it will be resolved to the corresponding pool automatically.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"}},"required":["chain","pool_address"],"type":"object"},"name":"get_pool_volume"},{"description":"Get recent trade and liquidity activity for a specific Spectra pool.\nReturns individual transactions: buys, sells, and liquidity adds/removes with\nUSD values, timestamps, and tx hashes.\n\nPool activity shows only the Curve pool's perspective (IBT ↔ PT swaps and LP\nevents). The Spectra Router batches operations atomically, so any single pool\nevent may be one step of a multi-step strategy. There is no BUY_YT or SELL_YT\nevent type — the pool never touches YT directly. Use get_protocol_context for\nthe full mechanics of how Router batching maps to pool activity types.\n\nProtocol mechanics that affect how activity appears:\n- BUY_PT and SELL_PT are Curve pool swaps between IBT and PT.\n- There is NO \"BUY_YT\" or \"SELL_YT\" type. The pool never touches YT directly.\n- YT selling via the Router's flash-redeem internally buys PT from the pool to\n  pair with YT for redemption — so YT sells show up as BUY_PT in the activity log.\n- A standalone mint (deposit IBT → PT+YT) does NOT appear in pool activity.\n  However, the Router can batch a mint + LP add in one atomic execute() call.\n  The minted PT + remaining IBT enter the pool as AMM_ADD_LIQUIDITY while the\n  minted YT goes directly to the user's wallet. So AMM_ADD_LIQUIDITY events\n  may ALSO represent YT acquisition — the YT minting is invisible in pool data.\n- The Router can also flash-mint atomically: flash-borrow IBT → mint PT+YT →\n  sell PT on the pool → user tops up the shortfall → user receives YT. This\n  shows up as SELL_PT but the user's net action is acquiring YT, not selling PT.\n- AMM_REMOVE_LIQUIDITY returns IBT + PT from the pool. Users often follow up by\n  selling the PT (SELL_PT) to recover capital, completing a mint→LP→remove→sell\n  loop that nets them YT at the cost of the PT discount (~1 - ptPrice).\n\nKey principle: any pool event type can be one step of a multi-step Router operation.\nDo not assume SELL_PT means \"user is bearish on PT\" or AMM_ADD_LIQUIDITY means\n\"user is providing liquidity for yield.\" Always cross-reference with get_portfolio\nto see what the address actually holds (PT, YT, LP balances) — the holdings reveal\nthe true strategy better than the activity log alone.\n\nAnalysis tips:\n- If an address has high SELL_PT count but holds mostly YT → mint-and-sell loop\n  (YT accumulation via PT discount). Check if YT balance >> PT balance.\n- If an address has BUY_PT events → could be YT flash-redeem (selling YT).\n  Check if their YT balance is low/zero relative to activity volume.\n- If an address has paired ADD/REMOVE liquidity → likely cycling through LP as\n  part of a mint loop, not long-term liquidity provision.\n- Compare activity volume to current position size. Large activity volume with\n  small current holdings = capital recycling (looping strategy).\n\nOutput includes an Address Concentration section with full addresses and per-address\ntype breakdowns. Use get_portfolio on those addresses to see their PT, YT, and LP\nbalances. Most analysis can be done without a block explorer — use get_portfolio on\naddresses from Address Concentration, and compare_yield or get_pt_details for rate context.\n\nAddress isolation mode: When you provide an 'address' parameter, the tool filters to that\naddress only, sorts chronologically (oldest first), and adds:\n- Sequence Analysis: detects repeating action cycles (e.g., ADD→REMOVE→SELL repeated 8×)\n  that reveal looping strategies. Uses \"could be\" language — cycles are structural patterns,\n  not conclusions about intent.\n- Capital Efficiency: compares total activity volume against the address's throughput,\n  flagging high ratios that indicate capital recycling (looping) vs accumulation.\n- If the address shows high-frequency activity (>10 txns), consider checking whether it is\n  a contract (programmatic execution via Router execute()) vs an EOA (manual/scripted).\n  Contracts execute atomically; EOAs submit separate transactions. This distinction affects\n  whether apparent \"sequences\" are truly sequential or batched.\n- Flow Accounting: automatically cross-references portfolio data to infer invisible mints\n  and show PT/YT flow reconciliation. Compares YT holdings vs PT sell volume.\n- Contract Detection: checks whether the address is a contract or EOA via on-chain\n  eth_getCode. Contracts execute atomically; EOAs submit sequential transactions.\n- Pool Impact: flags when SELL_PT or BUY_PT volume is significant relative to pool\n  liquidity, indicating potential market impact on implied APY.\n- Gas Estimates: estimates total gas cost from transaction count using chain-specific\n  gas heuristics. Shows gas as percentage of activity volume and position value.\n- Pool Context: fetches pool liquidity and implied APY for baseline context.\n\nFor multi-pool activity scanning, use get_address_activity to find all pools an address\nhas interacted with in a single call.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"address":{"description":"Filter to a specific wallet address. Enables chronological sort, sequence analysis, and capital efficiency hints.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"chain":{"description":"The blockchain network","enum":["mainnet","base","arbitrum","optimism","avalanche","katana","sonic","flare","bsc","monad","ethereum"],"type":"string"},"limit":{"default":20,"description":"Number of most recent activities to return (default 20, max 100)","maximum":100,"type":"number"},"pool_address":{"description":"The Curve pool address (0x...) OR a PT address. If a PT address is given, it will be resolved to the corresponding pool automatically.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"type_filter":{"default":"all","description":"Filter by activity type. Default: all.","enum":["BUY_PT","SELL_PT","AMM_ADD_LIQUIDITY","AMM_REMOVE_LIQUIDITY","all"],"type":"string"}},"required":["chain","pool_address"],"type":"object"},"name":"get_pool_activity"},{"description":"Scan all pools on a chain (or all chains) for a given address's activity.\nReturns per-pool breakdown and cross-pool aggregates. Useful for discovering\nmulti-pool strategies without making N manual get_pool_activity calls.\n\nWhen investigating a wallet that operates across multiple pools (e.g., a curator\nor yield farmer diversifying across maturities), this tool reveals the full scope\nof their on-chain activity in one call.\n\nEach pool's activity is summarized with type breakdown and total volume.\nCross-pool totals show the address's aggregate engagement with Spectra.\n\nFor deep per-pool analysis (cycle detection, flow accounting, contract detection),\nuse get_pool_activity with the address parameter on the specific pool of interest.\nUse get_portfolio to see current holdings across all pools.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"address":{"description":"The wallet address to scan (0x...)","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"chain":{"description":"Specific chain to scan. Omit to scan all chains (slower).","enum":["mainnet","base","arbitrum","optimism","avalanche","katana","sonic","flare","bsc","monad","ethereum"],"type":"string"},"min_volume_usd":{"default":0,"description":"Minimum activity volume (USD) per pool to include in results (default 0)","type":"number"}},"required":["address"],"type":"object"},"name":"get_address_activity"},{"description":"Find Morpho lending markets that accept Spectra PT tokens as collateral.\nReturns market details including LLTV, borrow/supply APY, utilization, and liquidity.\nEssential for looping strategies: borrow against PT to lever up fixed yield.\nCan search across all chains or filter by a specific chain.\n\nProtocol context:\n- LLTV = Liquidation Loan-to-Value. This is the threshold where liquidation CAN occur,\n  NOT the safe operating level. Loop safely at ~90-95% of LLTV for margin buffer.\n- High utilization (>90%) means limited borrowing capacity — check available liquidity.\n- Borrow rates are variable and can spike. Monitor rates when running leveraged positions.\n- Not all Spectra chains have Morpho markets. Current Morpho PT coverage: mainnet, base,\n  arbitrum, katana.\n\nUse get_looping_strategy to calculate leveraged yield for a specific PT + Morpho market.\nUse get_morpho_rate to fetch live borrow APY for a specific market key.\nUse scan_opportunities for automated cross-chain looping discovery.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"chain":{"description":"Filter by Spectra chain. Omit to search all chains with Morpho PT markets.","enum":["mainnet","base","arbitrum","optimism","avalanche","katana","sonic","flare","bsc","monad","ethereum"],"type":"string"},"min_supply_usd":{"default":0,"description":"Minimum total supply in USD (default 0)","type":"number"},"pt_symbol_filter":{"description":"Filter by PT symbol (e.g., 'USDC', 'reUSD', 'sUSDe'). Matches against collateral symbol.","maxLength":100,"type":"string"},"sort_by":{"default":"supply","description":"Sort results (descending): supply, borrow_apy, or utilization","enum":["supply","borrow_apy","utilization"],"type":"string"},"top_n":{"default":10,"description":"Number of results to return (default 10, max 50)","maximum":50,"minimum":1,"type":"number"}},"type":"object"},"name":"get_morpho_markets"},{"description":"Get the current borrow rate and market state for a specific Morpho market.\nProvide the market's unique key (hex ID) and chain. Returns live borrow APY,\nsupply APY, utilization, and liquidity — the data needed to calculate\nlooping profitability. Use get_morpho_markets to discover market keys first.\n\nImportant: Rates are live as-of-query and change continuously based on utilization.\nWhen planning a looping strategy, verify rates are still favorable before executing.\nA profitable spread (fixed yield > borrow rate) can turn negative if borrow rates spike.\n\nUse get_looping_strategy with these rates to calculate leveraged yield projections.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"chain":{"description":"The blockchain network where the Morpho market lives","enum":["mainnet","base","arbitrum","optimism","avalanche","katana","sonic","flare","bsc","monad","ethereum"],"type":"string"},"market_key":{"description":"The Morpho market unique key (0x + 64 hex chars). Use get_morpho_markets to find it.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["chain","market_key"],"type":"object"},"name":"get_morpho_rate"},{"description":"Get Spectra protocol-wide statistics: SPECTRA token supply, circulating supply,\ncurrent weekly emissions, rebase formula, and general protocol info.\nUse this for questions about SPECTRA tokenomics or protocol health.\n\nProtocol context:\n- Rebase distributes additional SPECTRA to veSPECTRA holders. The formula is highly\n  non-linear: (veSPECTRA/totalSPECTRA)^3. At 10% lock rate, rebase captures ~0.1% of\n  emissions. At 50% lock rate, rebase captures ~12.5%. This incentivizes high ve\n  participation.\n- Weekly emissions decay exponentially and eventually stabilize.\n- Gauge emissions boost LP APY across all pools (see LP APY breakdown in pool tools).\n\nUse get_ve_info for live veSPECTRA data and boost calculations.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{},"type":"object"},"name":"get_protocol_stats"},{"description":"List all blockchain networks supported by Spectra Finance.\nUse this as a starting point to discover what's available.\n\nNot all chains have identical feature coverage. Morpho looping markets currently exist\non mainnet, base, arbitrum, and katana. veSPECTRA governance lives on Base.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{},"type":"object"},"name":"get_supported_chains"},{"description":"Estimate expected output, price impact, and minimum output for a PT trade.\nAutomatically uses on-chain Curve get_dy() for exact quotes when a public RPC\nis available for the chain. Falls back to a conservative constant-product math\nestimate if on-chain quoting fails.\n\nSide:\n  \"buy\"  = spend underlying/IBT to buy PT (e.g. spend USDC-worth to get PT)\n  \"sell\" = sell PT to receive underlying/IBT\n\nThis tool only quotes PT trades on the Curve AMM pool. YT does not trade on the\npool directly — YT is acquired by minting (deposit IBT to get PT+YT) or sold via\nflash-redeem. To estimate YT value: YT price = 1 - PT price in underlying terms.\n\nReturns: expected output amount, spot & effective rates, price impact,\nand minOut at the specified slippage tolerance. The output indicates whether the\nquote came from on-chain (exact) or math estimate (conservative upper bound).\n\nOn-chain quotes reflect the actual Curve StableSwap-NG amplification parameter\nand current pool state — significantly more accurate than the math estimate,\nespecially for large trades.\n\nUse simulate_portfolio_after_trade to preview your full portfolio state after this trade\n(BEFORE / TRADE / AFTER with deltas). Use compare_yield to evaluate whether the trade\nmakes sense relative to variable rates.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"amount":{"description":"Amount of input token (in human-readable units, not raw decimals)","exclusiveMinimum":0,"type":"number"},"chain":{"description":"The blockchain network","enum":["mainnet","base","arbitrum","optimism","avalanche","katana","sonic","flare","bsc","monad","ethereum"],"type":"string"},"pt_address":{"description":"The PT contract address (0x...)","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"side":{"description":"Trade direction: 'buy' = acquire PT, 'sell' = dispose PT","enum":["buy","sell"],"type":"string"},"slippage_tolerance":{"default":0.5,"description":"Slippage tolerance in % (default 0.5%). minOut = expectedOut * (1 - tolerance/100)","maximum":50,"minimum":0,"type":"number"}},"required":["chain","pt_address","amount","side"],"type":"object"},"name":"quote_trade"},{"description":"Preview what a wallet's Spectra portfolio would look like after a PT trade.\n\nFetches the wallet's current position (if any) and the PT pool data,\ncomputes a trade quote, then shows BEFORE / TRADE / AFTER with deltas.\n\nWorks even if the wallet has no existing position (simulates a new entry).\nSide: \"buy\" = acquire PT, \"sell\" = dispose PT.\n\nNote: This simulates PT trades only, not YT. YT is acquired by minting (deposit IBT\nto get PT+YT) and sold via the Router's flash-redeem mechanism, not through the Curve\npool directly. The wallet's YT balance is shown but not modified by this simulation.\n\nUse get_portfolio to see current full positions. Use quote_trade for a standalone\nprice quote without portfolio context.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"address":{"description":"The wallet address to simulate for (0x...)","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"amount":{"description":"Amount of input token (in human-readable units, not raw decimals)","exclusiveMinimum":0,"type":"number"},"chain":{"description":"The blockchain network","enum":["mainnet","base","arbitrum","optimism","avalanche","katana","sonic","flare","bsc","monad","ethereum"],"type":"string"},"pt_address":{"description":"The PT contract address (0x...)","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"side":{"description":"Trade direction: 'buy' = acquire PT (input underlying), 'sell' = dispose PT (input PT)","enum":["buy","sell"],"type":"string"},"slippage_tolerance":{"default":0.5,"description":"Slippage tolerance in % (default 0.5%). minOut = expectedOut * (1 - tolerance/100)","maximum":50,"minimum":0,"type":"number"}},"required":["chain","pt_address","address","amount","side"],"type":"object"},"name":"simulate_portfolio_after_trade"},{"description":"Scan all Spectra chains for the best risk-adjusted yield opportunities, sized to\nyour capital.\n\nUnlike get_best_fixed_yields (which ranks by raw APY), this tool computes:\n- Entry price impact at YOUR capital size (a 50% APY pool with $10K liquidity is useless at $500K)\n- Effective APY after amortizing entry cost over days to maturity\n- Morpho looping availability and optimal leveraged net APY\n- Pool capacity (max capital before price impact exceeds your threshold)\n- Risk warnings (low liquidity, short maturity, high impact)\n\nReturns opportunities ranked by effective APY (or looping net APY where available).\nRanking logic: when a profitable Morpho looping market exists, ranks by looping net APY\nwith cumulative entry cost amortized; otherwise ranks by effective APY (base APY minus\nannualized entry cost).\n\nUse get_looping_strategy to drill into a specific opportunity's leverage details.\nUse get_pool_activity and get_portfolio to investigate trading patterns and positions.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"asset_filter":{"description":"Optional: filter by underlying asset symbol (e.g., 'USDC', 'ETH')","maxLength":100,"type":"string"},"capital_usd":{"description":"How much capital (in USD) to deploy","exclusiveMinimum":0,"type":"number"},"compact":{"default":false,"description":"If true, return one-line-per-opportunity output (much shorter). Omit for full details.","type":"boolean"},"include_looping":{"default":true,"description":"Whether to check Morpho looping availability (default true)","type":"boolean"},"max_price_impact_pct":{"default":5,"description":"Filter out pools where entry impact exceeds this % (default 5)","maximum":100,"minimum":0,"type":"number"},"min_liquidity_usd":{"default":5000,"description":"Minimum pool liquidity in USD (default $5,000)","type":"number"},"min_tvl_usd":{"default":10000,"description":"Minimum pool TVL in USD (default $10,000)","type":"number"},"top_n":{"default":10,"description":"Number of top results to return (default 10, max 50)","type":"number"},"ve_spectra_balance":{"description":"Your veSPECTRA token balance. Computes the real per-pool boost using B = min(2.5, 1.5*(v/V)*(D/d)+1). Fetches live totalSupply from Base chain. If omitted, shows min/max APY ranges.","minimum":0,"type":"number"}},"required":["capital_usd"],"type":"object"},"name":"scan_opportunities"},{"description":"Scan all Spectra chains for YT (Yield Token) arbitrage opportunities.\n\nCompares the IBT's actual current variable APR against the rate implied by the YT's\nmarket price. When these diverge significantly, an arbitrage opportunity may exist:\n\n  - Positive spread (IBT APR > YT implied rate): IBT earns more than the YT price implies\n  - Negative spread (IBT APR < YT implied rate): IBT earns less than the YT price implies\n\nReturns opportunities sorted by absolute spread, with capital-aware entry sizing\nand break-even analysis.\n\nExecution mechanics:\n- Buying YT: The Spectra Router can flash-mint (flash-borrow IBT → mint PT+YT → sell PT\n  on pool → user covers shortfall → user receives YT). This appears as SELL_PT in pool\n  activity. Alternatively, minting IBT → PT+YT and selling PT separately.\n- Selling YT: The Router flash-redeems (borrow IBT → buy PT from pool → burn PT+YT →\n  repay → profit). This appears as BUY_PT in pool activity. The Curve pool does NOT\n  trade YT directly.\n- Break-even assumes the spread persists. Real variable rates fluctuate — spreads can\n  close quickly. The break-even period is the minimum time needed, not a guarantee.\n\nUse compare_yield for a detailed fixed-vs-variable breakdown on a specific pool.\nUse get_pool_activity to monitor recent trading patterns in the target pool.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"asset_filter":{"description":"Optional: filter by underlying asset symbol (e.g., 'USDC', 'ETH')","maxLength":100,"type":"string"},"capital_usd":{"description":"How much capital (in USD) to deploy","exclusiveMinimum":0,"type":"number"},"compact":{"default":false,"description":"If true, return one-line-per-opportunity output (much shorter). Omit for full details.","type":"boolean"},"max_price_impact_pct":{"default":5,"description":"Filter out pools where entry impact exceeds this % (default 5)","maximum":100,"minimum":0,"type":"number"},"min_liquidity_usd":{"default":5000,"description":"Minimum pool liquidity in USD (default $5,000)","type":"number"},"min_spread_pct":{"default":1,"description":"Minimum absolute spread (%) to surface (default 1.0)","minimum":0,"type":"number"},"min_tvl_usd":{"default":10000,"description":"Minimum pool TVL in USD (default $10,000)","type":"number"},"top_n":{"default":10,"description":"Number of top results to return (default 10, max 50)","type":"number"},"ve_spectra_balance":{"description":"Your veSPECTRA token balance. Computes the real per-pool boost using B = min(2.5, 1.5*(v/V)*(D/d)+1). Fetches live totalSupply from Base chain.","minimum":0,"type":"number"}},"required":["capital_usd"],"type":"object"},"name":"scan_yt_arbitrage"},{"description":"Get live veSPECTRA governance token information and compute boost scenarios.\n\nReads the current veSPECTRA total supply from Base chain on-chain, and given your\nbalance + a specific pool, computes your exact boost multiplier.\n\nThe Spectra boost formula: B = min(2.5, 1.5 * (v/V) * (D/d) + 1)\n  v = your veSPECTRA balance\n  V = total veSPECTRA supply (read live from Base)\n  D = pool TVL\n  d = your deposit size\nFull 2.5x boost when: v/V >= d/D (your share of votes >= your share of pool)\n\nUseful for understanding how much veSPECTRA you need for max boost in a given\npool at a given deposit size.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"capital_usd":{"description":"Your planned deposit size in USD. Required with ve_spectra_balance to compute boost.","exclusiveMinimum":0,"type":"number"},"chain":{"description":"Chain of the pool to check boost for (optional, used with pt_address).","enum":["mainnet","base","arbitrum","optimism","avalanche","katana","sonic","flare","bsc","monad","ethereum"],"type":"string"},"pt_address":{"description":"PT address of the pool to check boost for (optional, used with chain).","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"ve_spectra_balance":{"description":"Your veSPECTRA token balance. If provided with capital_usd, computes your boost.","minimum":0,"type":"number"}},"type":"object"},"name":"get_ve_info"},{"description":"Model a MetaVault \"double loop\" strategy for curators.\n\nMetaVaults are ERC-7540 curated vaults that automate LP rollover and compound\nYT yield back into LP positions. This tool models the economics of leveraging\nMetaVault shares as collateral on Morpho (or similar lending markets).\n\nThe \"double loop\":\n  Layer 1 (inside vault): YT yield → LP tokens (compounding loop, managed by curator)\n  Layer 2 (on top):       MV shares → Morpho collateral → borrow → deposit back (leverage loop)\n\nBecause YT compounding raises the base yield, leverage multiplies a higher base —\ncreating a \"double loop premium\" over raw PT looping.\n\nDual Morpho Market Strategy:\n  Curators should create TWO Morpho markets for maximum flywheel effect:\n  Market A (PT / underlying): For external users to loop PT. Drives pool volume & LP fees.\n  Market B (MV shares / underlying): For the curator to loop vault shares. Amplifies own capital.\n  These markets reinforce each other — PT demand deepens the pool, deeper pool attracts more\n  loopers, and the curator earns fees on all external deposits flowing through the vault.\n\nCurator economics: The curator EARNS the performance fee on external deposits — this is\nrevenue for managing the vault (rolling positions, compounding YT, maintaining allocations).\n\nAll parameters are curator-configurable. No live API calls — this is a strategy\nmodeling tool for pre-launch planning. When MetaVault API goes live, auto-detection\nwill be added.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"base_apy":{"description":"Base LP APY the MetaVault targets (%), e.g. 12 for 12%","type":"number"},"borrow_rate":{"default":5,"description":"Morpho borrow rate in % APY (default 5%)","type":"number"},"capital_usd":{"description":"Curator's own capital in USD. Enables curator economics section.","exclusiveMinimum":0,"type":"number"},"compare_pt_apy":{"description":"If provided, show side-by-side comparison with raw PT looping at this APY (%)","type":"number"},"curator_fee_pct":{"default":10,"description":"Performance fee the curator EARNS as % of vault yield (default 10%). E.g. 10 means curator collects 10% of gross yield as revenue, depositors receive the remaining 90%.","maximum":100,"minimum":0,"type":"number"},"days_to_maturity":{"default":90,"description":"Average pool cycle length in days (default 90). Used for rollover advantage.","exclusiveMinimum":0,"type":"number"},"external_deposits_usd":{"default":0,"description":"External deposits the curator attracts (USD). The curator earns performance fees on these deposits. Default 0.","minimum":0,"type":"number"},"max_loops":{"default":5,"description":"Maximum leverage loops to model (default 5)","maximum":20,"minimum":1,"type":"number"},"morpho_ltv":{"default":0.86,"description":"Morpho LTV for MetaVault share collateral (0-1, default 0.86 = 86%)","exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"},"yt_compounding_apy":{"default":0,"description":"Additional yield from YT→LP compounding (%), e.g. 3 for 3%. Default 0.","type":"number"}},"required":["base_apy"],"type":"object"},"name":"model_metavault_strategy"},{"description":"Get essential Spectra protocol mechanics needed for correct reasoning.\nReturns concise explanations of how PT/YT work, how Router batching affects\npool activity interpretation, how to read wallet strategies from holdings,\nand how looping works.\n\nCovers mechanics that are easy to misinterpret without context — for example,\nSELL_PT in pool activity could be a flash-mint to acquire YT, not a PT sale.\n\nAvailable topics: pt_yt_mechanics, router_batching, position_analysis, looping, networks\nOmit the topic parameter to get all topics at once.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"topic":{"description":"Specific topic to retrieve. Options: pt_yt_mechanics, router_batching, position_analysis, looping, networks. Omit for all.","enum":["pt_yt_mechanics","router_batching","position_analysis","looping","networks"],"type":"string"}},"type":"object"},"name":"get_protocol_context"}]}}}
