@continuumdao/ctm-mpc-defi 0.2.42 → 0.2.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -86,7 +86,7 @@ Skip emissions when `claimEmissions` is `null` (no gauge). Slipstream unstaked f
86
86
 
87
87
  Loaded from official GitHub (`velodrome-finance/sugar` `deployments/base.env` and `aerodrome-finance/docs` security.mdx) with baked fallbacks. Do not invent addresses.
88
88
 
89
- Coinbase B20 stocks (AAPLc, NVDAc, METAc, GOOGLc, SPCXc, …) trade on **Slipstream 3** (`clFactory3`) vs USDC. New official names are picked up from the [Base tokenized-stocks docs](https://docs.base.org/base-chain/asset-issuance/tokenized-stocks-on-base) and from Sugar tokens whose address uses the B20 ASSET prefix `0xb200…`. The docs fetch is optional: if that page is gone or unusable, discovery continues from the seed list + Sugar. `issued` is live `totalSupply() > 0` — do not hard-code unissued tickers. Quotes use factory `getPool` discovery + MixedRouteQuoterV3 (path bitmasks). Sugar `forSwaps` alone misses these pools. Native ETH → stock is typically WETH → USDC → stock.
89
+ Coinbase B20 stocks (AAPLc, NVDAc, METAc, GOOGLc, SPCXc, …) trade on **Slipstream 3** (`clFactory3`) vs USDC. Stock-backed **loans** (lend/borrow USDC against B20 collateral) are Morpho — `load_defi_protocol morpho` and `ctm_morpho_fetch_stock_markets`, not Aerodrome LP. New official names are picked up from the [Base tokenized-stocks docs](https://docs.base.org/base-chain/asset-issuance/tokenized-stocks-on-base) and from Sugar tokens whose address uses the B20 ASSET prefix `0xb200…`. The docs fetch is optional: if that page is gone or unusable, discovery continues from the seed list + Sugar. `issued` is live `totalSupply() > 0` — do not hard-code unissued tickers. Quotes use factory `getPool` discovery + MixedRouteQuoterV3 (path bitmasks). Sugar `forSwaps` alone misses these pools. Native ETH → stock is typically WETH → USDC → stock.
90
90
 
91
91
  ## Out of scope
92
92
 
@@ -33,7 +33,7 @@ Withdraw: `ctm_arcus_build_withdraw_multisign` with `product: perp|spot` (EIP-71
33
33
 
34
34
  ## USDG yield (Robinhood Earn — not Arcus)
35
35
 
36
- **Arcus deposit does not earn yield** — it moves USDG into perp/spot trading collateral. For **Robinhood Earn** (~variable APY on USDG via Morpho on chain 4663), use **`load_defi_protocol morpho`** and `ctm_morpho_build_vault_deposit_multisign` with `robinhoodEarn: true` or fetch `query: "robinhood earn"`. See morpho SKILL § Robinhood Earn.
36
+ **Arcus deposit does not earn yield** — it moves USDG into perp/spot trading collateral. For **Robinhood Earn** (~variable APY on USDG via Morpho on chain 4663), use **`load_defi_protocol morpho`** and `ctm_morpho_build_vault_deposit_multisign` with `robinhoodEarn: true` or fetch `query: "robinhood earn"`. See morpho SKILL § Robinhood Earn. Coinbase B20 **stock-backed loans** (USDC against AAPLc on Base) are also Morpho (`ctm_morpho_fetch_stock_markets`), not Arcus trading.
37
37
 
38
38
  ## Perp leverage
39
39
 
@@ -1,6 +1,6 @@
1
1
  # Morpho
2
2
 
3
- Morpho integration: **listed earn vaults** (V1 + V2, unified), **Blue** variable-rate borrow, **Midnight** fixed-rate/fixed-term books, and **Merkl** rewards.
3
+ Morpho integration: **listed earn vaults** (V1 + V2, unified), **Blue** variable-rate supply/borrow, **Midnight** fixed-rate/fixed-term books, **Coinbase B20 stock-backed loans** on Base, and **Merkl** rewards.
4
4
 
5
5
  ## Data
6
6
 
@@ -23,7 +23,7 @@ Morpho integration: **listed earn vaults** (V1 + V2, unified), **Blue** variable
23
23
  `underlying` accepts **symbol** (e.g. `USDC`, `WETH`) or **ERC-20 address**.
24
24
  `query` is **case-insensitive** on vault name, symbol, address, and underlying symbol.
25
25
 
26
- Use returned `vaultAddress` and `underlyingAddress` for deposit multisign. Each row includes `totalDepositsUsd`, `liquidityUsd`, `netApy` / `netApy7d` / `netApy30d` / `netApy90d`, `performanceFee`, `rewards[]` (extra incentive APR from Morpho `allRewards`), and `exposure[]` (allocated markets/strategies with % of TVL). Blue rows also include `netSupplyApyLabel` and `rewards[]`. Incentive APR is extra and variable.
26
+ Use returned `vaultAddress` and `underlyingAddress` for deposit multisign. Each row includes `totalDepositsUsd`, `liquidityUsd`, `netApy` / `netApy7d` / `netApy30d` / `netApy90d`, `performanceFee`, `rewards[]` (extra incentive APR from Morpho `allRewards`), and `exposure[]` (allocated markets/strategies with % of TVL). Blue rows include `netSupplyApyLabel`, `lltvLabel`, TVL, `utilizationLabel`, and `rewards[]`. Incentive APR is extra and variable — do not add `rewards[]` on top of `netApy` / `netSupplyApy` a second time.
27
27
 
28
28
  ## Arc (Circle, USDC-native gas)
29
29
 
@@ -75,6 +75,28 @@ Aliases `robinhood earn`, `robinhood`, and `steakhouse usdg` resolve to the Stea
75
75
 
76
76
  Do **not** use `ctm_arcus_build_deposit_multisign` for yield — that funds perp/spot margin, not Morpho lending.
77
77
 
78
+ ## Stock-backed loans (Base)
79
+
80
+ Curators deployed isolated **Blue** (variable) and **Midnight** (fixed) markets on **Base (8453)** that take **Coinbase B20 tokenized stocks** as collateral and lend **USDC**. Morpho is the credit layer — not Aerodrome swap/LP, not Hyperliquid/Arcus trading, not Robinhood Earn (USDG on 4663).
81
+
82
+ | Goal | Tool |
83
+ |------|------|
84
+ | List stock-collateral books | `ctm_morpho_fetch_stock_markets({ chainId: 8453 })` or omit chainId (defaults to Base) |
85
+ | One ticker | `ctm_morpho_fetch_stock_markets({ collateral: "AAPLc" })` |
86
+ | Variable only / fixed only | `rate: "variable"` or `rate: "fixed"` |
87
+ | Blue by ticker | `ctm_morpho_fetch_blue_markets({ chainId: 8453, collateral: "AAPLc" })` |
88
+ | Blue USDC loan books | `ctm_morpho_fetch_blue_markets({ chainId: 8453, loan: "USDC" })` |
89
+ | All B20 Blue | `ctm_morpho_fetch_blue_markets({ chainId: 8453, query: "stock" })` |
90
+
91
+ Tickers (`AAPLc`, `NVDAc`, `METAc`, `GOOGLc`, `SPCXc`, …) are enough — do **not** ask the user for a 0x address. Pick a `marketId` and `lltvLabel` (same stock can have 62.5% and 77% markets). Then:
92
+
93
+ - **Borrow USDC against stock:** `ctm_morpho_build_blue_collateral_deposit_multisign` then `ctm_morpho_build_blue_borrow_multisign` (or Midnight borrow).
94
+ - **Lend USDC (variable):** `ctm_morpho_build_blue_supply_multisign` — withdraw with `ctm_morpho_build_blue_withdraw_multisign`.
95
+ - **Lend/borrow fixed:** Midnight tools with `marketId` from the stock fetch `books[]`.
96
+ - **Positions:** `ctm_morpho_fetch_positions` (vault + Blue supply/borrow/collateral). Midnight stays on `ctm_morpho_fetch_midnight_positions`.
97
+
98
+ Compliance (notes only — no KYC in these tools): Coinbase B20 is Regulation S / **not for U.S. persons**. Chainlink equity feeds are **24/5** and hold last close off cash hours — do not treat a weekend `updatedAt` as a live mark. Liquidity is still thin.
99
+
78
100
  ## Morpho Midnight (fixed rate / fixed term)
79
101
 
80
102
  Midnight is a separate order-book primitive (not Blue). Users can **take** existing offers via MidnightBundles, or **post a lend offer** that parks the loan token in Morpho Blue (variable yield) until a borrower fills it. Launch liquidity is strongest on **Base (8453)** (e.g. cbBTC/USDC maturities).
@@ -108,7 +130,9 @@ Server re-quotes at build time and fills `taker` / `maker` / `onBehalf` from the
108
130
  | Tool | Action |
109
131
  |------|--------|
110
132
  | `ctm_morpho_fetch_earn_vaults` | List/search Morpho-listed earn vaults |
111
- | `ctm_morpho_fetch_blue_markets` | List Blue markets |
133
+ | `ctm_morpho_fetch_blue_markets` | List Blue markets (tickers OK; `query: "stock"` = B20 collateral) |
134
+ | `ctm_morpho_fetch_stock_markets` | Base B20 stock-backed Blue + Midnight |
135
+ | `ctm_morpho_fetch_positions` | Vault + Blue supply/borrow/collateral positions |
112
136
  | `ctm_morpho_fetch_midnight_books` | List Midnight books |
113
137
  | `ctm_morpho_fetch_midnight_quote` | Quote Midnight fill |
114
138
  | `ctm_morpho_fetch_midnight_positions` | Midnight positions |
@@ -116,6 +140,8 @@ Server re-quotes at build time and fills `taker` / `maker` / `onBehalf` from the
116
140
  | `ctm_morpho_build_vault_deposit_multisign` | Vault deposit (listed V1 or V2) |
117
141
  | `ctm_morpho_build_vault_withdraw_multisign` | Vault withdraw |
118
142
  | `ctm_morpho_build_blue_collateral_deposit_multisign` | Blue supplyCollateral |
143
+ | `ctm_morpho_build_blue_supply_multisign` | Blue supply (lend loan token) |
144
+ | `ctm_morpho_build_blue_withdraw_multisign` | Blue withdraw supplied loan token |
119
145
  | `ctm_morpho_build_blue_borrow_multisign` | Blue borrow |
120
146
  | `ctm_morpho_build_blue_repay_multisign` | Blue repay |
121
147
  | `ctm_morpho_build_blue_collateral_withdraw_multisign` | Blue withdrawCollateral |
@@ -134,8 +160,9 @@ Pass `marketId` from Morpho API for Blue/Midnight tools (not recomputed on-chain
134
160
  1. `get_preferred_key_gen` → note `keyGenId` (or use the conversation KeyGen id).
135
161
  2. `ctm_morpho_fetch_earn_vaults` — pick `vaultAddress` and `underlyingAddress` by asset and/or name.
136
162
  3. `ctm_morpho_build_vault_deposit_multisign` — use each tool’s **input schema** (`keyGenId`, fetch output addresses, `amountHuman`, etc.). Server resolves `keyGen`, `executorAddress`, `rpcUrl`, `chainDetail`; agents must not pass those.
137
- 4. Blue borrow/collateral: `marketId` from Morpho API; server resolves `marketParams`.
138
- 5. Midnight: books quote lend now, lend offer (earn until filled), borrow, or cancel/repay as above.
163
+ 4. Blue: `marketId` from fetch; server resolves `marketParams`. Collateral + borrow, or supply/withdraw loan token (USDC).
164
+ 5. Stock-backed on Base: `ctm_morpho_fetch_stock_markets` then the same Blue/Midnight build tools.
165
+ 6. Midnight: books → quote → lend now, lend offer (earn until filled), borrow, or cancel/repay as above.
139
166
 
140
167
  ## Troubleshooting
141
168
 
@@ -13,7 +13,9 @@ Do **not** web-search rates. Do **not** use DefiLlama. HIP-3 / Arcus stock tradi
13
13
 
14
14
  If the operator started **Best yield** / plan mode `yield`: this thread **authors the plan file**. Ask for the asset first. Then `get_defi_protocol_skill({ protocolId: "yield-compare" })` **once** and write workstreams — do **not** `load_defi_protocol`, search Continuum tools, or spawn specialists on the parent. Execute runs one specialist per listed protocol. Research-only — no `ctm_*_build_*_multisign`. Table categories: `idle` / `lp` / `vault` / `perp_funding`. GMX and Hyperliquid only if they asked. Catalog MCP is context only.
15
15
 
16
- Each Execute protocol leaf must list `toolGroups: ["defi_discovery", "defi:<protocol>:market-data", "keygen", "keygen_messaging"]` (canonical ids: `aave-v4`, `compound-v3`, `euler-v2`, `morpho`, `maple-syrup`, `curve-dao`, `aerodrome`, `pendle`) and `budget: { maxRounds: 16, maxWallClockMs: 240000 }`. Slim leaves cannot search/activate packs without `defi_discovery` they never see `load_defi_protocol` or official `ctm_*` fetch tools. Do **not** use `agent_bash` / `agent_read_file` / `agent_grep` on a yield leaf — call the official fetch (`ctm_aave_v4_fetch_markets`, `ctm_compound_v3_fetch_markets`, `ctm_aerodrome_fetch_lp_yields` on Base `8453`, `ctm_pendle_fetch_markets` / `ctm_pendle_search_assets`, …) then post `mpc-task-result`. Ticker filters (`underlying: "USDT"`) are valid on Aave/Maple/Morpho fetches do not invent ERC-20 addresses. Aave v4 is Ethereum-first (`1`; also 10 / 43114). Maple is Ethereum (`1`). Aerodrome is Base (`8453`) only. Pendle is any Core `chainId` ∩ node registry — research-only fetch, no build.
16
+ For **USDC / USDT**, the authored plan notes **must** mention Morpho stock-backed USDC loans as an **optional extra** (isolated Blue/Midnight books against Coinbase B20 collateral such as AAPLc/NVDAc; thin liquidity; 24/5 oracles; Regulation S / non-US). Do **not** add a Morpho stock Execute workstream or call `ctm_morpho_fetch_stock_markets` unless the operator says yes or already asked about stocks / tokenized stocks / stock-backed loans.
17
+
18
+ Each Execute protocol leaf must list `toolGroups: ["defi_discovery", "defi:<protocol>:market-data", "keygen", "keygen_messaging"]` (canonical ids: `aave-v4`, `compound-v3`, `euler-v2`, `morpho`, `maple-syrup`, `curve-dao`, `aerodrome`, `pendle`) and `budget: { maxRounds: 16, maxWallClockMs: 240000 }`. Slim leaves cannot search/activate packs — without `defi_discovery` they never see `load_defi_protocol` or official `ctm_*` fetch tools. Do **not** use `agent_bash` / `agent_read_file` / `agent_grep` on a yield leaf — call the official fetch (`ctm_aave_v4_fetch_markets`, `ctm_compound_v3_fetch_markets`, `ctm_morpho_fetch_earn_vaults`, `ctm_morpho_fetch_blue_markets` with `loan: "USDC"` / `"USDT"`, `ctm_aerodrome_fetch_lp_yields` on Base `8453`, `ctm_pendle_fetch_markets` / `ctm_pendle_search_assets`, …) then post `mpc-task-result`. Ticker filters (`underlying: "USDT"`, Morpho `loan: "USDC"`) are valid on Aave/Maple/Morpho fetches — do not invent ERC-20 addresses. Morpho leaf: report vault `netApy` and Blue `netSupplyApyLabel`; footnote `rewards[]` as variable extras — do not add them on top of net APY a second time. Skip empty Blue books (no supply TVL). `ctm_morpho_fetch_stock_markets` only after the operator says yes. Aave v4 is Ethereum-first (`1`; also 10 / 43114). Maple is Ethereum (`1`). Aerodrome is Base (`8453`) only. Pendle is any Core `chainId` ∩ node registry — research-only fetch, no build.
17
19
 
18
20
  ## Units and caveats
19
21
 
@@ -45,10 +47,11 @@ Call `get_defi_protocol_skill({ protocolId: "yield-compare" })` for this map, th
45
47
 
46
48
  ### USDC / USDT
47
49
 
48
- 1. Aave / Compound / Euler lend / Morpho earn / Maple (`ctm_maple_fetch_markets`)
50
+ 1. Aave / Compound / Euler lend / Morpho earn (`ctm_morpho_fetch_earn_vaults`) / Morpho Blue loan markets (`ctm_morpho_fetch_blue_markets({ loan: "USDC" })`) / Maple (`ctm_maple_fetch_markets`). Morpho: rank on `netApy` / `netSupplyApyLabel`; footnote `rewards[]` as variable extras.
49
51
  2. `ctm_aerodrome_fetch_lp_yields` (Base) and `ctm_curve_dao_fetch_lp_yields` if they want DEX LP
50
52
  3. `ctm_pendle_fetch_markets` — optional PT / YT / LP implied APY if they asked about Pendle (research-only)
51
53
  4. `ctm_gmx_fetch_gm_apy` / `ctm_hyperliquid_fetch_vault_apys` / perp funding — **only if they asked** about GMX, HL vaults, or funding
54
+ 5. Morpho stock-backed USDC loans — **optional extra in plan notes only**. Call `ctm_morpho_fetch_stock_markets` only if they say yes.
52
55
 
53
56
  ### USDS
54
57
 
@@ -73,6 +76,7 @@ Aave / Morpho / Euler / `ctm_curve_dao_fetch_lp_yields`
73
76
 
74
77
  - Main-pair LP only: Aerodrome `fetch_lp_yields`, Curve `fetch_lp_yields` (~100 each). Optional Pendle LP implied APY via `ctm_pendle_fetch_markets` (research-only).
75
78
  - Stock LP: `ctm_aerodrome_fetch_stock_lp_yields` (B20) **only if the user asked about stocks**.
79
+ - Morpho stock-backed loans: `ctm_morpho_fetch_stock_markets` **only after they say yes** (or already asked about stocks / stock-backed loans). Isolated equity credit, not idle stables. Always mention as an optional extra in USDC/USDT Best Yield plan notes.
76
80
  - Hyperliquid HIP-3: `ctm_hyperliquid_fetch_stock_markets` is **trading**, not idle savings. Include HIP-3 **funding** only if they asked about stocks.
77
81
 
78
82
  ## Euler earn vs isolated lend