@continuumdao/ctm-mpc-defi 0.2.7 → 0.2.8

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.
@@ -0,0 +1,20 @@
1
+ ## Gas and MCP submit (all `build_*_multisign` tools)
2
+
3
+ All `ctm_*_build_*_multisign` tools **build, sign the management envelope, and POST** `/multiSignRequest`. They return **`{ requestId }`** — that is success. **Do not call the same build tool again** unless the user explicitly wants a new order; use `list_sign_requests` to verify pending requests.
4
+
5
+ Before creating, call `get_multi_sign_gas_options({ chainId })` when gas preference is unclear:
6
+
7
+ | Setting | Meaning |
8
+ |---------|---------|
9
+ | `useCustomGas: false` | Live RPC fee estimates at proposal time (default) |
10
+ | `useCustomGas: true` | Chain registry Custom Gas Config — **empty or omitted `baseFee` / `priorityFee` is valid** (live RPC used at proposal; configured values are optional floors/multipliers) |
11
+
12
+ - **`proposalTxParams`** on the sign request records gas limit and fee snapshot at create time.
13
+ - **Get Sig** (`trigger_sign_result`) refreshes fees via `feeSpeedTier` (default from `defaultGetSigFeeSpeed`).
14
+
15
+ ### After submit (`{ requestId }`)
16
+
17
+ 1. `wait_for_sign_request_ready` (if needed)
18
+ 2. `sign_request_agree` (multi-agree)
19
+ 3. `trigger_sign_result`
20
+ 4. `broadcast_sign_result`
@@ -105,13 +105,6 @@ For **withdraw**, **borrow**, and **repay**, the server calls the Aave v4 previe
105
105
 
106
106
  Set `skipHealthPreview: true` only when the user explicitly accepts skipping simulation (not recommended).
107
107
 
108
- ## After submit (`{ requestId }`)
109
-
110
- 1. `wait_for_sign_request_ready` (if needed)
111
- 2. `sign_request_agree` (multi-agree)
112
- 3. `trigger_sign_result`
113
- 4. `broadcast_sign_result`
114
-
115
108
  ## Example: deposit 0.001 ETH on Ethereum
116
109
 
117
110
  ```json
@@ -109,13 +109,6 @@ Ethereum (1), Optimism (10), BSC (56), Gnosis (100), Polygon (137), Sonic (146),
109
109
  }
110
110
  ```
111
111
 
112
- ## After submit (`{ requestId }`)
113
-
114
- 1. `wait_for_sign_request_ready` (if needed)
115
- 2. `sign_request_agree` (multi-agree)
116
- 3. `trigger_sign_result`
117
- 4. `broadcast_sign_result`
118
-
119
112
  ## Troubleshooting
120
113
 
121
114
  | Symptom | Likely cause |
@@ -7,4 +7,4 @@ description: Ethena USDe stake, redeem, cooldown, and claim on Ethereum mainnet.
7
7
 
8
8
  Stake/redeem MCP tools target **mainnet (chainId 1)**. Use `get_defi_protocol_supported_tokens` for USDe/sUSDe addresses.
9
9
 
10
- Tools: `ctm_ethena_build_stake_multisign`, `_redeem_`, `_cooldown_`, `_claim_`.
10
+ Tools: `ctm_ethena_build_stake_multisign`, `_redeem_`, `_cooldown_`, `_claim_`. Each returns `{ requestId }` on success (shared gas/submit section appended by the server).
@@ -7,4 +7,4 @@ description: Euler v2 isolated lend/borrow, vault withdraw, and collateral opera
7
7
 
8
8
  Supported chains from `get_defi_protocol_supported_chains` (subgraph map). Pass `vault` and asset addresses from Euler UI.
9
9
 
10
- Tools include isolated lend/borrow, collateral deposit/withdraw, vault withdraw, borrow repay.
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).
@@ -16,13 +16,32 @@ Perpetuals on Arbitrum (42161) and Avalanche (43114) via `@gmx-io/sdk` v2 **clas
16
16
  3. `ctm_gmx_fetch_market_prices({ chainId, symbol, collateralSymbol })` — index/collateral USD mark
17
17
  4. `ctm_gmx_fetch_ohlcv({ chainId, symbol, timeframe: "15m" })` — tabular OHLCV candles (USD index)
18
18
  5. `ctm_gmx_fetch_positions({ chainId, executorAddress })` — for close flows
19
- 6. `ctm_gmx_build_increase_multisign` or `ctm_gmx_build_decrease_multisign` with `keyGenId`, `chainId`, `purposeText`
20
- 7. Base MPC: agree trigger signbroadcast
19
+ 6. `get_multi_sign_gas_options({ chainId })` confirm `useCustomGas` with the user
20
+ 7. `ctm_gmx_build_increase_multisign` or `ctm_gmx_build_decrease_multisign` with `keyGenId`, `chainId`, `purposeText`, `useCustomGas` **`{ requestId }`**
21
+ 8. Base MPC lifecycle (see shared gas/submit section below)
21
22
 
22
23
  ## Limit orders
23
24
 
24
25
  Set `orderType: "limit"` and `triggerPriceUsdHuman` on increase/decrease builders.
25
26
 
27
+ Example short limit on Arbitrum (ETH/USDC collateral):
28
+
29
+ ```json
30
+ {
31
+ "keyGenId": "<keygen-id>",
32
+ "chainId": 42161,
33
+ "purposeText": "GMX short ETH limit at 1750 USDC",
34
+ "useCustomGas": false,
35
+ "symbol": "ETH/USD [WETH-USDC]",
36
+ "direction": "short",
37
+ "orderType": "limit",
38
+ "triggerPriceUsdHuman": "1750",
39
+ "sizeUsdHuman": "200",
40
+ "collateralAmountHuman": "50",
41
+ "collateralSymbol": "USDC"
42
+ }
43
+ ```
44
+
26
45
  ## Cancel
27
46
 
28
47
  Use `orderId` from `fetchOrders` with `ctm_gmx_build_cancel_multisign`.
@@ -43,3 +62,11 @@ Keeper execution is asynchronous (same as perp orders). Execution fee is paid in
43
62
  1. `ctm_gmx_fetch_staking_power({ chainId, executorAddress })`
44
63
  2. `ctm_gmx_build_stake_gmx_multisign` — approve GMX + `RewardRouter.stakeGmx`
45
64
  3. `ctm_gmx_build_unstake_gmx_multisign` — `RewardRouter.unstakeGmx`
65
+
66
+ ## Troubleshooting
67
+
68
+ | Symptom | Likely cause |
69
+ |---------|----------------|
70
+ | Agent says custom gas "will fail" without baseFee | Wrong — empty registry fees are valid; use `get_multi_sign_gas_options` |
71
+ | Multiple duplicate sign requests | Retried `ctm_gmx_build_*` after `{ requestId }` — do not retry on success |
72
+ | Order pending after broadcast | Normal — GMX keeper executes asynchronously |
@@ -19,4 +19,4 @@ Mainnet only (`chainId: 1`). Use `get_defi_protocol_supported_chains` and confir
19
19
  | Wrap stETH → wstETH | `ctm_lido_build_wrap_steth_multisign` |
20
20
  | Unwrap wstETH | `ctm_lido_build_unwrap_wsteth_multisign` |
21
21
 
22
- Complete flow with base MCP: `trigger_sign_result` `broadcast_sign_result`.
22
+ All `ctm_lido_build_*_multisign` tools return `{ requestId }` on success (shared gas/submit section appended by the server).
@@ -7,4 +7,4 @@ description: Maple Syrup pool deposit and redeem request flows.
7
7
 
8
8
  Chains: mainnet and Sepolia. Pass `syrupRouter`, `pool`, and `asset` from Maple UI/GraphQL.
9
9
 
10
- Tools: `ctm_maple_build_deposit_multisign`, `ctm_maple_build_request_redeem_multisign`.
10
+ Tools: `ctm_maple_build_deposit_multisign`, `ctm_maple_build_request_redeem_multisign`. Each returns `{ requestId }` on success (shared gas/submit section appended by the server).
@@ -7,4 +7,4 @@ description: Sky Lockstake and sUSDS deposit/redeem on Ethereum mainnet.
7
7
 
8
8
  Mainnet only. Tools for Lockstake stake/draw/wipe/close/reward and sUSDS deposit/redeem.
9
9
 
10
- Use `get_defi_protocol_supported_chains` and base registry for USDS/SKY addresses.
10
+ Use `get_defi_protocol_supported_chains` and base registry for USDS/SKY addresses. All `ctm_sky_build_*_multisign` tools return `{ requestId }` on success (shared gas/submit section appended by the server).
@@ -138,13 +138,6 @@ Use the same `swapTransactionDeadlineUnix` in step 2 and `swapDeadlineUnix` in s
138
138
  - **On-chain batch** may add approve headroom; for `EXACT_OUTPUT`, optional `slippagePercent` on build adjusts approval sizing.
139
139
  - Explain expected input/output from quote JSON before submitting the sign request.
140
140
 
141
- ## After submit (`{ requestId }`)
142
-
143
- 1. `wait_for_sign_request_ready` (if needed)
144
- 2. `sign_request_agree` (multi-agree)
145
- 3. `trigger_sign_result`
146
- 4. `broadcast_sign_result`
147
-
148
141
  ## Troubleshooting
149
142
 
150
143
  | Symptom | Likely cause |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@continuumdao/ctm-mpc-defi",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "Continuum MPC DeFi protocol library — multiSignRequest builders for EVM and future chain categories",
5
5
  "repository": {
6
6
  "type": "git",