@sodax/skills 2.3.0-rc.1 → 2.3.0-rc.2
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/package.json +1 -1
- package/skills/sodax-dapp-kit/integration/knowledge/features/leverage-yield.md +1 -1
- package/skills/sodax-dapp-kit/leverage-yield/SKILL.md +1 -1
- package/skills/sodax-sdk/integration/knowledge/features/leverage-yield.md +1 -1
- package/skills/sodax-sdk/integration/knowledge/features/swap.md +4 -0
- package/skills/sodax-sdk/leverage-yield/SKILL.md +1 -1
package/package.json
CHANGED
|
@@ -50,7 +50,7 @@ type UseLeverageYieldDepositVars = LeverageYieldSwapDepositParams;
|
|
|
50
50
|
// { vault: Address; srcChainKey; srcAddress; inputToken; inputAmount: bigint;
|
|
51
51
|
// minOutputAmount: bigint; deadline?: bigint; solver?: Address; partnerFee? }
|
|
52
52
|
|
|
53
|
-
// withdraw — lsoda* shares → any token on any chain (hub-wallet sourced)
|
|
53
|
+
// withdraw — lsoda* shares → any token on any chain but Bitcoin (hub-wallet sourced)
|
|
54
54
|
type UseLeverageYieldWithdrawVars = LeverageYieldSwapWithdrawParams;
|
|
55
55
|
// { vault: Address; srcChainKey; srcAddress; dstChainKey; outputToken;
|
|
56
56
|
// inputAmount: bigint; minOutputAmount: bigint; recipient?; deadline?; solver? }
|
|
@@ -14,7 +14,7 @@ Granular skill for the leverage-yield hooks of `@sodax/dapp-kit` v2. queryKey/mu
|
|
|
14
14
|
## Step 1 — Clarify with user before coding
|
|
15
15
|
|
|
16
16
|
0. **Vault or leverage position?** Ask first — they share the `leverageYield` key namespace and nothing else. A **vault** is one pooled ERC-4626 position at a single target LTV (`useLeverageYield*`). A **leverage position** is the user's own AAVE account, cloned per position (`useLeveragePosition*`, `useOpenLeveragePosition`). `useLeverageYieldPosition` is the **vault's** snapshot — it is not a leverage position. If the answer is positions, jump to Step 1b.
|
|
17
|
-
1. **Deposit or withdraw?** Deposit = any token → `lsoda*` shares (lands in the hub wallet). Withdraw = `lsoda*` shares → any token on any chain.
|
|
17
|
+
1. **Deposit or withdraw?** Deposit = any token → `lsoda*` shares (lands in the hub wallet). Withdraw = `lsoda*` shares → any token on any chain. **Except Bitcoin:** vault swaps refuse it on either side with `VALIDATION_FAILED`.
|
|
18
18
|
2. **Build vs execute.** `useLeverageYieldDeposit` / `useLeverageYieldWithdraw` only *build* a `LeverageYieldSwapPayload`; `useLeverageYieldVaultSwap` *executes* it (create → relay → notify solver). You always need both.
|
|
19
19
|
3. **Approval?** `useLeverageYieldVaultSwapWithApproval` folds the deposit's approval in (one EIP-5792 batch when the wallet can), labelled with `useLeverageYieldApprovalStrategy`. The two-step alternative approves the spoke `inputToken` via the swap-domain `useSwapApprove` / `useSwapAllowance`. Withdraw needs no approval (`hubWalletSwap: true`).
|
|
20
20
|
4. **Which vaults?** No hook — read the registry with `useSodaxContext().sodax.leverageYield.listVaults()` (synchronous, wrap in `useMemo`) and pass each entry's `vault` address to the hooks.
|
|
@@ -12,7 +12,7 @@ Access: `sodax.leverageYield`. Service class: `LeverageYieldService`. Feature ta
|
|
|
12
12
|
|
|
13
13
|
- A vault holds `asset` (a Sodax vault token like the weETH vault, `SodaTokens.sodaWEETH`) as collateral, borrows `borrowToken` (e.g. sodaETH) from the Sodax-forked AAVE pool, swaps it back into the asset, and re-supplies — to a `targetLTV`.
|
|
14
14
|
- The ERC-4626 **share token is the vault proxy address itself** (`lsoda*`). Holding shares = holding the leveraged position.
|
|
15
|
-
- **Deposit** = swap any spoke token → `lsoda*`, delivered to the user's **hub wallet** on Sonic. **Withdraw** = swap `lsoda*` (held in the hub wallet) → any token on any chain.
|
|
15
|
+
- **Deposit** = swap any spoke token → `lsoda*`, delivered to the user's **hub wallet** on Sonic. **Withdraw** = swap `lsoda*` (held in the hub wallet) → any token on any chain. Bitcoin is refused on either side with `VALIDATION_FAILED`.
|
|
16
16
|
- **Steady-state APR**: `netAprRay = supplyAprRay + leverageMultiplier × (supplyAprRay − borrowAprRay)`, where `leverageMultiplier = targetLTV / (1 − targetLTV)` — the **borrowed** multiple of equity (debt ÷ equity), not total exposure. Exposure (collateral ÷ equity) is `1 + leverageMultiplier` = `1 / (1 − targetLTV)`: at `targetLtvBps` 8200 that is 4.56× borrowed, 5.56× exposure, so a UI label reading "Leverage" shows `1 + multiplier`. Rates are RAY (`1e27`); the multiplier and `healthFactor` are WAD (`1e18`); `targetLtvBps` and the position `ltv` are basis points (`10_000` = 100%). `netAprRay` goes **negative** when the borrow rate exceeds supply — for LSD-backed vaults the LSD's native staking yield (folded in by `getEffectiveApr`) is the real alpha.
|
|
17
17
|
|
|
18
18
|
## Public methods
|
|
@@ -13,6 +13,10 @@ not select a solver endpoint. `isSwapSupportedToken` accepts both tiers, so do n
|
|
|
13
13
|
use it to establish production readiness. Query the list for the environment the
|
|
14
14
|
integration targets instead of hardcoding symbols.
|
|
15
15
|
|
|
16
|
+
A production promotion retains staging availability through `getStagingSolverTokens`.
|
|
17
|
+
Do not treat absence from `stagingSwapSupportedTokens` as absence from staging;
|
|
18
|
+
production tokens are supplied by the union accessor.
|
|
19
|
+
|
|
16
20
|
Staging membership does not imply money-market support. When a token has no
|
|
17
21
|
separate vault, its registry entry uses `vault === hubAsset` for the direct hub
|
|
18
22
|
asset. Canonical hub vault registration alone does not enable swaps or lending.
|
|
@@ -14,7 +14,7 @@ Granular skill for `LeverageYieldService` — `sodax.leverageYield`. Feature tag
|
|
|
14
14
|
## Step 1 — Clarify with user before coding
|
|
15
15
|
|
|
16
16
|
0. **Vault or leverage position?** Ask this first — they share the service and nothing else. A **vault** is one pooled ERC-4626 position at a single target LTV, entered/exited as an intent swap (`deposit` / `withdraw` / `vaultSwap`). A **leverage position** is the user's own AAVE account, cloned per position, with its own eMode category and leverage tier (`openLeveragePosition` and friends). "Deposit into a leverage vault" is the first; "open a leverage position", "adjust my leverage", "close my position" is the second. If the answer is positions, jump to Step 1b.
|
|
17
|
-
1. **Deposit or withdraw?** Deposit = any spoke token → `lsoda*` shares (delivered to the user's hub wallet). Withdraw = `lsoda*` shares (in the hub wallet) → any token on any chain.
|
|
17
|
+
1. **Deposit or withdraw?** Deposit = any spoke token → `lsoda*` shares (delivered to the user's hub wallet). Withdraw = `lsoda*` shares (in the hub wallet) → any token on any chain. **Except Bitcoin:** vault swaps refuse it on either side with `VALIDATION_FAILED`.
|
|
18
18
|
2. **Build vs execute.** `deposit` / `withdraw` only *build* a `LeverageYieldSwapPayload`; `vaultSwap` *executes* it end-to-end. Spread the built payload into `vaultSwap({ ...payload, walletProvider })`. `vaultSwapWithApproval` does the same with the deposit's approval folded in (one EIP-5792 batch when the wallet can); `getApprovalStrategy` predicts the path.
|
|
19
19
|
3. **End-to-end or manual relay?** By default `vaultSwap` creates the intent and hands it to the backend submit-tx flow, which relays and notifies the solver; on any backend non-success it falls back to verify → relay → notify client-side, and then resolves before the fill (opt out of the backend path with `leverageYield: { useBackendSubmitTx: false }`). For a fully manual flow, use `createVaultIntent`, relay yourself, and finish with the public `notifySolver`.
|
|
20
20
|
4. **Which vaults?** `listVaults()` (synchronous registry: `{ name, vault, asset, borrowToken, lsdSource? }`); pass `vault` to every call.
|