Skip to content

chore(deepbook-v3): point mainnet LIQUIDATION_PACKAGE_ID at the upgraded-Pyth publication - #1214

Merged
tonylee08 merged 3 commits into
mainfrom
tlee/deepbook-v3-mainnet-liquidation-upgraded
Aug 18, 2026
Merged

chore(deepbook-v3): point mainnet LIQUIDATION_PACKAGE_ID at the upgraded-Pyth publication#1214
tonylee08 merged 3 commits into
mainfrom
tlee/deepbook-v3-mainnet-liquidation-upgraded

Conversation

@tonylee08

@tonylee08 tonylee08 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Description

2.0.0 shipped MarginLiquidationsContract targeting liquidation_vault::liquidate_base_upgraded / liquidate_quote_upgraded, but mainnet margin_liquidation is still v4 (0xf17bff1b…), which predates those entrypoints and exposes only liquidate_base / liquidate_quote. So liquidateBase and liquidateQuote currently have no mainnet target — the second of the two release gates called out in #1194.

This points mainnet LIQUIDATION_PACKAGE_ID at the publication that closes it: 0xba2b39c026650fef52038c93c526fc5314a4286318a0d2a7054b65815178fb74. Patch release; no API change.

Verified on chain — the package is live

The upgrade landed as margin_liquidation v5 and every item from the draft checklist now checks out on mainnet:

  • the id resolves, same lineage as v4 — the package reports version: 5, and its LIQUIDATION_VAULT type is still defined by the lineage's original 0x73c59388…, so the deployed LiquidationVault (0xae8e0606…) stays valid and no caller migrates an object
  • liquidation_vault carries both upgraded entrypoints — its public function list is authorize_trader, balance, create_liquidation_vault, deauthorize_trader, deposit, liquidate_base, liquidate_base_upgraded, liquidate_quote, liquidate_quote_upgraded, swap_base_to_quote, swap_quote_to_base, withdraw
  • a liquidateBase PTB built by this SDK simulates successfully against it — target 0xba2b39c02665…::liquidation_vault::liquidate_base_upgraded, simulation {"success": true, "error": null}, using the real vault and a live SUI_SUIUSDE margin manager
  • the NOT YET PUBLISHED note is dropped from the constant's comment, replaced with the verified state

Every other vault builder — deposit, withdraw, balance, swaps, trader authorization — takes no oracle and resolves the same against either id.

Testnet is unchanged: margin_liquidation v4 there (0x29bccec5…) already carries the upgraded pair.

Test plan

  • pnpm --filter @mysten/deepbook-v3 test — 309 passed / 7 files
  • pnpm turbo lint build --filter @mysten/deepbook-v3 — 9 tasks green (tsc, oxlint, prettier, tsdown)
  • Current mainnet id read on chain for the "predates" claim: 0xf17bff1b… is margin_liquidation version 4, one module liquidation_vault
  • No test pins the mainnet liquidation package id; the PTB snapshots build against testnet config

AI Assistance Notice

Please disclose the usage of AI. This is primarily to help inform reviewers of how careful they need to review PRs, and to keep track of AI usage across our team. Please fill this out accurately, and do not modify the content or heading for this section!

  • This PR was primarily written by AI.
  • I used AI for docs / tests, but manually wrote the source code.
  • I used AI to understand the problem space / repository.
  • I did not use AI for this PR.

…ded-Pyth publication

Mainnet `margin_liquidation` v4 (`0xf17bff1b…`) predates the upgraded-Pyth
entrypoints: its `liquidation_vault` exposes `liquidate_base`/`liquidate_quote`
only, while `MarginLiquidationsContract` targets the `_upgraded` pair. That left
`liquidateBase` and `liquidateQuote` with no mainnet target in 2.0.0 — the
second of the two release gates recorded in #1194.

`LIQUIDATION_PACKAGE_ID` now points at the publication that closes it,
`0xba2b39c0…`.

The id is not on chain yet — `object(address:)` against mainnet GraphQL returns
null — so nothing here is verified against a live package: not the version, not
the lineage, not the module surface. Draft until the upgrade lands and those
three are read on chain. The rest of the vault surface (deposit, withdraw,
balance, swaps, trader authorization) takes no oracle and works against either
id.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tonylee08
tonylee08 deployed to sui-typescript-aws-kms-test-env August 18, 2026 13:52 — with GitHub Actions Active
@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sui-typescript-docs Ready Ready Preview Aug 18, 2026 6:25pm

Request Review

The id is now published as margin_liquidation v5. Its liquidation_vault exposes
liquidate_base_upgraded and liquidate_quote_upgraded, and its LIQUIDATION_VAULT
type is still defined by the lineage's original 0x73c59388…, so the deployed
vault stays valid across the upgrade.
@tonylee08
tonylee08 deployed to sui-typescript-aws-kms-test-env August 18, 2026 17:48 — with GitHub Actions Active
@tonylee08
tonylee08 marked this pull request as ready for review August 18, 2026 17:53
@tonylee08
tonylee08 requested a review from a team as a code owner August 18, 2026 17:53
@tonylee08
tonylee08 deployed to sui-typescript-aws-kms-test-env August 18, 2026 17:53 — with GitHub Actions Active
The id change speaks for itself; the reasoning lives in the changeset and the
PR.
@tonylee08
tonylee08 merged commit 67386be into main Aug 18, 2026
9 checks passed
@tonylee08
tonylee08 deleted the tlee/deepbook-v3-mainnet-liquidation-upgraded branch August 18, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants