Bump @alphafi/alphalend-sdk to ^4.1.0 - #98
Conversation
…from the dependency tree
|
operate.md review — head 1. 🟡 The PR body's central claim does not hold. "Only
So the bump rewrites the PTB shape of all 21 2. 🟡 No call site passes 3. 🟡 Five 4. 🟢 New runtime dependency on 5. 🟢 Holding approval on item 2 — small, contained change, and it keeps the reward-collect PTBs from carrying one oracle update per reward. Items 1 and 4–5 are advisory; item 3 is pre-existing but cheap to fix in the same pass. |
|
@11felix — one change requested before this can be approved (full detail in the operate.md comment above): fetch the Lazer update bytes once per transaction and pass them into every Why it matters: in 4.1.0
So a pool with several claimable rewards builds a PTB carrying one proxy round-trip and one duplicate shared-oracle mutation per reward — extra gas, extra commands, and needless contention on the oracle object. Shape of the fix: hoist one Two smaller things worth folding into the same pass:
Chain-side readiness isn't a concern: |
|
Thanks — items 1, 2 and 3 were real. Fixed in 2 — multi-update PTBs: fixed, but not by threading
|
|
Re-reviewed at head Item 2 (N oracle updates per PTB) — fixed, verified.
On the Item 3 (unawaited) — fixed, verified. All 19 Item 1 (PR body) — corrected, and the constant checks out where it matters. On the 2-updates-per-PTB you left open — agreed, and it's safe, not merely cheap. Correction to the earlier list: Item 5 ( Approving. Item 4 is the one thing still open, and it's an ops question rather than a code one: |
Zorag44
left a comment
There was a problem hiding this comment.
operate.md: clean — CI green at 8415956; items 1–3 verified fixed against the current diff (oracle object id unchanged, coin-type union preserved, all updatePrices awaited). Residual 2-updates-per-PTB on deposit/withdraw is gas and event noise only — ingest_lazer_update skips a non-advancing feed rather than aborting. Approvals: 1/2 — needs one more before merge.
Picks up the alphalend-sdk release that replaced 7k swap with Cetus (alphalend-sdk-js#172). Removes
@7kprotocol/sdk-ts,@flowx-finance/sdk, and@bluefin-exchange/bluefin7k-aggregator-sdkfrom this package's dependency tree entirely.Only
Network,getConstants,getUserPositionCapId, andAlphalendClientare consumed from the SDK, and their type signatures are unchanged across 3.0.2→4.1.0. Two of them change behaviour, though:AlphalendClient.updatePrices()switches oracle mechanism, Pyth Core → Pyth Lazer. It is now a delegate toupdatePricesLazer(), which fetches signed update bytes fromLAZER_PROXY_URL(https://api.alphalend.xyz/lazer/update) and appendspyth_lazer::parse_and_verify_le_ecdsa_update_v2+oracle::ingest_lazer_updateto the PTB, in place of the old@pythnetwork/pyth-sui-jspath. This changes the PTB shape of everyupdatePrices(...)call site insrc/strategies/**andsrc/admin/.getConstants()changes values, not just shape:ALPHAFI_LATEST_ORACLE_PACKAGE_ID0x7671937b…→0x869b2d44…, plus newLAZER_*/STSUI_*keys.Chain-side readiness is in place:
alphafi-sdk-rustmain already runs the Lazer path (f0c2456).Also folded in (see review discussion): the reward-collection paths now issue one oracle update per PTB covering the union of coin types, instead of one per reward, and every
updatePricescall is awaited so the oraclemoveCalls are ordered before thecollect_reward_and_swap_*calls that consume the price.Build, lint and type-check are clean.
Unblocks removing the v1
@mysten/suicompat shims in alphafi-fe (companion PR there).