# @mysten/deepbook-v3

## 3.0.1

## 3.0.0

### Patch Changes

- Updated dependencies [233b207]
- Updated dependencies [98cb619]
- Updated dependencies [e39d2a9]
- Updated dependencies [d4e4406]
- Updated dependencies [693482d]
- Updated dependencies [233b207]
- Updated dependencies [1bf4878]
- Updated dependencies [1871849]
- Updated dependencies [19d3a1c]
- Updated dependencies [52660ab]
- Updated dependencies [f43f64d]
- Updated dependencies [659c915]
- Updated dependencies [2cb1611]
- Updated dependencies [faf8d74]
  - @mysten/sui@3.0.0

## 2.13.0

### Minor Changes

- 9f44a50: Point Mainnet at Sessions v4 `0x6069298c…`. `sessionsPackageIdV1` keeps the original id
  `0x9a068bef…`, so the `SessionsApp` key and the v1 session events keep their type tags. Sessions
  v4 adds the spot pool allowlist (`session_config::allowed_pools`, `admin_allow_pool`,
  `admin_disallow_pool`) and session builder approvals, whose bindings already ship.

  Session-key spot orders (`place_limit_order`, `place_market_order`) through Sessions v4 abort with
  `EPoolNotAllowed` (code 2) on a pool outside the allowlist, and Mainnet's allowlist is empty until
  the admin fills it. The same admin transaction raises the Sessions version watermark to 4, which
  retires Sessions v1 to v3. Apps with one-click spot trading should switch to this release when
  that transaction executes. Session Predict orders and cancels aren't gated by the allowlist.

## 2.12.0

### Minor Changes

- 1213d45: Point Mainnet at Predict v5 `0xb0aaafe0…`, `deepbook_predict_orders` v2 `0x48e78879…` and
  `deepbook_predict_math` v2 `0x2919b07a…`, and call `account` v2 `0x3dbf966f…` through the new
  `accountPackageIdLatest` / `packages.accountLatest` ids while type tags and derived addresses keep
  the original `account` id. The Mainnet version pins move to Predict 5 and orders 2. Mainnet
  Sessions stays at v3.

  Point Testnet at Predict v10 `0xbb6a1595…`, `deepbook_predict_orders` v5 `0xc43f12fe…` and
  Sessions v9 `0x3bb8b2db…`, built from deepbookv3 main. The regenerated bindings add Predict's
  `protocol_config::set_template_fee_bands` and its `FeeBandsUpdated` event,
  `registry::create_and_share_expiry_market_with_band`, and the Sessions spot pool allowlist
  (`session_config::allowed_pools`, `admin_allow_pool`, `admin_disallow_pool`). Session spot orders
  through Sessions v9 abort with `EPoolNotAllowed` (code 2) on a pool outside the allowlist. The
  version constants are unchanged (Predict 5, orders 2).

  `decodeMoveAbort` and `describePredictError` now name the Version 5 aborts:
  `session_config::EPoolNotAllowed` (with readable text), `protocol_config::ESettledRedeemRetired`,
  and Predict's `config_constants` setter bounds, including `EInvalidFeeBands`.

## 2.11.1

## 2.11.0

### Minor Changes

- 882abaf: Point Testnet at the P-33 SVI-decimals packages: Predict v9 `0x481215e2…`,
  `deepbook_predict_orders` v4 `0xcd6ff112…` and Sessions v6 `0x8b3e5c2a…`. The regenerated bindings
  add Propbook's `block_scholes_store::svi_decimals` and `registry::set_block_scholes_svi_decimals`,
  and the `BlockScholesSVIDecimalsSet` event. Every Testnet store is still at 9 decimals, so pricing
  is unchanged. The version constants are unchanged (Predict 5, orders 2), and Mainnet ids are
  unchanged.

## 2.10.1

### Patch Changes

- c2766b4: Bump the testnet `LIQUIDATION_PACKAGE_ID` to `margin_liquidation` v5: `0x29bccec5…` →
  `0x4f4916fc38892fe335a8aab45e3f42700060eb2d20f854607489ad88a88393a9`. v5 links testnet core v21
  and margin v17, the packages `DEEPBOOK_PACKAGE_ID` and `MARGIN_PACKAGE_ID` already point at. It is
  built from the same source as mainnet v6. It keeps every public signature and retires the
  legacy-Pyth `liquidate_base` and `liquidate_quote`, which no builder here calls. Mainnet is
  unchanged.

## 2.10.0

### Minor Changes

- 3acf620: Point Testnet at the Predict Version 5 rehearsal packages and add account v2's coin
  receive.

  - Testnet ids: Predict v8 `0x7fc9677d…`, `deepbook_predict_orders` v3 `0xc5869f5b…`, Sessions v5
    `0x13108df3…` and account v2 `0x4401eae9…`. Mainnet ids are unchanged.
  - The retirement guard follows the configured call targets. The new
    `packages.predictCurrentVersion` and `packages.predictOrdersCurrentVersion` pin the version
    constants each network's call targets compile: Testnet 5 and 2 (Version 5), Mainnet 4 and 1
    until its upgrade. So the SDK keeps trading on Testnet when the Predict and order-desk
    watermarks move to 5 and 2, and still reports Mainnet's v4 code as `'retired'` if Mainnet's move
    first. `PREDICT_PACKAGE_VERSION` (5) and `ORDER_FLOW_PACKAGE_VERSION` (2) are the versions these
    bindings were generated from, and the default for a custom config. They follow the Mainnet
    package numbers, never Testnet's.
  - Account calls go to the latest account package, through the new optional
    `accountPackageIdLatest` (`/account` and `/sessions` ids) and `packages.accountLatest`
    (Predict). A transaction can't call a package at an older version than another package in it
    links, so an account call at v1 next to Predict v8 aborts `InvalidLinkage`. `AccountContract`,
    the Predict builders and the exported `accountMoveCalls` / `accountRegistryMoveCalls` all
    resolve it from the config (an explicit `package` still wins). `accountPackageId` and
    `packages.account` stay the original id, which every derived address and type tag uses.
  - `AccountContract.receiveCoin` and `receiveCoinAtAccountId` move a `Coin<T>` sent to an account's
    wrapper address (or its canonical id) into its balance. They are permissionless and need account
    v2.
  - The Predict, `deepbook_predict_orders`, Sessions and account bindings are regenerated from the
    Version 5 sources, so they include the builder-fee calls. `expiryMarketMoveCalls.redeemSettled`,
    `redeemSettledPermissionless` and `quoteClose`, and `queueMoveCalls.quoteRedeemOpen`, keep their
    shipped argument keys, because Version 5 underscore-prefixed those parameters. `redeemSettled`
    and `redeemSettledPermissionless` always abort from Predict v5.
  - Abort names for the builder-fee codes: `protocol_config` 16 `EBuilderFeeCutoverNotReached`, and
    `sessions` 3–5 `EBuilderNotApproved`, `EBuilderFeeAboveApproved` and
    `EBuilderApprovalsNotEnabled`.

### Patch Changes

- 3acf620: Bump the mainnet `LIQUIDATION_PACKAGE_ID` to `margin_liquidation` v6: `0xba2b39c0…` →
  `0xd61f264aaf707285a712347fccfb8e905e99d7dc72a6bd1053829ddebf420c2b`. v6 links core v9 and margin
  v8, the packages `DEEPBOOK_PACKAGE_ID` and `MARGIN_PACKAGE_ID` already point at. v5 links margin
  v7, so its liquidations stop working once margin version 7 is disabled. v6 keeps every public
  signature. It retires the legacy-Pyth `liquidate_base` and `liquidate_quote`, which now abort. No
  builder in this package calls them, because `liquidateBase` and `liquidateQuote` already target
  `liquidate_base_upgraded` and `liquidate_quote_upgraded`. The deployed vault and its
  `LIQUIDATION_VAULT` type are unchanged. Testnet is unchanged.

## 2.9.2

## 2.9.1

### Patch Changes

- cfb3cb0: Bump the mainnet package ids to DeepBook core v9 and margin v8: `DEEPBOOK_PACKAGE_ID`
  `0x0e735f8c…` → `0xbca0cefe720330e7bb4f2283438b68de6a0e656688db4ac90d61e71fe6151fe8`, and
  `MARGIN_PACKAGE_ID` `0x55ee8099…` →
  `0x40fa183b5602cd0f6c4d7b16c08766ad8d7d581608fbe3b2570fe72ab4f5625f`. The two move together.
  Margin v8 links core v9, and a transaction that calls core v8 directly next to margin v8 fails
  with `InvalidLinkage`. Both upgrades keep their public signatures. Margin v8 retires the
  legacy-Pyth entrypoints in `margin_manager` and `pool_proxy`, and no builder in this package calls
  them, since every oracle-taking builder already targets the `_upgraded` modules. Testnet moves the
  same way, to core v21 `0x4b1c2a827983d8fa73f6dc366cfab23636ae52e81e499d8724b71408fe6a00a4` and
  margin v17 `0x0ad965f35189c7eca57d4718c8f5bf1b7f9f7eb4ced6d5b7aa6496a16d71e8d2`, built from the
  same source. `LIQUIDATION_PACKAGE_ID` is unchanged on both networks.
- cfb3cb0: Add the HBTC coin (Hashi BTC, `0xd30fb3f8…::btc::BTC`, 8 decimals) and the mainnet
  HBTC_USDC pool `0x61368ab907934d7840d2e639b7fc2ee74785ffe3d46427d70e1ab8545f320c9b`.

## 2.9.0

### Minor Changes

- 16292eb: Point the Testnet Predict config at Predict v7, the admin-managed cadence table upgrade,
  and add its bindings: `registryMoveCalls.addCadence`, `registryMoveCalls.cadencePeriods` and
  `registryMoveCalls.createAndShareExpiryMarketAt`, plus the `configEvents.CadenceAdded` event. The
  Propbook bindings gain the SVI model reads and setter (`sviModel`, `setBlockScholesSviModel`,
  `BlockScholesSVIModelSet`). Mainnet is unchanged, and Mainnet v4 has none of these functions yet.

## 2.8.2

## 2.8.1

### Patch Changes

- 9a31750: Point the Testnet Predict config at the packages relinked to Propbook v2: Predict v6,
  `deepbook_predict_orders` v2 (with `predictOrdersV1` keeping its v1 original ID for event types),
  `deepbook_predict_math` v2 and Sessions v4. Mainnet is unchanged.

## 2.8.0

### Minor Changes

- 84b81a4: Record the Mainnet Predict v4 rollout (delayed execution) in the Mainnet config. Mainnet
  Predict trading moves to queued orders, as Testnet did in 2.7.0.

  - Predict: `0x08fa3ef1…ee53` (v3) →
    `0x98235c5842831c9b5f51dc637cf34c91db2aca5510802eb6ebfec63f5b71a7bb` (v4), which is also
    `packages.predictDelayedExecution`
  - `deepbook_predict_orders`: `0x7cd41de311f8f3efb2c239b38773a4010fce3bef0120cd55f479843077c98903`
    (v1), with its `OrderDesk` `0x87b0a87262aacf58eaff567eed2fb7cb0f9cbc1f5ce33ef79216cd26d13a1b5b`
    and `QueueRegistry` `0x8d4f0c671862f065ac7f2c2cb24abc47cf75ed8fc8e5e52c1d4bdfa53eee164f`
  - `deepbook_predict_math`: `0x19262d18a3ce9f1c304defbacc89f36585152acde73e626231200d10617fb9a7`
    (v1)
  - Pyth Lazer `State`: `0xd0db9c1e9212a98120384bf78d8b8c985d87b9ee6921dffcf9d1394062911573`
  - Sessions: `0xec678aee…0a1a` (v2) →
    `0xfd9ef53ca443517d6a3a4d8742e00eaa1e7f35b0997697caab8c3e62870c0ce5` (v3)

  `predictV1` and `sessionsPackageIdV1` keep the original IDs.

  **Move every Mainnet session client to this release before the cutover, spot included.** The
  Mainnet cutover transaction raises the Sessions version watermark to 3. From then on, every call
  into Sessions v1 or v2 aborts with `session_config::EPackageVersionDisabled`. That includes spot
  session-key trading (`sessionsMoveCalls.placeLimitOrder`, `placeMarketOrder`, `cancelLiveOrder`,
  `cancelLiveOrders` and `withdrawSettledAmounts`), `authorizeSession` and the Predict wrappers.
  Older releases call v2. This release calls v3 for every Sessions builder: the `SessionsContract`
  wrappers, and the `sessionsMoveCalls` builders given `getSessionsConfig('mainnet')`. v3 is a
  compatible upgrade, so the spot builders' arguments are unchanged. Only `revokeSession` and
  `sessionExpirationMs` aren't version-gated, so they keep working on every version. Queued Predict
  orders through a session key need v3 too, because the `enqueue*` wrappers exist only there.

  **Migrate off the immediate trades.** The Mainnet call target is now Predict v4, which always
  aborts them with `EDelayedExecutionRequired`. On Mainnet, `tx.mint`, `tx.mintAmount`,
  `tx.mintCost`, `tx.redeem` and `read.quoteRedeem` stop working, and so do the `SessionsContract`
  wrappers `mintExactQuantity`, `mintExactAmount`, `mintExactCost` and `redeemLive`. Place orders
  with `tx.enqueueMint`, `tx.enqueueMintAmount`, `tx.enqueueMintCost` and `tx.enqueueSell`, or with
  `read.planMint` / `read.planSell` and `tx.enqueuePlan`. Follow each order with `read.order` or
  `read.waitForOutcome`. Session keys use the `SessionsContract` `enqueue*` wrappers.
  `tx.claimSettled` is unchanged. Staying on an older release doesn't keep the immediate trades: the
  cutover raises Predict's version watermark to 4, which retires the v3 package those releases call.

  `getConfig('mainnet')` now turns on the queued-order surface. Until the cutover, neither path
  trades on Mainnet. Trading is paused, `read.executionMode()` reads `'awaiting-cutover'` until
  Mainnet's version watermark reaches 4, and Predict's admission refuses enqueues until then.

## 2.7.0

### Minor Changes

- 352a0cc: Add the Predict delayed-execution order flow (DBU-885). Queued mints and early sells fill
  at Pyth's signed price for a tick shortly after placement. Delayed execution spans three packages:
  the Predict upgrade, the order-flow package `deepbook_predict_orders` (each market's
  `MarketQueue`, the shared `OrderDesk`, every queued-order entry point and the queue events) and
  the math library `deepbook_predict_math`.

  - `PredictClient.tx` gains `enqueueMint`, `enqueueMintAmount`, `enqueueMintCost`, `enqueueSell`,
    `refund`, `fill`, and the permissionless `claimParked` and `payOpen` for USDC a denied receive
    address couldn't take. Each enqueue builder reads the market first and refuses an order the
    queue or protocol gates would abort with a typed `PredictPreflightError`, and returns the
    transaction with a preview of τ, the deadline, the escrow and the order fee. A sell whose cash
    need is above spare cash gets `rebalance_expiry_cash` after the enqueue by default.
  - `PredictClient.read` gains `queue`, `order`, `orders`, `waitForOutcome`, `quoteSell`,
    `executionMode`, `pendingFunds` and `lazerPackages`, and `PredictClient` gains `queueIdFor`.
    `executionMode` is `'retired'`, and the enqueue builders refuse with the `retired` code, once
    Predict's version watermark is above the version this SDK calls
    (`queue.PREDICT_PACKAGE_VERSION`) or the desk's is above the order-flow package's.
  - `PredictClient.read.settlement(market)` reads a market's settlement price, which still works
    after expiry, when `read.market` and the quotes abort `ELivePricingExpired`.
    `cost.settledPayout(orderId, settlementPriceRaw, tickSizeRaw)` gives what an order pays at that
    price, mirroring `strike_exposure::settled_order_payout`. Together they show a queued fill's
    result once the keeper has paid and cleaned up its record.
  - `PredictClient.read.feePolicy(market)` reads the fee policy a market snapshotted at creation,
    which the `cost` functions take as `fees`. `cost.SHIPPED_FEE_POLICY` matches neither recorded
    deployment's template any more, so its costs for a live market come out low.
  - `PredictClient.read` gains `planMint` and `planSell` for order forms. A plan quotes the order at
    the current price, also for a visitor without an account, and turns `slippageCents` (cents per
    contract, never a percentage, or `'auto'` from `queue.slippageBand`) into the enqueue limits,
    sized from the price without the fee subsidy, which is what enqueue admission checks. It returns
    the payout, the payout multiple, the order fee read from the desk, the escrow and debit, the
    balance, the most the market takes now, the timing, and the refusal the enqueue builder's own
    preflight would give the plan's order (with the new `cost-above-payout` code). `planMint` throws
    `entry-band` (a new code) for a strike outside the market's entry band, `min-premium` for a
    budget or quantity below the minimum premium, and `past-cutoff` for a market past its expiry.
    `PredictClient.tx.enqueuePlan` queues the order a plan describes. A plan carries its `target`
    (owner, market, strike or record), and `enqueuePlan` refuses it for another order, after the
    order fee rose, or when the balance escrows less than its budget. Each facade enqueue starts
    with `queueTx.assertOrderFeeAtMost`, which aborts the transaction when the desk's fee rose above
    the previewed one before it executes. `snapStrike` snaps a strike to a market's admission grid,
    and `queue.budgetMintLimits`, `queue.exactMintLimits` and `queue.sellLimits` are the pure limit
    helpers. Where the config records delayed execution, `quoteMint` and `quoteMintCost` read the
    chain's quote functions and preview a queued fill.
  - `decodeMoveAbort` names Predict's `pricing` aborts (such as `EBlockScholesPriceUnavailable`) the
    admission, position and LP aborts (such as `strike_payout_tree::EMaxPayoutTreeNodes`), and the
    `sessions`, `session_config` and `account_registry` aborts (such as `ESessionNotAuthorized`),
    and `describePredictError` gives the oracle-unavailable and stale ones a retry text and the
    session ones a readable one. The plan types (`MintPlan`, `SellPlan`, `PlanMintOptions`,
    `PlanSellOptions`, `SlippageOptions`, `AppliedSlippage`) are exported.
  - `PredictClient.decode` gains the queue event decoders (matched against the order-flow package's
    original ID, including `recordFunds` for parked and claimed USDC), `policyUpdates` and
    `expiryPnlRealized`. Refund reason 9 is a denied receive address. A held position carries its
    `quantityRaw`, decoded from its order ID, so a partial sell's remainder is readable without
    `cost.decodeOrderRange`. `realizedPnlRaw` sums the realized P&L changes.
  - New config: `packages.predictDelayedExecution`, `packages.predictOrders`,
    `packages.predictOrdersV1`, `packages.predictMath`, `objects.orderDesk` and
    `objects.queueRegistry`, all optional. Queue IDs derive from the queue registry.
  - New `queue` namespace (order codes, refund reasons, settlement phases, cash-need math,
    `maxMintNow`, timing previews, `orderView`, `reduceOrderEvents`, `slippageBand`), `queueTx`
    thunks (the enqueues, `createQueue`, `commit`, `resolve`, `refund`, `adminRefund`, `settleStep`,
    `payOpen`, `claimParked`, `cleanup`, `fill`), `toOrdersConfig`, `deriveQueueId`,
    `orderFlowWitnessType` and `describePredictError`, plus the generated bindings of both new
    packages.
  - `SessionsContract` gains `enqueueExactQuantity`, `enqueueExactAmount`, `enqueueExactCost` and
    `enqueueRedeemOpen`, which take the order desk and the queue registry and need Sessions v3.
  - The cost previews take the admin-set `feeIncentiveSubsidyRate`.
  - Deprecated: the immediate `mint`, `mintAmount`, `mintCost` and `redeem` builders, their thunks
    and Sessions wrappers, `read.quoteRedeem` and `FEE_INCENTIVE_SUBSIDY_RATE`. Predict v4 always
    aborts the immediate trades.

  The Testnet config records the Testnet rollout: Predict v5, Sessions v3,
  `deepbook_predict_orders`, `deepbook_predict_math`, the order desk, the queue registry and the
  Pyth Lazer state. The Mainnet config doesn't record delayed execution yet, so the queued surface
  needs a custom `config` there until the Mainnet rollout is synced. `sync-deployment` now reads the
  two new packages' `Published.toml` records.

## 2.6.8

## 2.6.7

### Patch Changes

- 2ba222a: Upgrade axios to require version 1.20.0 or later, fixing reported security
  vulnerabilities.

## 2.6.6

## 2.6.5

### Patch Changes

- d5d8f63: Point Predict at its latest published packages and pick up `add_usdc_to_plp`:

  - Mainnet Predict: `0x1cacb9bf…a837` (v2) →
    `0x08fa3ef1b047d87b0b4ce1c7e5f8b42d8bfdea9a70547efe3cce5d8d6e47ee53` (v3)
  - Testnet Predict: `0x30a03c33…25ce` (v2) →
    `0x6c2c2d3c2394cf282f4b8462a99c2e814bda0c223796de10b47b36d35fd878f5` (v4)

  `predictV1` keeps the original ids, and Sessions is already on its latest package on both
  networks.

  The regenerated Predict bindings add `plpMoveCalls.addUsdcToPlp`, which pays USDC into the pool
  without minting PLP, and the `vaultEvents.UsdcAddedToPlp` event layout.

## 2.6.4

## 2.6.3

## 2.6.2

## 2.6.1

### Patch Changes

- b042290: Bump the mainnet Predict and Sessions package ids to their latest published-at:

  - Predict: `0x89aea622…bbba` →
    `0x1cacb9bf963b1b62139d0ad94cc8ce0d9e5792011932df9925ce07aa3c70a837`
  - Sessions: `0x9a068bef…5e2a` →
    `0xec678aee98cd161bdce62ff3dcf4893574df29d927dc8b573f6b4563ec960a1a`

  `predictV1` and `sessionsPackageIdV1` keep the original ids, since the type tags built from them
  (`coinTypes.plp`, Predict event types, the `DataKey<…::sessions::SessionsApp>` dynamic field) stay
  with the package their types were published under.

## 2.6.0

### Minor Changes

- 785e9cd: Add `predict.cost`: client-side all-in trade cost for Predict, with no chain call.
  `cost.mintCost` returns the exact debit a mint makes (premium plus the trading, builder,
  congestion and inventory-impact fees, net of any sponsor subsidy), `cost.mintCostForBudget` sizes
  a lot-rounded fill whose all-in cost fits a budget — the `expiry_market::mint_exact_cost` lot
  search, run locally — and `cost.redeemLiveProceeds` returns what closing a live position credits.
  The fee components (`tradingFee`, `builderFee`, `feeIncentiveSubsidy`, `congestionPenaltyRate`,
  `mintInventoryImpact`, `closeInventoryImpact`, `expiryFeeMultiplier`, `bernoulliFeeRate`) and the
  order-ID helpers (`decodeOrderRange`, `orderStrikes`) are exported alongside. The arithmetic is an
  exact integer port of the deployed fee path: matching every execution input yields the same raw
  amounts. Invalid unsigned inputs are rejected, and enabled inventory impact requires book data.
  Budget sizing preserves the contract's best-effort maximum-payout fallback, which can miss a
  larger admissible fill or reject a quantity floor that another fill could meet.
  `exactProbabilities` identifies raw probability inputs, without certifying their source or state
  freshness. These helpers provide local previews; `read.quoteMint` / `read.quoteRedeem` simulate
  the actual transaction against account and market state before submission.

  Update Testnet Predict/Sessions to v2 and preserve `predictV1` / `sessionsPackageIdV1` for
  existing structs, events and dynamic-field keys. Generate call targets and type origins from
  Published.toml alongside the initial deployment manifest; Mainnet remains v1. Add `tx.mintCost`,
  `read.quoteMintCost`, `SessionsContract.mintExactCost` and regenerated v2 Move bindings.

  Expose payout multiple and budget/cap/unspent amounts for mint previews, plus net proceeds per
  contract, raw range probability, and optional validated remaining quantity for live-redeem
  previews.

## 2.5.1

## 2.5.0

### Minor Changes

- 5eda7bd: Point Predict at the fresh Testnet and Mainnet deployments and pick up the per-leg range
  fee.

  Both networks were redeployed, so every Predict package and object id moved. The deployment
  records are regenerated from the deploy tooling's own manifests rather than hand-edited.

  `pricing::range_price` now returns a `RangePrice` carrying both boundary probabilities instead of
  a single `u64`, so the chain can charge each leg of a range its own fee and floor. The generated
  bindings gain `RangePrice` with `lower_up`, `higher_up` and `probability` accessors,
  `block_scholes_store` gains `recent_spot_at` over a bounded spot-read ring buffer, and
  `read.price` composes `probability()` onto each `range_price` result. The combined range
  probability is unchanged (`lower_up.saturating_sub(higher_up)`), so `read.price` returns the same
  numbers it always did.

  Callers using the generated `pricing.rangePrice` binding directly and parsing its return as a
  `u64` must now read `probability()` (or the individual legs) from the returned struct.

## 2.4.2

## 2.4.1

## 2.4.0

### Minor Changes

- b07659a: Predict: export the generated move-call bindings from `@mysten/deepbook-v3/predict`, the
  way `/account` already exports `accountMoveCalls`. Each `client.predict.tx.*` builder returns a
  finished `Transaction`, so a Predict call could not join a PTB the caller was building — creating
  an account, funding it and queueing a PLP supply in one transaction meant hand-writing
  `plp::request_supply` as a raw `moveCall`. Every Predict module with a callable function is now
  reachable as a namespace of transaction thunks (`plpMoveCalls`, `expiryMarketMoveCalls`,
  `predictAccountMoveCalls`, `protocolConfigMoveCalls`, `registryMoveCalls`, `builderCodeMoveCalls`,
  `marketManagerMoveCalls`, `pricingMoveCalls`, `rangeCodecMoveCalls`, and the cap modules),
  alongside the event layouts (`vaultEvents`, `orderEvents`, `configEvents`, `builderCodeEvents`).
  Pass `config: toGeneratedConfig(cfg)` and the shared objects fill themselves in; owner-authorized
  calls take an `Auth` from `generateAuth(cfg)`. Additive only: no existing export changes.

### Patch Changes

- ee8df5d: Predict docs: document both recorded deployments. `PREDICT.md` and the README now
  describe the `deepbook-predict-mainnet` and `deepbook-predict-testnet` records that `getConfig`,
  `getDeployment`, `getUnits`, `getAccountConfig`, and `getSessionsConfig` resolve, the quote coin
  per network (Circle native USDC on mainnet, a mintable test coin that displays as DUSDC on
  testnet, read from `quoteCoinType`), the `side: 'range'` descriptor arm, which decoders have
  plural forms, what is exported for PTB composition, that `read.markets()` returns
  live-and-not-yet-settled markets, and the `supplyPlp` / `withdrawPlp` floor options as shipped.
  Documentation only; no runtime change.

## 2.3.0

### Minor Changes

- 7b47a9a: Predict: let `supplyPlp` and `withdrawPlp` set a price floor. Both hard-pinned the
  request's floor to 0, so the SDK could only ever queue an LP request that accepts whatever mark
  the next pool flush quotes. They now take an optional third argument — `{ minPlpOut }` (raw
  `bigint` shares) and `{ minUsdcOut }` (USD decimals) — defaulting to the previous no-floor
  behaviour.
- 1e2f728: Add Mainnet deployment ids for Predict, sessions and the account primitive. `getConfig`,
  `getAccountConfig`, `getSessionsConfig`, `getUnits` and `getDeployment` now resolve `'mainnet'`
  instead of throwing, and `MAINNET_CONFIG` / `MAINNET_DEPLOYMENT` / `MAINNET_UNITS` are exported
  alongside their testnet counterparts. `DeployedNetwork` widens to `'testnet' | 'mainnet'`.

  Mainnet settles in Circle's native USDC
  (`0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC`). The in-repo
  test currency is never published to Mainnet, so the collateral type resolves to Circle's package
  there and to the DeepBook test coin on Testnet — read `quoteCoinType` from the config rather than
  assuming either.

  The ids are generated from the deploy tooling's own Mainnet manifest, like Testnet's, so both
  networks move together on a redeploy and cannot drift apart across subpaths.

## 2.2.0

### Minor Changes

- e7c8014: Target the `deepbook-predict-testnet` deployment. Every testnet id the SDK ships changes
  — the Predict, account and sessions packages and their shared objects — so `getConfig('testnet')`,
  `getAccountConfig('testnet')`, `getSessionsConfig('testnet')` and `TESTNET_CONFIG` all resolve
  against the new deployment, and `getDeployment('testnet')` reports it by name and source commit.
  Anything pinned to the previous testnet deployment's ids will not find its accounts, positions or
  markets there; they are separate deployments, not an upgrade.

  The settlement collateral is renamed upstream from `dusdc::dusdc::DUSDC` to `usdc::usdc::USDC`, so
  one Move module path resolves on both testnet and mainnet and mainnet can link native USDC by
  address alone. `quoteCoinType` carries the new type. The testnet coin keeps the `DUSDC` display
  symbol, which is what distinguishes the mintable test coin from native USDC in wallets and
  explorers — read `quoteCoinType` rather than assuming a symbol or a type.

  The exported surface is otherwise unchanged: no symbol is added, removed or re-typed, and the
  renamed Move argument (`min_usdc_out`) is internal to the transaction builders.

## 2.1.4

## 2.1.3

## 2.1.2

## 2.1.1

## 2.1.0

### Minor Changes

- 31f4bf1: Add the `@mysten/deepbook-v3/account` subpath, which now hosts the shared on-chain
  account primitive (`AccountContract`, the generated `account` bindings, and the `Account` /
  `AccountWrapper` BCS structs). The primitive is shared infrastructure — DeepBook's core account
  wrapper and DeepBook Predict both build on the same Move package — so it lives alongside spot and
  margin rather than in either consumer.

  The package root's export surface is unchanged: `@mysten/deepbook-v3` exports exactly what it did
  before, and subpaths are separate module graphs, so importing `/account` does not load spot or
  margin code. Note that `Account` exported from the root remains
  `@deepbook/core::account::Account`; the account primitive's `Account` is a different type and is
  reachable only from `/account`.

  Documenting a second entry point changes the generated API-reference layout: TypeDoc now emits an
  `index` module alongside `account`, so existing deepbook-v3 doc pages gain an `index.` segment in
  their names. External links into the published reference will need updating; nothing in this repo
  links to them.

  `/account` also exports `getAccountConfig(network)`, the deployed ids for the shared account
  package, so consumers do not transcribe them. It reads a record generated from the deploy
  tooling's own manifest, which every subpath shares — `getDeployment(network)` reports which
  deployment and source commit those ids came from. Testnet only for now; other networks throw
  rather than returning placeholder ids.

  This release also marks the package `sideEffects: false`. No module in `src` has an import side
  effect, so the only emitted-output change is that pure re-export modules are now tree-shaken out
  of the bundle rather than imported for effect.

  `@mysten/deepbook-account` is superseded. Its final release, `0.1.0`, is self-contained and keeps
  working, but it will not be updated — import from `@mysten/deepbook-v3/account` instead.

- 31f4bf1: Add the `@mysten/deepbook-v3/predict` subpath, completing the consolidation of the
  DeepBook SDKs behind one package. DeepBook Predict — market discovery, quotes, mint/redeem/claim,
  PLP, typed receipts, and the client-side board pricer — now ships from here rather than from a
  separate package.

  The package root is unchanged, and subpaths remain separate module graphs: importing `/predict`
  loads no spot or margin code.

  `@mysten/deepbook-predict` is superseded. Its last published release keeps working for anyone
  already on it, but it will not be updated — import from `@mysten/deepbook-v3/predict` instead.

  Predict's testnet ids now come from the shared generated deployment record instead of a
  hand-written literal, so `/account`, `/sessions` and `/predict` cannot drift apart across a
  redeploy. `getConfig(network)` and `TESTNET_CONFIG` keep their values, but `PredictConfig` gains
  two required fields — `coinTypes` (`plp`, `deep`) and `units` (`positionLotSize`,
  `fixedPointScale`, `quoteCoinDecimals`, `positionQuantityDecimals`). Consumers using the shipped
  config are unaffected; anyone hand-building a config for their own deployment must add both;
  `getDeployment(network)` reports which deployment and source commit they came from.

- 31f4bf1: Add the `@mysten/deepbook-v3/sessions` subpath: time-limited trading sessions over a
  canonical Account. An owner authorizes an ephemeral address to act for the Account until a fixed
  expiry, and the session key never holds a reusable `Auth` — each wrapper mints app authorization
  internally and consumes it in the same call.

  `SessionsContract` covers the session lifecycle (`authorizeSession`, `revokeSession`,
  `sessionExpirationMs`) and the DeepBook Predict wrappers (`mintExactQuantity`, `mintExactAmount`,
  `redeemLive`, `redeemSettled`), plus `deriveAccountId` / `deriveSessionsFieldId` /
  `decodeSessions` / `activeSessions` for enumerating an Account's grants — there is no bulk
  on-chain read, and expired grants keep occupying slots against a 20-address cap.

  The DeepBook spot session wrappers are generated and reachable from `sessionsMoveCalls`, but are
  not wrapped on `SessionsContract` yet — the surrounding spot-over-Account workflow is not
  modelled.

  The package root is unchanged, and subpaths are separate module graphs — importing `/sessions`
  loads no spot or margin code.

  `getSessionsConfig(network)` returns the deployed sessions ids — package, `SessionsConfig` object,
  and the account ids sessions shares — plus `deepbookRegistry` and the `deepbook_core_account`
  package id for the generated spot wrappers. It reads the same generated deployment record
  `/account` and `/predict` use, so a redeploy moves every subpath together. Testnet only for now;
  other networks throw.

## 2.0.1

### Patch Changes

- f2f7048: Upgrade workspace dependencies, remove the legacy dapp-kit package, and migrate the
  remaining consumers to the current gRPC-based dapp-kit. Remove the legacy API reference while
  retaining the migration guide and deprecation notice.
- 67386be: Bump mainnet `LIQUIDATION_PACKAGE_ID` to the `margin_liquidation` publication carrying
  the upgraded-Pyth entrypoints: `0xf17bff1b…` →
  `0xba2b39c026650fef52038c93c526fc5314a4286318a0d2a7054b65815178fb74`. This is what gives
  `liquidateBase` and `liquidateQuote` a mainnet target: they call
  `liquidation_vault::liquidate_base_upgraded` / `liquidate_quote_upgraded`, which the previous
  mainnet publication (v4, `0xf17bff1b…`) did not carry. Every other vault builder takes no oracle
  and is unaffected. The upgrade is live on chain as v5 and keeps the lineage — the new package's
  `LIQUIDATION_VAULT` type is still defined by the original `0x73c59388…`, so the deployed vault
  needs no migration.

## 2.0.0

### Major Changes

- 504644c: Move the margin surface onto Pyth's upgraded Core and drop the legacy Pyth surface.

  Pyth is replacing Core with a separately published Sui package rather than upgrading it in place,
  so its `PriceInfoObject` is a distinct Move type that the existing margin entrypoints can never
  accept — their signatures are frozen by the `compatible` upgrade policy. `deepbook_margin`
  therefore exposes the upgraded surface as parallel modules (`margin_manager_upgraded`,
  `pool_proxy_upgraded`) and `margin_liquidation` as parallel entrypoints
  (`liquidate_base_upgraded`, `liquidate_quote_upgraded`), all under the same function names.

  **This SDK now targets only the upgraded deployment.** Legacy Core is being retired, so carrying
  both was short-lived complexity. It carries no legacy/upgraded switch — the parallel surfaces were
  weighed during development and dropped before release, so there is nothing to migrate off. `pyth`
  is the upgraded deployment's state objects and `priceInfoObjectId` is its price object. Every
  margin method keeps its name and signature; what changes is the module each one targets and the
  price object it passes. Entrypoints that take no oracle — manager creation, repayment, referrals,
  cancels, staking, governance and every getter — stay on the base modules, which is the only place
  they exist.

  **Requires the upgraded margin package on the target network, enabled.** The upgraded modules do
  not exist in earlier `deepbook_margin` publications, so this release must not be used against a
  network whose margin package predates them. Publication alone is not enough: each package asserts
  its own `MARGIN_VERSION` against the registry's allowed versions, so the version must also be
  enabled on that network's `MarginRegistry` or every entrypoint aborts `EPackageVersionDisabled`.

  **`liquidateBase` / `liquidateQuote` have no mainnet target yet.** They call
  `liquidation_vault::liquidate_base_upgraded` / `liquidate_quote_upgraded`, which exist in
  `margin_liquidation` on testnet but not in the current mainnet publication. Every other vault
  method takes no oracle and is unaffected.

  Price update data is now fetched from Hermes v2 (`/v2/updates/price/latest`) instead of the
  deprecated v1 `/api/latest_vaas`; the update bytes are identical, though the response envelopes
  differ. The client gains a `pythAccessToken` option (and `pyth.accessToken` beneath it), sent as
  `Authorization: Bearer`: the endpoint serving the upgraded Core answers 401 without it, so price
  updates need either this or a `pyth.hermesEndpoint` that supplies credentials itself. The name
  converges with the in-flight `@mysten/suins` Pyth migration (ts-sdks#1158), which takes the same
  credential — that is unpublished, so a convergence target rather than an existing convention. It
  composes with the built-in Pyth state objects rather than replacing them the way a whole `pyth`
  config does. Supply the token at runtime; no credential ships with the SDK. Consumers who supply
  none are intended to fall back to a DeepBook-operated proxy, which is not deployed yet, so that
  path currently throws a `ConfigurationError` naming the field to set.

  Package ids move to `deepbook_margin` v16 on testnet and v7 on mainnet, and `margin_liquidation`
  v4 on testnet; mainnet `margin_liquidation` is unchanged, having no upgraded publication. Testnet
  coins carry the feed ids its migrated `MarginRegistry` is configured with. DBTC is testnet's
  wrapped BTC and takes Crypto.XBTC/USD, the same feed mainnet XBTC uses, the upgraded deployment
  carrying no distinct DBTC feed. Mainnet XBTC's upgraded price object was created on 2026-08-17 and
  is included, so all six mainnet-configured coins now have one.

## 1.6.7

## 1.6.6

## 1.6.5

### Patch Changes

- 19e85a3: Regenerate contract bindings with the latest codegen utils template

## 1.6.4

## 1.6.3

## 1.6.2

## 1.6.1

### Patch Changes

- e39857a: Internal refactor: the core transaction builders (`deepbook`, `balanceManager`,
  `deepbookAdmin`, `flashLoans`, `governance`) now delegate to generated `@deepbook/core` codegen
  bindings with named arguments instead of positional `moveCall` argument arrays, removing the risk
  of transposing same-typed arguments. This completes the codegen migration begun for the margin
  surface; unit conversion, coin plumbing, and trade-proof composition stay in the facade, so it is
  a pure construction-layer change.

  No API or behavior change: every migrated builder emits a byte-identical transaction, verified by
  a new PTB snapshot test (`test/unit/transactions/core-ptb-snapshot.test.ts`). Two builders whose
  calls don't map to a generated binding (`createAndShareBalanceManager` — `balance_manager::new` is
  called zero-arg but the current-source binding adds an `Owner`; and `shareBalanceManager` — a
  `0x2::transfer` framework call) are intentionally left as positional `moveCall`s.

## 1.6.0

### Minor Changes

- 9e40665: Sync with deepbook_margin v6.

  New margin entry points (live on mainnet at `0x8af25e44`):

  - `poolProxy.placeMarketOrderAndRepayLoan`, `poolProxy.placeReduceOnlyLimitOrderAndRepayLoan`,
    `poolProxy.placeReduceOnlyMarketOrderAndRepayLoan` — repay the loan from the fill proceeds
    before the risk check, so the gate is the net post-repay `risk_ratio` rather than the borrow
    floor.
  - `marginTPSL.executeConditionalOrdersV3` — deleveraging conditional execution, letting a
    stop-loss fire in the `liquidation..min_borrow` band. `executeConditionalOrders` (v2) is
    unchanged.
  - `marginAdmin.setMinOpenRiskRatio` and `getMinOpenRiskRatio` — the position-opening risk floor,
    distinct from the borrow floor.

  These builders are constructed via generated codegen bindings with **named** arguments rather than
  positional `moveCall` arrays — `deepbook_margin` was added to `sui-codegen.config.ts`, so
  `src/contracts/deepbook_margin` is now generated. The human-unit conversion (`convertQuantity`,
  `convertPrice`, `convertRate`) stays in the facade; codegen handles call construction, removing
  the risk of transposing same-typed arguments (e.g. base/quote oracles and margin pools).

  Package IDs updated to match `Published.toml`: mainnet margin v5 → v6, testnet core v17 → v20,
  testnet margin → v14. Testnet `MARGIN_V1` (used to build `MarginApp` type tags) pointed at an
  abandoned package lineage and is corrected to the real original ID `0xb8620c24…`.

### Patch Changes

- 6af1e2e: Internal refactor: the margin transaction builders now delegate to generated codegen
  bindings with named arguments instead of positional `moveCall` argument arrays, removing the risk
  of transposing same-typed arguments (base/quote oracles, base/quote margin pools).
  `deepbook_margin` and `margin_liquidation` were added to `sui-codegen.config.ts`; human-unit
  conversion and coin plumbing stay in the facade, so this is a pure construction-layer change.

  No API or behavior change: every migrated builder emits a byte-identical transaction, verified by
  a new PTB snapshot test (`test/unit/transactions/margin-ptb-snapshot.test.ts`). Two builders whose
  command/input interleaving does not reduce cleanly (`marginPool.supplyToMarginPool`,
  `marginAdmin.revokeMaintainerCap`) are intentionally left as positional `moveCall`s.

## 1.5.9

### Patch Changes

- c4cc6ed: Fix `MarginManagerContract.repayBase` and `repayQuote` mishandling `amount = 0`. The
  previous truthy guard (`amount ? … : null`) collapsed `0` onto the `Option::None` branch, causing
  `repay_base(mgr, 0)` / `repay_quote(mgr, 0)` to repay the full outstanding debt using whatever
  balance of the asset was held in the balance manager — rather than being a no-op as the numeric
  argument suggests. The check now uses `amount !== undefined`, so `0` correctly serializes as
  `Option::Some(0)` and only an omitted argument becomes `None`. Also switches the `Option<u64>`
  argument from `tx.object.option` to `tx.pure.option` to avoid an extra `0x1::option::some/none`
  PTB command, matching `marginLiquidations.ts` and `marginPool.ts`.

## 1.5.8

## 1.5.7

## 1.5.6

## 1.5.5

## 1.5.4

## 1.5.3

## 1.5.2

## 1.5.1

## 1.5.0

### Minor Changes

- bbf63cb: Add `typeTag` and `resolveTypeTag` methods to the generated `MoveStruct`, `MoveEnum`, and
  `MoveTuple` classes.

  - `typeTag(options?)` builds the type tag string for a generated type. `typeArguments` is the full
    positional list of type arguments in Move declaration order; each entry is a type tag string,
    another `typeTag()` result, or a BCS type (its name is used). Types with unfilled phantom
    parameters require `typeArguments` at compile time, and argument arity is validated at runtime.
  - `resolveTypeTag({ client, ... })` builds the tag, resolves MVR names through
    `client.core.mvr.resolveType`, and returns the normalized address-only form suitable for queries
    and comparisons against on-chain data.

- bbf63cb: Updated dependencies

### Patch Changes

- Updated dependencies [bbf63cb]
  - @mysten/bcs@2.1.0

## 1.4.1

### Patch Changes

- bc99264: Bump mainnet `LIQUIDATION_PACKAGE_ID` to the latest published-at: `0x55718c06…41b8` →
  `0xf17bff1bf21e9587acc5708714e520aa967f82f256f626938a33c4109b08adb9`.

## 1.4.0

### Minor Changes

- e68bd36: Align margin SDK with `deepbook_margin` v5 on-chain source:
  - Switch `pool_proxy` order placement builders (`placeLimitOrder`, `placeMarketOrder`,
    `placeReduceOnlyLimitOrder`, `placeReduceOnlyMarketOrder`) to the `_v2` Move entries. The v1
    entries are deprecated in the v5 package and abort with `EDeprecatedUseV2`. The v2 variants take
    additional `base_margin_pool`, `quote_margin_pool`, `base_oracle`, and `quote_oracle` arguments
    so the chain can enforce a post-trade `risk_ratio` invariant (borrow-floor for normal orders,
    monotonic improvement for reduce-only).
  - The reduce-only v2 entries dropped the `DebtAsset` generic and the explicit
    `MarginPool<DebtAsset>` parameter; the package now dispatches on
    `margin_manager.has_base_debt()` to pick the typed pool from the
    `(base_margin_pool, quote_margin_pool)` pair. The SDK builders no longer take a debt-side margin
    pool or third type argument.
  - Switch `executeConditionalOrders` to `margin_manager::execute_conditional_orders_v2`, which adds
    `base_margin_pool`/`quote_margin_pool` arguments and enforces the same post-fill solvency check.
  - Fix `claimRebate` to target the actual Move entry name `pool_proxy::claim_rebates`. The previous
    target did not exist on-chain.
  - Rename `MarginPoolConfigParams.referralSpread` to `protocolSpread`. The Move field was renamed
    upstream in the `protocol_config` module; the old SDK name was positionally correct but
    misleading.
  - Add `registerMarginManager` and `unregisterMarginManager` builders.
  - Add read-only margin_manager builders exposed in newer source: `balanceManagerId`,
    `getBalanceManagerReferralId`, `accountExists`, `account`, `accountOpenOrders`,
    `getAccountOrderDetails`, `lockedBalance`, `canPlaceLimitOrder`, `canPlaceMarketOrder`.
  - Add `MarginAdminContract.setPriceTolerance`, `setMaxPriceAge`, and `setMaxOrderTtl` builders for
    the per-pool oracle and order-TTL admin entries on `margin_registry`. The `setMaxOrderTtl` entry
    configures the per-pool `max_order_ttl_ms` cap that `pool_proxy::place_limit_order_v2` and
    `place_reduce_only_limit_order_v2` use to clamp `expire_timestamp`.
  - Add `DeepBookAdminContract.mintCorePauseCap`, `revokeCorePauseCap`,
    `disableVersionWithCorePauseCap`, and `corePauseCaps` builders for the new
    `DeepbookCorePauseCap` emergency-pause flow in the core spot `registry`. These mirror the
    existing margin-side pause-cap builders.
  - Bump mainnet `MARGIN_PACKAGE_ID` to
    `0x124bb3d8105d6d301c0d40feaa54d65df6b301e4d8ddd5eb8475b0f8a18cff2e` to track the latest margin
    package upgrade on mainnet.
  - Bump mainnet `DEEPBOOK_PACKAGE_ID` to
    `0x0e735f8c93a95722efd73521aca7a7652c0bb71ed1daf41b26dfd7d1ff71f748` to track the latest core
    deepbook package upgrade on mainnet.

## 1.3.6

### Patch Changes

- f7de3e5: Restore docs in published tarballs.
- Updated dependencies [f7de3e5]
  - @mysten/bcs@2.0.5
  - @mysten/sui@2.16.2

## 1.3.5

### Patch Changes

- 9e067cf: Validate the new per-package release flow end-to-end across every public @mysten package.
  No functional changes — empty patch bump to force the orchestrator to dispatch every
  release-<pkg>.yml workflow with `dry_run=false` so each package publishes via OIDC trusted
  publishing.
- Updated dependencies [9e067cf]
  - @mysten/bcs@2.0.4
  - @mysten/sui@2.16.1

## 1.3.4

### Patch Changes

- 75a32c1: Bump `axios` to `^1.16.0` to address security advisories (CVE-2025-62718 and related
  prototype pollution issues).

## 1.3.3

### Patch Changes

- bb8d26a: Fix three latent type errors in the generated `utils/index.ts` that surfaced for
  consumers with `noUncheckedIndexedAccess: true`:
  - `getPureBcsSchema(structTag.typeParams[0])` passed `TypeTag | undefined` to a parameter typed
    `string | TypeTag`. Now null-checks the inner tag before passing it.
  - `argTypes[i]` was redundantly re-indexed inside a `for…of entries()` loop, returning
    `string | null | undefined` and being passed back to `getPureBcsSchema`. Switched to the loop
    variable, which is `string | null`.
  - `MoveStruct.get()` returned the destructured `[res]` from `getMany([objectId])` without
    asserting it was defined. Now throws if no object was returned.

  The codegen test suite gained a `tsc`-based check that compiles the generated `utils/index.ts`
  under strict + `noUncheckedIndexedAccess`, so embedded-template type bugs are caught before
  release rather than by downstream consumers.

  All consumer packages (`payment-kit`, `pas`, `walrus`, `suins`, `deepbook-v3`, `kiosk`) have been
  regenerated with the fix.

## 1.3.2

### Patch Changes

- c96956e: Regenerate generated Move types against the latest contract sources. The generated
  `utils/index.ts` `GetOptions` / `GetManyOptions` are now exported as type aliases (intersection)
  instead of interfaces. SuiNS gains `SubnamePrunedEvent`, `pruneExpiredSubname`, and
  `pruneExpiredSubnames`.

## 1.3.1

### Patch Changes

- e149b58: Set the transaction sender on all read-only query methods so they work under
  `SuiJsonRpcClient`. Previously these queries built a `Transaction` without calling
  `tx.setSender(...)`, which was tolerated by the gRPC core client (it substitutes `0x0` for a
  missing sender during resolution) but failed under JSON-RPC with `Missing transaction sender`.
  JSON-RPC is scheduled to be sunset on July 31, 2026 — migrate to `SuiGrpcClient` when possible.
- e9570a1: Regenerated Move call bindings. Parameters that can't accept a plain value (non-`key`
  struct or enum, `vector<KeyStruct>`, etc.) are now typed as `TransactionArgument`, forcing callers
  to pass a prior move-call result or `tx.makeMoveVec(...)`. Passing a bare string or array for
  these parameters was always broken at runtime.
- Updated dependencies [6adc085]
- Updated dependencies [b1bf49a]
  - @mysten/sui@2.16.0

## 1.3.0

### Minor Changes

- 993aa1f: Add `cancelLiveOrder` and `cancelLiveOrders` transaction builders that skip order ids not
  currently in the balance manager's open orders (already filled, cancelled, expired-and-swept, or
  not owned by this BM) instead of aborting. Also updates mainnet `DEEPBOOK_PACKAGE_ID` to
  `0xf48222c4e057fa468baf136bff8e12504209d43850c5778f76159292a96f621e`.

## 1.2.2

### Patch Changes

- 6fd995d: Use type imports in generated code for verbatimModuleSyntax compatibility

## 1.2.1

### Patch Changes

- 1e0aef8: Fix missing DebtType type argument in marginManager.liquidate() to match the on-chain
  function's 3-type-parameter signature.
- Updated dependencies [43e69f8]
- Updated dependencies [e51dc5d]
  - @mysten/bcs@2.0.3
  - @mysten/sui@2.8.0

## 1.2.0

### Minor Changes

- c868e59: Accept `bigint` parameters for all financial values (quantities, prices, rates) alongside
  existing `number` inputs, and extract query methods into domain-specific modules.

### Patch Changes

- Updated dependencies [2faaf69]
  - @mysten/sui@2.7.0

## 1.1.5

### Patch Changes

- cc33343: Add USDSUI pools
- Updated dependencies [e8f985e]
  - @mysten/sui@2.5.1

## 1.1.4

### Patch Changes

- c95bbc9: Add USDSUI coin to mainnet constants

## 1.1.3

### Patch Changes

- 7a2ac9a: XBTC margin pool

## 1.1.2

### Patch Changes

- 770536f: XBTC price feeds added

## 1.1.1

### Patch Changes

- 380d5b1: Fix getMarginManagerBalanceManagerId

## 1.1.0

### Minor Changes

- 0be1a79: Add support for custom networks (localnet, devnet) via optional `packageIds` parameter

### Patch Changes

- 9382cd7: Validations for custom package configs
- Updated dependencies [9ab9a50]
- Updated dependencies [1c97aa2]
  - @mysten/sui@2.5.0

## 1.0.12

### Patch Changes

- 6add1b1: New Liquidation Package ID (Internal usage)

## 1.0.11

### Patch Changes

- d13c13e: Add SUIUSDE margin pool

## 1.0.10

### Patch Changes

- 05765dc: checkManagerBalancesWithAddress and getMarginManagerBalances added to support querying
  balnces in a single RPC call for multiple managers and assets

## 1.0.9

### Patch Changes

- 5b220df: Update USDE to SUIUSDE in constants

## 1.0.8

### Patch Changes

- 63ca077: Margin ID Update
- 3d53583: Improve typing of generated bcs tuples
- 1232202: New method checkManagerBalanceWithAddress. Pyth config for USDE.

## 1.0.7

### Patch Changes

- 99d1e00: Add default export condition
- Updated dependencies [99d1e00]
  - @mysten/bcs@2.0.2
  - @mysten/sui@2.3.2

## 1.0.6

### Patch Changes

- ad9a3a4: Price added function

## 1.0.5

### Patch Changes

- 65550fe: Update executeConditionalOrders for composability

## 1.0.4

### Patch Changes

- b1bf6fd: Batch pyth price feed updates, stale feeds older than 30 seconds
- Updated dependencies [265ec25]
  - @mysten/sui@2.3.1

## 1.0.3

### Patch Changes

- bb40431: USDE Pools added

## 1.0.2

### Patch Changes

- 3651a5f: Fix Pyth price table lookup to use getDynamicObjectField and correctly parse Wormhole
  state using WormholeState schema
- 1baa679: Margin manager states function

## 1.0.1

### Patch Changes

- d83c831: USDE coin

## 1.0.0

### Major Changes

- e00788c: ### Breaking Changes

  **Renamed `env` option to `network`**

  The `env` option has been renamed to `network` throughout the SDK to align with the standard
  `SuiClientTypes.Network` type used across other packages.

  ```diff
  const dbClient = new DeepBookClient({
     address: '0x...',
  -  env: 'mainnet',
  +  network: 'mainnet',
     client: suiClient,
  });
  ```

  **Removed `Environment` type export**

  The `Environment` type has been removed. Use `SuiClientTypes.Network` from `@mysten/sui/client`
  instead:

  ```diff
  -import { Environment } from '@mysten/deepbook-v3';
  +import type { SuiClientTypes } from '@mysten/sui/client';

  -const env: Environment = 'mainnet';
  +const network: SuiClientTypes.Network = 'mainnet';
  ```

  **Client extension auto-detects network**

  The `deepbook()` client extension function no longer accepts a `network` option. The network is
  automatically derived from the client:

  ```diff
  const client = new SuiGrpcClient({ network: 'mainnet', baseUrl: '...' }).$extend(
     deepbook({
       address: '0x...',
  -    env: 'mainnet',  // No longer needed - auto-detected from client
     }),
  );
  ```

  **Network validation**

  The SDK now throws an error if the network is not `'mainnet'` or `'testnet'`, as DeepBook only
  supports these networks.

### Minor Changes

- e00788c: Update to use SuiJsonRpcClient instead of SuiClient

  Updated all type signatures, internal usages, examples, and documentation to use
  `SuiJsonRpcClient` from `@mysten/sui/jsonRpc` instead of the deprecated `SuiClient` from
  `@mysten/sui/client`.

### Patch Changes

- Updated dependencies [e00788c]
- Updated dependencies [e00788c]
- Updated dependencies [e00788c]
- Updated dependencies [e00788c]
- Updated dependencies [e00788c]
- Updated dependencies [e00788c]
- Updated dependencies [e00788c]
- Updated dependencies [e00788c]
- Updated dependencies [e00788c]
- Updated dependencies [e00788c]
- Updated dependencies [e00788c]
- Updated dependencies [e00788c]
- Updated dependencies [e00788c]
- Updated dependencies [e00788c]
  - @mysten/sui@2.0.0
  - @mysten/bcs@2.0.0

## 0.28.3

### Patch Changes

- d381366: Margin manager permissionless withdrawal
- d25237e: Use balance manager ID for withdrawPermissionless

## 0.28.2

### Patch Changes

- 24b41ea: Update rate limit in SDK

## 0.28.1

### Patch Changes

- 1434c65: Withdraw all fix

## 0.28.0

### Minor Changes

- c457d15: Allow deposit into margin pool during initialization. Allow deposit into margin pool
  using TransactionArgument. Rounding improvements. Export constants in SDK.

## 0.27.1

### Patch Changes

- dd4b1c3: USDT/USDC pool

## 0.27.0

### Minor Changes

- 080f16c: Price Info Objects for mainnet

## 0.26.9

### Patch Changes

- 4e8fdb5: Margin Pool IDs

## 0.26.8

### Patch Changes

- ce8ccf2: New package IDs

## 0.26.7

### Patch Changes

- ce90642: Protocol config function updates

## 0.26.6

### Patch Changes

- 7e33816: MarginPoolCap as transaction param

## 0.26.5

### Patch Changes

- 678dda6: Mainnet margin IDs

## 0.26.4

### Patch Changes

- 86d1c96: Mainnet feed and currency IDs

## 0.26.3

### Patch Changes

- 9bb895e: Revoke TradeCap

## 0.26.2

### Patch Changes

- 882d988: Add LZWBTC_USDC pool to SDK

## 0.26.1

### Patch Changes

- 6b8f03d: LZWBTC coin

## 0.26.0

### Minor Changes

- ef523b8: Take Profit Stop Loss support

### Patch Changes

- 396fb3f: Bump margin package for testing

## 0.25.0

### Minor Changes

- 74b9509: Liquidation Logic

## 0.24.0

### Minor Changes

- 749318e: Improved referral system

## 0.23.2

### Patch Changes

- 4ace43a: Update DEEP testnet feed

## 0.23.1

### Patch Changes

- 0ba3834: BTC setup for testnet

## 0.23.0

### Minor Changes

- 3fff516: DeepBook Core Package Upgrade (V4)

## 0.22.2

### Patch Changes

- Updated dependencies [29e8b92]
  - @mysten/sui@1.45.2

## 0.22.1

### Patch Changes

- Updated dependencies [e3811f1]
  - @mysten/sui@1.45.1

## 0.22.0

### Minor Changes

- 911ff24: New deposit function params and testnet package

## 0.21.0

### Minor Changes

- ab5ff6c: New testnet core package upgrade, margin package redeployment

## 0.20.4

### Patch Changes

- bf5773f: Improve read only functions and add manager state function
- d8355d7: Admin withdraw referral fees

## 0.20.3

### Patch Changes

- a2f84a3: Update margin withdraw referral function
- e0490df: Fix deepbook admin function
- Updated dependencies [88bdbac]
  - @mysten/sui@1.45.0

## 0.20.2

### Patch Changes

- c95ff1a: Update DeepBook and margin package IDs

## 0.20.1

### Patch Changes

- Updated dependencies [44d9b4f]
  - @mysten/sui@1.44.0

## 0.20.0

### Minor Changes

- 762404b: Update margin testnet package

## 0.19.7

### Patch Changes

- Updated dependencies [89fa2dc]
  - @mysten/bcs@1.9.2
  - @mysten/sui@1.43.2

## 0.19.6

### Patch Changes

- 48759a8: Update margin package on testnet
- a05eba1: New testnet margin package, small function changes
- Updated dependencies [a37829f]
  - @mysten/bcs@1.9.1
  - @mysten/sui@1.43.1

## 0.19.5

### Patch Changes

- Updated dependencies [f3b19a7]
- Updated dependencies [f3b19a7]
- Updated dependencies [bf9f85c]
  - @mysten/sui@1.43.0
  - @mysten/bcs@1.9.0

## 0.19.4

### Patch Changes

- Updated dependencies [98c8a27]
  - @mysten/sui@1.42.0

## 0.19.3

### Patch Changes

- Updated dependencies [a17c337]
- Updated dependencies [d554cd2]
- Updated dependencies [04fcfbc]
  - @mysten/bcs@1.8.1
  - @mysten/sui@1.41.0

## 0.19.2

### Patch Changes

- Updated dependencies [f5fc0c0]
  - @mysten/sui@1.40.0

## 0.19.1

### Patch Changes

- Updated dependencies [a9f9035]
  - @mysten/sui@1.39.1

## 0.19.0

### Minor Changes

- fd91249: Margin package functionality

### Patch Changes

- Updated dependencies [ca92487]
- Updated dependencies [5ab3c0a]
  - @mysten/sui@1.39.0

## 0.18.0

### Minor Changes

- 7d8bc08: Support core package upgrade changes on testnet

## 0.17.0

### Minor Changes

- ea1ac70: Update dependencies and improve support for typescript 5.9

### Patch Changes

- Updated dependencies [3c1741f]
- Updated dependencies [ea1ac70]
  - @mysten/sui@1.38.0
  - @mysten/bcs@1.8.0

## 0.16.1

### Patch Changes

- 78bd0e9: Update codegen arg normalization for object args
- Updated dependencies [c689b98]
- Updated dependencies [5b9ff1a]
  - @mysten/sui@1.37.6

## 0.16.0

### Minor Changes

- 216a53a: Export bcs types

### Patch Changes

- Updated dependencies [3980d04]
  - @mysten/sui@1.37.5

## 0.15.16

### Patch Changes

- Updated dependencies [6b03e57]
  - @mysten/sui@1.37.4

## 0.15.15

### Patch Changes

- 05b56d5: ALKIMI/SUI pool

## 0.15.14

### Patch Changes

- Updated dependencies [8ff1471]
  - @mysten/sui@1.37.3

## 0.15.13

### Patch Changes

- Updated dependencies [660377c]
  - @mysten/sui@1.37.2

## 0.15.12

### Patch Changes

- a02e75d: Patch permissionless pool creation rounding error

## 0.15.11

### Patch Changes

- @mysten/sui@1.37.1

## 0.15.10

### Patch Changes

- 6988956: IKA/USDC pool added

## 0.15.9

### Patch Changes

- ee08639: IKA token on mainnet added

## 0.15.8

### Patch Changes

- Updated dependencies [72168f0]
  - @mysten/sui@1.37.0

## 0.15.7

### Patch Changes

- Updated dependencies [44354ab]
  - @mysten/sui@1.36.2

## 0.15.6

### Patch Changes

- Updated dependencies [c76ddc5]
  - @mysten/sui@1.36.1

## 0.15.5

### Patch Changes

- Updated dependencies [783bb9e]
- Updated dependencies [783bb9e]
- Updated dependencies [5cbbb21]
  - @mysten/sui@1.36.0

## 0.15.4

### Patch Changes

- Updated dependencies [888afe6]
  - @mysten/sui@1.35.0

## 0.15.3

### Patch Changes

- Updated dependencies [3fb7a83]
  - @mysten/sui@1.34.0

## 0.15.2

### Patch Changes

- Updated dependencies [a00522b]
  - @mysten/sui@1.33.0

## 0.15.1

### Patch Changes

- e24e20c: Testnet package update

## 0.15.0

### Minor Changes

- 2572f14: Bump package to version 3

### Patch Changes

- Updated dependencies [6b7deb8]
  - @mysten/sui@1.32.0

## 0.14.17

### Patch Changes

- Updated dependencies [1ff4e57]
- Updated dependencies [550e2e3]
- Updated dependencies [550e2e3]
  - @mysten/sui@1.31.0

## 0.14.16

### Patch Changes

- Updated dependencies [5bd6ca3]
  - @mysten/sui@1.30.5

## 0.14.15

### Patch Changes

- Updated dependencies [5dce590]
- Updated dependencies [4a5aef6]
  - @mysten/sui@1.30.4

## 0.14.14

### Patch Changes

- bb7c03a: Update dependencies
- Updated dependencies [4457f10]
- Updated dependencies [bb7c03a]
  - @mysten/sui@1.30.3

## 0.14.13

### Patch Changes

- Updated dependencies [b265f7e]
  - @mysten/sui@1.30.2

## 0.14.12

### Patch Changes

- f30ae3c: Testnet upgrade

## 0.14.11

### Patch Changes

- 093fcc7: XBTC-USDC pool

## 0.14.10

### Patch Changes

- 00c526d: Temporary fix for floating point rounding error

## 0.14.9

### Patch Changes

- 7b6dbe1: Add XBTC to assets
- Updated dependencies [ec519fc]
  - @mysten/sui@1.30.1

## 0.14.8

### Patch Changes

- Updated dependencies [2456052]
- Updated dependencies [5264038]
- Updated dependencies [2456052]
- Updated dependencies [2456052]
- Updated dependencies [2456052]
- Updated dependencies [2456052]
  - @mysten/sui@1.30.0

## 0.14.7

### Patch Changes

- e7c5b81: Function to adjust min and lot size as admin

## 0.14.6

### Patch Changes

- 7a223e5: Add support for admin adjusting tick size

## 0.14.5

### Patch Changes

- @mysten/sui@1.29.1

## 0.14.4

### Patch Changes

- Updated dependencies [7d66a32]
- Updated dependencies [eb91fba]
- Updated dependencies [19a8045]
  - @mysten/sui@1.29.0

## 0.14.3

### Patch Changes

- Updated dependencies [9a94aea]
  - @mysten/sui@1.28.2

## 0.14.2

### Patch Changes

- Updated dependencies [3cd4e53]
  - @mysten/sui@1.28.1

## 0.14.1

### Patch Changes

- Updated dependencies [2705dc8]
  - @mysten/sui@1.28.0

## 0.14.0

### Minor Changes

- 5e7eeb9: Package Upgrade ID

## 0.13.7

### Patch Changes

- Updated dependencies [5cea435]
  - @mysten/sui@1.27.1

## 0.13.6

### Patch Changes

- Updated dependencies [4d13ef8]
- Updated dependencies [4d13ef8]
  - @mysten/sui@1.27.0

## 0.13.5

### Patch Changes

- 7ba32a4: update dependencies
- Updated dependencies [7ba32a4]
  - @mysten/sui@1.26.1

## 0.13.4

### Patch Changes

- Updated dependencies [906dd14]
  - @mysten/sui@1.26.0

## 0.13.3

### Patch Changes

- 98d25ad: WAL pools support
- Updated dependencies [e8b5d04]
  - @mysten/sui@1.25.0

## 0.13.2

### Patch Changes

- b93b0f2: Add WAL token

## 0.13.1

### Patch Changes

- Updated dependencies [cf3d12d]
  - @mysten/sui@1.24.0

## 0.13.0

### Minor Changes

- 27a1e7d: Support for permissionless pool creation and balance manager functions

### Patch Changes

- ba6f895: SEND pool
- Updated dependencies [8baac61]
- Updated dependencies [8baac61]
  - @mysten/sui@1.23.0

## 0.12.30

### Patch Changes

- da31bc5: Add SEND token to SDK
- Updated dependencies [03975f4]
  - @mysten/sui@1.22.0

## 0.12.29

### Patch Changes

- c982198: Experimental GIGA token

## 0.12.28

### Patch Changes

- @mysten/sui@1.21.2

## 0.12.27

### Patch Changes

- @mysten/sui@1.21.1

## 0.12.26

### Patch Changes

- Updated dependencies [3d8a0d9]
- Updated dependencies [20a5aaa]
  - @mysten/sui@1.21.0

## 0.12.25

### Patch Changes

- Updated dependencies [827a200]
  - @mysten/sui@1.20.0

## 0.12.24

### Patch Changes

- Updated dependencies [c39f32f]
- Updated dependencies [539168a]
  - @mysten/sui@1.19.0

## 0.12.23

### Patch Changes

- 7abd243: Update repo links
- Updated dependencies [7abd243]
  - @mysten/sui@1.18.1

## 0.12.22

### Patch Changes

- Updated dependencies [4f012b9]
- Updated dependencies [85bd9e4]
- Updated dependencies [5e3709d]
- Updated dependencies [b2928a9]
- Updated dependencies [dc0e21e]
- Updated dependencies [85bd9e4]
- Updated dependencies [a872b97]
  - @mysten/sui@1.18.0

## 0.12.21

### Patch Changes

- 7237686: DRF pool

## 0.12.20

### Patch Changes

- 50d0edb: DRF token

## 0.12.19

### Patch Changes

- Updated dependencies [20af12d]
  - @mysten/sui@1.17.0

## 0.12.18

### Patch Changes

- Updated dependencies [100207f]
  - @mysten/sui@1.16.2

## 0.12.17

### Patch Changes

- @mysten/sui@1.16.1

## 0.12.16

### Patch Changes

- f78d42a: AUSD pool support

## 0.12.15

### Patch Changes

- Updated dependencies [ec2dc7f]
- Updated dependencies [ec2dc7f]
  - @mysten/sui@1.16.0

## 0.12.14

### Patch Changes

- @mysten/sui@1.15.1

## 0.12.13

### Patch Changes

- 9c0987c: AUSD Coin

## 0.12.12

### Patch Changes

- Updated dependencies [6460e45]
  - @mysten/sui@1.15.0

## 0.12.11

### Patch Changes

- 4cf47ad: Typus pool

## 0.12.10

### Patch Changes

- 46bdaf9: Typus coin type

## 0.12.9

### Patch Changes

- 2a532bc: Governance function update

## 0.12.8

### Patch Changes

- Updated dependencies [938fb6e]
  - @mysten/sui@1.14.4

## 0.12.7

### Patch Changes

- 4a42691: NS token pools added

## 0.12.6

### Patch Changes

- a43ae92: NS Token
- Updated dependencies [d5a23d7]
  - @mysten/sui@1.14.3

## 0.12.5

### Patch Changes

- a24d43d: getOrders and decodeOrderId support

## 0.12.4

### Patch Changes

- 6a571f1: Deep conversion
- Updated dependencies [e7bc63e]
  - @mysten/sui@1.14.2

## 0.12.3

### Patch Changes

- Updated dependencies [69ef100]
  - @mysten/sui@1.14.1

## 0.12.2

### Patch Changes

- Updated dependencies [c24814b]
  - @mysten/sui@1.14.0

## 0.12.1

### Patch Changes

- Updated dependencies [477d2a4]
  - @mysten/sui@1.13.0

## 0.12.0

### Minor Changes

- 60f96ee: New stablecoin pool params

## 0.11.0

### Minor Changes

- 7b8e8ad: Mainnet pool packages

## 0.10.0

### Minor Changes

- 23c3a3a: DEEP Mainnet Redeploy

## 0.9.0

### Minor Changes

- 89f2e59: Mainnet packages

## 0.8.5

### Patch Changes

- c0fb6d6: Patch ID and bug fix

## 0.8.4

### Patch Changes

- 5df4e5e: Test Mainnet Packages

## 0.8.3

### Patch Changes

- Updated dependencies [5436a90]
- Updated dependencies [5436a90]
  - @mysten/sui@1.12.0

## 0.8.2

### Patch Changes

- f026ec6: Deepbook Package Upgrade

## 0.8.1

### Patch Changes

- Updated dependencies [489f421]
- Updated dependencies [489f421]
  - @mysten/sui@1.11.0

## 0.8.0

### Minor Changes

- 0d17307: Update deepbook sdk

## 0.7.1

### Patch Changes

- 37d259a: Locked balance feature

## 0.7.0

### Minor Changes

- 7923ed5: Newest deepbook package constants

### Patch Changes

- Updated dependencies [830b8d8]
  - @mysten/sui@1.10.0

## 0.6.0

### Minor Changes

- ebe2ae8: Admin function updates, package constant updates

## 0.5.1

### Patch Changes

- Updated dependencies [2c96b06]
- Updated dependencies [1fd22cc]
  - @mysten/sui@1.9.0

## 0.5.0

### Minor Changes

- c53baf2: Redeploy packages

## 0.4.3

### Patch Changes

- Updated dependencies [569511a]
  - @mysten/sui@1.8.0

## 0.4.2

### Patch Changes

- 339b8eb: Try catch for getOrder function

## 0.4.1

### Patch Changes

- 3221141: Book param function and package upgrade

## 0.4.0

### Minor Changes

- adc704a: trade params and account getters

## 0.3.3

### Patch Changes

- ed221a6: Update package address

## 0.3.2

### Patch Changes

- Updated dependencies [143cd9d]
- Updated dependencies [4357ac6]
- Updated dependencies [4019dd7]
- Updated dependencies [4019dd7]
- Updated dependencies [00a974d]
  - @mysten/sui@1.7.0

## 0.3.1

### Patch Changes

- d70e8ff: Upgrade Package

## 0.3.0

### Minor Changes

- 36f1c6f: Rounding for numbers, exports update
- c51f186: New contract constants

## 0.2.1

### Patch Changes

- Updated dependencies [a3e32fe]
  - @mysten/sui@1.6.0

## 0.2.0

### Minor Changes

- 41361b6: Constants update, manager sdk update

## 0.1.0

### Minor Changes

- 05fb3ac: Update deepbook addresses

### Patch Changes

- Updated dependencies [0851b31]
- Updated dependencies [f37b3c2]
  - @mysten/sui@1.5.0

## 0.0.1

### Patch Changes

- Updated dependencies [4419234]
  - @mysten/sui@1.4.0
