@continuumdao/ctm-mpc-defi 0.2.43 → 0.2.45
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.
- package/dist/agent/catalog.cjs +276 -11
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.d.ts +780 -9
- package/dist/agent/catalog.js +268 -12
- package/dist/agent/catalog.js.map +1 -1
- package/dist/agent/skills/aave-v4/SKILL.md +9 -1
- package/dist/agent/skills/euler-v2/SKILL.md +9 -0
- package/dist/agent/skills/hyperliquid/SKILL.md +32 -2
- package/dist/agent/skills/morpho/SKILL.md +8 -2
- package/dist/agent/skills/yield-compare/SKILL.md +4 -1
- package/dist/merklDistributor-CdqtZC9N.d.ts +65 -0
- package/dist/multisign-Dr0j9fHm.d.ts +489 -0
- package/dist/protocols/evm/aave-v4/index.cjs +207 -2
- package/dist/protocols/evm/aave-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/aave-v4/index.d.ts +12 -467
- package/dist/protocols/evm/aave-v4/index.js +192 -3
- package/dist/protocols/evm/aave-v4/index.js.map +1 -1
- package/dist/protocols/evm/euler-v2/index.cjs +209 -1
- package/dist/protocols/evm/euler-v2/index.cjs.map +1 -1
- package/dist/protocols/evm/euler-v2/index.d.ts +9 -1
- package/dist/protocols/evm/euler-v2/index.js +208 -2
- package/dist/protocols/evm/euler-v2/index.js.map +1 -1
- package/dist/protocols/evm/hyperliquid/index.cjs +320 -0
- package/dist/protocols/evm/hyperliquid/index.cjs.map +1 -1
- package/dist/protocols/evm/hyperliquid/index.d.ts +153 -1
- package/dist/protocols/evm/hyperliquid/index.js +303 -1
- package/dist/protocols/evm/hyperliquid/index.js.map +1 -1
- package/dist/protocols/evm/morpho/index.cjs +169 -1
- package/dist/protocols/evm/morpho/index.cjs.map +1 -1
- package/dist/protocols/evm/morpho/index.d.ts +9 -1
- package/dist/protocols/evm/morpho/index.js +155 -2
- package/dist/protocols/evm/morpho/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -38,6 +38,8 @@ Do **not** web-search Aave APRs, APYs, or reserves. Load the protocol and use th
|
|
|
38
38
|
| Withdraw supplied balance | `ctm_aave_v4_build_withdraw_multisign` |
|
|
39
39
|
| Borrow against collateral | `ctm_aave_v4_build_borrow_multisign` |
|
|
40
40
|
| Repay debt | `ctm_aave_v4_build_repay_multisign` |
|
|
41
|
+
| List wallet-wide Merkl claimables | `ctm_aave_v4_fetch_merkl_rewards` |
|
|
42
|
+
| Claim Merkl rewards | `ctm_aave_v4_build_merkl_claim_multisign` |
|
|
41
43
|
|
|
42
44
|
## Common write inputs
|
|
43
45
|
|
|
@@ -103,6 +105,12 @@ Example: “How do Aave lending APRs compare to Compound on Ethereum?”
|
|
|
103
105
|
2. **Borrow debt asset:** `ctm_aave_v4_build_borrow_multisign` with `underlying` = debt token (USDC), `amountHuman`, optional `collateralUnderlying` = collateral address.
|
|
104
106
|
3. Explain: health factor must stay above liquidation thresholds; server may refuse or ask for risk acknowledgment.
|
|
105
107
|
|
|
108
|
+
### Claim Merkl rewards
|
|
109
|
+
|
|
110
|
+
1. Activate `defi:aave-v4:rewards` (or alias `aave:rewards`) after `load_defi_protocol aave-v4`.
|
|
111
|
+
2. `ctm_aave_v4_fetch_merkl_rewards({ keyGenId, chainId })`.
|
|
112
|
+
3. If `firstRootClaimableCount` > 0: `ctm_aave_v4_build_merkl_claim_multisign({ keyGenId, chainId })`. Repeat when `additionalRoots` > 0.
|
|
113
|
+
|
|
106
114
|
### Repay and withdraw
|
|
107
115
|
|
|
108
116
|
1. **Repay:** reduce debt with repay tool (`underlying` = debt token).
|
|
@@ -154,4 +162,4 @@ After stETH is supplied:
|
|
|
154
162
|
|
|
155
163
|
- Native supply uses wrapped native from `get_defi_protocol_supported_tokens` (`nativeWrapped`).
|
|
156
164
|
- Token filter: `api_underlyings` — only API-listed underlyings are valid per chain.
|
|
157
|
-
- Merkl
|
|
165
|
+
- Wallet-wide Merkl: `ctm_aave_v4_fetch_merkl_rewards` then `ctm_aave_v4_build_merkl_claim_multisign({ keyGenId, chainId })`. Not Aave-only — other venues’ campaigns on the same distributor can appear. Server fetches proofs; do not invent `claimData`. Call again if `additionalRoots` > 0. rEUL is omitted (Euler unlock). Advanced Aave position actions besides this claim stay in the node app UI.
|
|
@@ -8,3 +8,12 @@ description: Euler v2 isolated lend/borrow, vault withdraw, and collateral opera
|
|
|
8
8
|
Supported chains from `get_defi_protocol_supported_chains` (Euler V3 API, Goldsky `euler-simple-*` fallback). Underlyings from `get_defi_protocol_supported_tokens` (V3 EVK / Earn vaults). Isolated lend: `ctm_euler_v2_fetch_lend_vaults`. Earn vaults (curated APY): `ctm_euler_v2_fetch_earn_vaults`. Do **not** web-search Euler APYs. Copy `evaultAddress` onto build tools.
|
|
9
9
|
|
|
10
10
|
Tools include isolated lend/borrow, collateral deposit/withdraw, vault withdraw, borrow repay. All `ctm_euler_v2_build_*_multisign` tools return `{ requestId }` on success (shared gas/submit section appended by the server).
|
|
11
|
+
|
|
12
|
+
## Merkl rewards
|
|
13
|
+
|
|
14
|
+
Activate **`defi:euler-v2:rewards`** (alias `euler:rewards` / `euler-v2:rewards`) after `load_defi_protocol euler-v2`.
|
|
15
|
+
|
|
16
|
+
1. `ctm_euler_v2_fetch_merkl_rewards({ keyGenId, chainId })` — wallet-wide on that chain, not Euler-only.
|
|
17
|
+
2. If `firstRootClaimableCount` > 0: `ctm_euler_v2_build_merkl_claim_multisign({ keyGenId, chainId })`. Server fetches proofs. Do not invent `claimData`. Repeat when `additionalRoots` > 0.
|
|
18
|
+
|
|
19
|
+
rEUL is omitted (`skippedReulCount`). Unlock vested EUL in the node app Euler Rewards tab — there is no MCP unlock tool.
|
|
@@ -22,8 +22,9 @@ The MPC **executor address** (`keyGen.ethereumaddress`) is the Hyperliquid **use
|
|
|
22
22
|
- **Spot ↔ Perp:** USDC is one asset split between **spot** and **perp margin** ledgers (not separate ERC20s). Move with `usdClassTransfer`.
|
|
23
23
|
- **Vaults:** Deposit/withdraw USD into protocol vaults (withdraw includes accrued PnL).
|
|
24
24
|
- **Staking:** Stake/unstake **HYPE** and delegate to validators.
|
|
25
|
+
- **Borrow / lend:** Manual HyperCore money market. Collateralize **HYPE** / **UBTC**; borrow or supply quote assets (**USDC**, **USDT0**, **USDH**). Current **supply APR** and **borrow APR** come from `ctm_hyperliquid_fetch_lend_markets`.
|
|
25
26
|
|
|
26
|
-
Trading reads use Hyperliquid **REST `/info`**.
|
|
27
|
+
Trading reads use Hyperliquid **REST `/info`**. Most writes use **CoreWriter** on HyperEVM. Leverage, bridge withdraw, TP/SL brackets, and **borrow/lend** use signed **L1 `/exchange`** (EIP-712).
|
|
27
28
|
|
|
28
29
|
## Getting started (funding)
|
|
29
30
|
|
|
@@ -45,7 +46,7 @@ Positions and orders from MCP reflect **live HyperCore state** after prior txs a
|
|
|
45
46
|
5. `ctm_hyperliquid_fetch_market_snapshot({ chainId, coin: "AAPL" })` — **`livePrice.midUsd`** is the current price; **`funding`** is official hourly HyperCore funding; `latestCandle` is the most recent bar; `candles` is capped (default 48). Throws if live price cannot be fetched.
|
|
46
47
|
6. `ctm_hyperliquid_fetch_open_context({ chainId, executorAddress, coin: "Apple" })` — same resolution
|
|
47
48
|
7. `ctm_hyperliquid_fetch_usd_class_balances({ chainId, executorAddress })` — spot vs perp USD if needed
|
|
48
|
-
8. **Gas** — `get_multi_sign_gas_options({ chainId })` + `useCustomGas` for **CoreWriter** tools only (plain limit, close, cancel, transfers, vault, stake). **Skip gas** for `build_update_leverage_multisign`, `build_bridge_withdraw_multisign`, and limit orders **with TP/SL triggers** (EIP-712 `/exchange`).
|
|
49
|
+
8. **Gas** — `get_multi_sign_gas_options({ chainId })` + `useCustomGas` for **CoreWriter** tools only (plain limit, close, cancel, transfers, vault, stake). **Skip gas** for `build_update_leverage_multisign`, `build_bridge_withdraw_multisign`, `build_lend_multisign`, and limit orders **with TP/SL triggers** (EIP-712 `/exchange`).
|
|
49
50
|
9. `ctm_hyperliquid_build_limit_order_multisign` → **`{ requestId }`**
|
|
50
51
|
10. Base MPC lifecycle (shared gas/submit section below)
|
|
51
52
|
|
|
@@ -69,6 +70,8 @@ Positions and orders from MCP reflect **live HyperCore state** after prior txs a
|
|
|
69
70
|
| User vault equity | `ctm_hyperliquid_fetch_user_vault_equities` |
|
|
70
71
|
| HYPE stake summary | `ctm_hyperliquid_fetch_staking_summary` |
|
|
71
72
|
| Validator delegations | `ctm_hyperliquid_fetch_delegations` |
|
|
73
|
+
| Core lend markets + **current supply/borrow APR** | `ctm_hyperliquid_fetch_lend_markets` — activate `hyperliquid:lend` |
|
|
74
|
+
| Core lend positions + health + manual-borrow gate | `ctm_hyperliquid_fetch_lend_positions` |
|
|
72
75
|
|
|
73
76
|
### Multi-sign (writes)
|
|
74
77
|
|
|
@@ -87,6 +90,7 @@ Positions and orders from MCP reflect **live HyperCore state** after prior txs a
|
|
|
87
90
|
| Delegate to validator | `ctm_hyperliquid_build_delegate_multisign` |
|
|
88
91
|
| Undelegate | `ctm_hyperliquid_build_undelegate_multisign` |
|
|
89
92
|
| Update per-market leverage | `ctm_hyperliquid_build_update_leverage_multisign` (EIP-712 — no gas) |
|
|
93
|
+
| Supply / withdraw / borrow / repay | `ctm_hyperliquid_build_lend_multisign` (EIP-712 — no gas) |
|
|
90
94
|
|
|
91
95
|
### EIP-712 vs CoreWriter (critical for agents)
|
|
92
96
|
|
|
@@ -95,6 +99,7 @@ Positions and orders from MCP reflect **live HyperCore state** after prior txs a
|
|
|
95
99
|
| Plain limit / close / cancel / USD transfer / vault / stake | CoreWriter EVM tx | **Yes** — `get_multi_sign_gas_options`, pass `useCustomGas` |
|
|
96
100
|
| `build_update_leverage_multisign` | EIP-712 → `/exchange` | **No** — trigger without txParams |
|
|
97
101
|
| `build_bridge_withdraw_multisign` | EIP-712 → `/exchange` | **No** |
|
|
102
|
+
| `build_lend_multisign` | EIP-712 → `/exchange` | **No** — trigger without txParams |
|
|
98
103
|
| Limit with `takeProfitTriggerPxHuman` and/or `stopLossTriggerPxHuman` | EIP-712 normalTpsl → `/exchange` | **No** — re-build if entry/TP/SL change |
|
|
99
104
|
|
|
100
105
|
## Common multisign inputs (all `build_*` tools)
|
|
@@ -203,6 +208,31 @@ Use `isLong: true` for a **long** position (submits sell reduce-only IoC):
|
|
|
203
208
|
|
|
204
209
|
Check balances first with `ctm_hyperliquid_fetch_usd_class_balances`.
|
|
205
210
|
|
|
211
|
+
## Borrow / lend (HyperCore)
|
|
212
|
+
|
|
213
|
+
Activate **`hyperliquid:lend`** (`activate_tool_group`). Do not fold this into vaults or perp market-data.
|
|
214
|
+
|
|
215
|
+
1. `ctm_hyperliquid_fetch_lend_markets` — current **`supplyYearlyRate` / `borrowYearlyRate`** are **APR** (decimal; `0.05` = 5%). Also `supplyAprPercent` / `borrowAprPercent`. `role` is `collateral` (LTV > 0) or `quote`.
|
|
216
|
+
2. `ctm_hyperliquid_fetch_lend_positions` — supplied/borrowed, `health`, `manualBorrowEnabled`. If `userAbstraction` is `portfolioMargin`, **do not** call `operation: "borrow"`.
|
|
217
|
+
3. `ctm_hyperliquid_build_lend_multisign` with `operation`: `supply` | `withdraw` | `borrow` | `repay`.
|
|
218
|
+
|
|
219
|
+
Rules:
|
|
220
|
+
|
|
221
|
+
- **HYPE / UBTC** (`BTC` aliases to UBTC) supplied as collateral **do not earn interest**.
|
|
222
|
+
- **USDC / USDT0** (`USDT` aliases to USDT0) / **USDH** supplied earn utilization APR but **do not increase borrow capacity**.
|
|
223
|
+
- `amountMax: true` (or `amountHuman: "max"`) sends wire `amount: null` — full withdraw/repay.
|
|
224
|
+
- EIP-712 `/exchange` — **no `useCustomGas`**, trigger without txParams.
|
|
225
|
+
|
|
226
|
+
```json
|
|
227
|
+
{
|
|
228
|
+
"chainId": 999,
|
|
229
|
+
"purposeText": "HL supply 100 USDC",
|
|
230
|
+
"coin": "USDC",
|
|
231
|
+
"operation": "supply",
|
|
232
|
+
"amountHuman": "100"
|
|
233
|
+
}
|
|
234
|
+
```
|
|
235
|
+
|
|
206
236
|
## Vault / stake
|
|
207
237
|
|
|
208
238
|
- **Vault deposit/withdraw:** `vaultAddress` from `fetch_vaults`; `usdHuman` amount. Mainnet vault catalog fetch can take ~10–15s (large stats feed). Testnet catalog is empty.
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Morpho
|
|
2
2
|
|
|
3
|
-
Morpho integration: **listed earn vaults** (V1 + V2, unified), **
|
|
3
|
+
Morpho integration: **listed earn vaults** (V1 + V2, unified), **Lend** (Blue USDC supply + Midnight lend/offers + stock-backed books), **Blue borrow** (collateral/borrow/repay), **Midnight borrow**, **Coinbase B20 stock-backed loans** on Base, and **Merkl** rewards.
|
|
4
|
+
|
|
5
|
+
Tool families after `load_defi_protocol morpho` (then `activate_tool_group` / search): `defi:morpho:vault` (Earn), `defi:morpho:lend` (lend USDC / stock-backed supply), `defi:morpho:blue` (borrow against collateral), `defi:morpho:midnight` (fixed-rate borrow), `defi:morpho:rewards`. Alias `morpho:lend` → `defi:morpho:lend`.
|
|
4
6
|
|
|
5
7
|
## Data
|
|
6
8
|
|
|
@@ -77,6 +79,8 @@ Do **not** use `ctm_arcus_build_deposit_multisign` for yield — that funds perp
|
|
|
77
79
|
|
|
78
80
|
## Stock-backed loans (Base)
|
|
79
81
|
|
|
82
|
+
Activate **`defi:morpho:lend`** (alias `morpho:lend`) for stock-market reads plus Blue supply and Midnight lend. Borrow against stock stays on `defi:morpho:blue` / `defi:morpho:midnight`.
|
|
83
|
+
|
|
80
84
|
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
85
|
|
|
82
86
|
| Goal | Tool |
|
|
@@ -137,6 +141,7 @@ Server re-quotes at build time and fills `taker` / `maker` / `onBehalf` from the
|
|
|
137
141
|
| `ctm_morpho_fetch_midnight_quote` | Quote Midnight fill |
|
|
138
142
|
| `ctm_morpho_fetch_midnight_positions` | Midnight positions |
|
|
139
143
|
| `ctm_morpho_fetch_midnight_offers` | Open Midnight lend offers |
|
|
144
|
+
| `ctm_morpho_fetch_merkl_rewards` | Wallet-wide Merkl claimables (`keyGenId` or `user` + `chainId`) |
|
|
140
145
|
| `ctm_morpho_build_vault_deposit_multisign` | Vault deposit (listed V1 or V2) |
|
|
141
146
|
| `ctm_morpho_build_vault_withdraw_multisign` | Vault withdraw |
|
|
142
147
|
| `ctm_morpho_build_blue_collateral_deposit_multisign` | Blue supplyCollateral |
|
|
@@ -150,7 +155,7 @@ Server re-quotes at build time and fills `taker` / `maker` / `onBehalf` from the
|
|
|
150
155
|
| `ctm_morpho_build_midnight_cancel_lend_offer_multisign` | Cancel Midnight lend offer |
|
|
151
156
|
| `ctm_morpho_build_midnight_borrow_multisign` | Midnight borrow |
|
|
152
157
|
| `ctm_morpho_build_midnight_repay_multisign` | Midnight repay + withdraw |
|
|
153
|
-
| `ctm_morpho_build_merkl_claim_multisign` | Merkl claim |
|
|
158
|
+
| `ctm_morpho_build_merkl_claim_multisign` | Wallet-wide Merkl claim (`keyGenId` + `chainId`; server fetches proofs) |
|
|
154
159
|
|
|
155
160
|
Pass `marketId` from Morpho API for Blue/Midnight tools (not recomputed on-chain).
|
|
156
161
|
**Deposits** require a **Morpho-listed** vault (`ctm_morpho_fetch_earn_vaults`). Unlisted/test vaults are rejected.
|
|
@@ -163,6 +168,7 @@ Pass `marketId` from Morpho API for Blue/Midnight tools (not recomputed on-chain
|
|
|
163
168
|
4. Blue: `marketId` from fetch; server resolves `marketParams`. Collateral + borrow, or supply/withdraw loan token (USDC).
|
|
164
169
|
5. Stock-backed on Base: `ctm_morpho_fetch_stock_markets` then the same Blue/Midnight build tools.
|
|
165
170
|
6. Midnight: books → quote → lend now, lend offer (earn until filled), borrow, or cancel/repay as above.
|
|
171
|
+
7. Merkl: `ctm_morpho_fetch_merkl_rewards` then `ctm_morpho_build_merkl_claim_multisign({ keyGenId, chainId })`. Wallet-wide on that chain — not Morpho-only. Do not invent `claimData`. Call again if `additionalRoots` > 0.
|
|
166
172
|
|
|
167
173
|
## Troubleshooting
|
|
168
174
|
|
|
@@ -11,10 +11,12 @@ Do **not** web-search rates. Do **not** use DefiLlama. HIP-3 / Arcus stock tradi
|
|
|
11
11
|
|
|
12
12
|
## Plan Mode
|
|
13
13
|
|
|
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.
|
|
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 vaults/funding only if they asked. Hyperliquid **Core lend** (USDC/USDT supply APR) is an **optional extra** for stables — mention in plan notes; add an Execute leaf only if they say yes or already asked about Hyperliquid / HL lend / Core lending. Catalog MCP is context only.
|
|
15
15
|
|
|
16
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
17
|
|
|
18
|
+
For **USDC / USDT**, plan notes **must** also mention Hyperliquid Core lend as an **optional extra**: supply USDC/USDT0 on HyperCore to earn utilization **APR** (`ctm_hyperliquid_fetch_lend_markets`); HYPE/UBTC collateral earns nothing. Do **not** add a Hyperliquid Execute workstream or call `ctm_hyperliquid_fetch_lend_markets` unless the operator says yes or already asked about Hyperliquid / HL lend / Core lending. That leaf is research-only (`toolGroups: ["defi_discovery", "defi:hyperliquid:lend", "keygen", "keygen_messaging"]`) — report quote-token `supplyYearlyRate` as **APR** plus `borrowYearlyRate` as context; skip collateral rows; category `idle`. Do not treat Core lend as vault APR or perp funding.
|
|
19
|
+
|
|
18
20
|
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.
|
|
19
21
|
|
|
20
22
|
## Units and caveats
|
|
@@ -52,6 +54,7 @@ Call `get_defi_protocol_skill({ protocolId: "yield-compare" })` for this map, th
|
|
|
52
54
|
3. `ctm_pendle_fetch_markets` — optional PT / YT / LP implied APY if they asked about Pendle (research-only)
|
|
53
55
|
4. `ctm_gmx_fetch_gm_apy` / `ctm_hyperliquid_fetch_vault_apys` / perp funding — **only if they asked** about GMX, HL vaults, or funding
|
|
54
56
|
5. Morpho stock-backed USDC loans — **optional extra in plan notes only**. Call `ctm_morpho_fetch_stock_markets` only if they say yes.
|
|
57
|
+
6. Hyperliquid Core lend (`ctm_hyperliquid_fetch_lend_markets`) — **optional extra in plan notes**. Call only if they say yes or already asked about Hyperliquid / HL lend. Quote tokens only (USDC / USDT0); **APR** not APY. HYPE/UBTC collateral is not idle yield.
|
|
55
58
|
|
|
56
59
|
### USDS
|
|
57
60
|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
|
|
3
|
+
declare const MERKL_API_BASE = "https://api.merkl.xyz";
|
|
4
|
+
/**
|
|
5
|
+
* Canonical Merkl `Distributor.sol` on most EVM chains.
|
|
6
|
+
* https://docs.merkl.xyz/integrate-merkl/smart-contract-addresses
|
|
7
|
+
*/
|
|
8
|
+
declare const MERKL_DISTRIBUTOR_ADDRESS: Address;
|
|
9
|
+
declare const MERKL_DISTRIBUTOR_CLAIM_GAS_FALLBACK = 500000n;
|
|
10
|
+
declare const MERKL_REWARDS_NOTES = "Wallet-wide Merkl on this chain (not protocol-filtered). Other venues\u2019 campaigns can appear. Claims the first Merkle root batch; call again if additionalRoots > 0. rEUL is omitted (Euler unlock flow). Merkl updates every 8\u201312 hours.";
|
|
11
|
+
type MerklDistributorClaimLeaf = {
|
|
12
|
+
root: string;
|
|
13
|
+
token: Address;
|
|
14
|
+
amountWei: bigint;
|
|
15
|
+
proofs: readonly `0x${string}`[];
|
|
16
|
+
symbol: string;
|
|
17
|
+
decimals: number;
|
|
18
|
+
};
|
|
19
|
+
type MerklRewardRow = {
|
|
20
|
+
symbol: string;
|
|
21
|
+
token: string;
|
|
22
|
+
amountHuman: string;
|
|
23
|
+
amountWei: string;
|
|
24
|
+
decimals: number;
|
|
25
|
+
root: string;
|
|
26
|
+
};
|
|
27
|
+
type MerklRewardsSummary = {
|
|
28
|
+
chainId: number;
|
|
29
|
+
user: string;
|
|
30
|
+
distributor: string;
|
|
31
|
+
claimable: MerklRewardRow[];
|
|
32
|
+
claimableCount: number;
|
|
33
|
+
firstRootClaimableCount: number;
|
|
34
|
+
additionalRoots: number;
|
|
35
|
+
skippedReulCount: number;
|
|
36
|
+
notes: string;
|
|
37
|
+
};
|
|
38
|
+
declare function merklUserRewardsUrl(addr: Address, chainId: number): string;
|
|
39
|
+
declare function loadMerklUserRewardsJson(args: {
|
|
40
|
+
chainId: number;
|
|
41
|
+
user: Address;
|
|
42
|
+
}): Promise<unknown>;
|
|
43
|
+
declare function parseMerklUserRewardsToLeaves(raw: unknown, args: {
|
|
44
|
+
chainId: number;
|
|
45
|
+
user: Address;
|
|
46
|
+
}): MerklDistributorClaimLeaf[];
|
|
47
|
+
declare function selectFirstRootMerklLeaves(collected: readonly MerklDistributorClaimLeaf[]): MerklDistributorClaimLeaf[];
|
|
48
|
+
declare function isMerklRewardEulLeaf(leaf: MerklDistributorClaimLeaf): boolean;
|
|
49
|
+
/** Non-rEUL leaves on the first remaining Merkle root (one Distributor.claim tx). */
|
|
50
|
+
declare function selectWalletWideMerklClaimLeaves(collected: readonly MerklDistributorClaimLeaf[]): MerklDistributorClaimLeaf[];
|
|
51
|
+
declare function fetchAllMerklDistributorClaimLeaves(args: {
|
|
52
|
+
chainId: number;
|
|
53
|
+
user: Address;
|
|
54
|
+
}): Promise<MerklDistributorClaimLeaf[]>;
|
|
55
|
+
declare function encodeMerklDistributorClaimData(args: {
|
|
56
|
+
user: Address;
|
|
57
|
+
leaves: readonly MerklDistributorClaimLeaf[];
|
|
58
|
+
}): `0x${string}`;
|
|
59
|
+
declare function merklLeafToRow(leaf: MerklDistributorClaimLeaf): MerklRewardRow;
|
|
60
|
+
declare function fetchMerklRewardsSummary(args: {
|
|
61
|
+
user: string;
|
|
62
|
+
chainId: number;
|
|
63
|
+
}): Promise<MerklRewardsSummary>;
|
|
64
|
+
|
|
65
|
+
export { MERKL_API_BASE as M, MERKL_DISTRIBUTOR_ADDRESS as a, MERKL_DISTRIBUTOR_CLAIM_GAS_FALLBACK as b, MERKL_REWARDS_NOTES as c, type MerklDistributorClaimLeaf as d, type MerklRewardRow as e, type MerklRewardsSummary as f, encodeMerklDistributorClaimData as g, fetchAllMerklDistributorClaimLeaves as h, fetchMerklRewardsSummary as i, isMerklRewardEulLeaf as j, merklUserRewardsUrl as k, loadMerklUserRewardsJson as l, merklLeafToRow as m, selectWalletWideMerklClaimLeaves as n, parseMerklUserRewardsToLeaves as p, selectFirstRootMerklLeaves as s };
|