@mysten/deepbook-v3 2.3.0 → 2.4.1
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/CHANGELOG.md +29 -0
- package/PREDICT.md +149 -55
- package/README.md +18 -13
- package/dist/contracts/account/account_events.d.mts +20 -20
- package/dist/contracts/account/account_events.d.mts.map +1 -1
- package/dist/contracts/deepbook/account.d.mts +18 -18
- package/dist/contracts/deepbook/account.d.mts.map +1 -1
- package/dist/contracts/deepbook/balances.d.mts +4 -4
- package/dist/contracts/deepbook/balances.d.mts.map +1 -1
- package/dist/contracts/deepbook/deep_price.d.mts +3 -3
- package/dist/contracts/deepbook/deep_price.d.mts.map +1 -1
- package/dist/contracts/deepbook/order.d.mts +12 -12
- package/dist/contracts/deepbook_predict/admin.d.mts +27 -0
- package/dist/contracts/deepbook_predict/admin.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/admin.mjs +38 -0
- package/dist/contracts/deepbook_predict/admin.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/builder_code.d.mts +81 -0
- package/dist/contracts/deepbook_predict/builder_code.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/builder_code.mjs +103 -0
- package/dist/contracts/deepbook_predict/builder_code.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/builder_code_events.d.mts +25 -0
- package/dist/contracts/deepbook_predict/builder_code_events.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/builder_code_events.mjs +7 -1
- package/dist/contracts/deepbook_predict/builder_code_events.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/config_events.d.mts +104 -0
- package/dist/contracts/deepbook_predict/config_events.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/config_events.mjs +155 -0
- package/dist/contracts/deepbook_predict/config_events.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/ewma_config.mjs +28 -0
- package/dist/contracts/deepbook_predict/ewma_config.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/expiry_market.d.mts +859 -0
- package/dist/contracts/deepbook_predict/expiry_market.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/expiry_market.mjs +647 -1
- package/dist/contracts/deepbook_predict/expiry_market.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/market_lifecycle_cap.d.mts +39 -0
- package/dist/contracts/deepbook_predict/market_lifecycle_cap.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/market_lifecycle_cap.mjs +51 -0
- package/dist/contracts/deepbook_predict/market_lifecycle_cap.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/market_manager.d.mts +159 -0
- package/dist/contracts/deepbook_predict/market_manager.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/market_manager.mjs +88 -2
- package/dist/contracts/deepbook_predict/market_manager.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/order_events.d.mts +101 -0
- package/dist/contracts/deepbook_predict/order_events.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/order_events.mjs +7 -1
- package/dist/contracts/deepbook_predict/order_events.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pause_cap.d.mts +39 -0
- package/dist/contracts/deepbook_predict/pause_cap.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/pause_cap.mjs +51 -0
- package/dist/contracts/deepbook_predict/pause_cap.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/plp.d.mts +801 -0
- package/dist/contracts/deepbook_predict/plp.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/plp.mjs +458 -1
- package/dist/contracts/deepbook_predict/plp.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pool_valuation_cap.d.mts +39 -0
- package/dist/contracts/deepbook_predict/pool_valuation_cap.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/pool_valuation_cap.mjs +52 -0
- package/dist/contracts/deepbook_predict/pool_valuation_cap.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/predict_account.d.mts +90 -0
- package/dist/contracts/deepbook_predict/predict_account.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/predict_account.mjs +24 -1
- package/dist/contracts/deepbook_predict/predict_account.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pricing.d.mts +127 -0
- package/dist/contracts/deepbook_predict/pricing.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/pricing.mjs +25 -1
- package/dist/contracts/deepbook_predict/pricing.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pricing_config.mjs +28 -0
- package/dist/contracts/deepbook_predict/pricing_config.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/protocol_config.d.mts +665 -0
- package/dist/contracts/deepbook_predict/protocol_config.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/protocol_config.mjs +841 -0
- package/dist/contracts/deepbook_predict/protocol_config.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/range_codec.d.mts +30 -0
- package/dist/contracts/deepbook_predict/range_codec.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/range_codec.mjs +6 -1
- package/dist/contracts/deepbook_predict/range_codec.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/registry.d.mts +382 -0
- package/dist/contracts/deepbook_predict/registry.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/registry.mjs +456 -1
- package/dist/contracts/deepbook_predict/registry.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/vault_events.d.mts +199 -0
- package/dist/contracts/deepbook_predict/vault_events.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/vault_events.mjs +19 -1
- package/dist/contracts/deepbook_predict/vault_events.mjs.map +1 -1
- package/dist/contracts/deepbook_sessions/session_config.d.mts +8 -8
- package/dist/contracts/deepbook_sessions/session_config.d.mts.map +1 -1
- package/dist/contracts/deepbook_sessions/sessions.d.mts +22 -22
- package/dist/predict/client.d.mts +3 -2
- package/dist/predict/client.d.mts.map +1 -1
- package/dist/predict/client.mjs +3 -2
- package/dist/predict/client.mjs.map +1 -1
- package/dist/predict/index.d.mts +18 -1
- package/dist/predict/index.mjs +18 -1
- package/dist/transactions/marginLiquidations.d.mts +3 -3
- package/dist/transactions/marginRegistry.d.mts +16 -16
- package/package.json +2 -2
- package/src/predict/client.ts +3 -2
- package/src/predict/index.ts +26 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @mysten/deepbook-v3
|
|
2
2
|
|
|
3
|
+
## 2.4.1
|
|
4
|
+
|
|
5
|
+
## 2.4.0
|
|
6
|
+
|
|
7
|
+
### Minor Changes
|
|
8
|
+
|
|
9
|
+
- b07659a: Predict: export the generated move-call bindings from `@mysten/deepbook-v3/predict`, the
|
|
10
|
+
way `/account` already exports `accountMoveCalls`. Each `client.predict.tx.*` builder returns a
|
|
11
|
+
finished `Transaction`, so a Predict call could not join a PTB the caller was building — creating
|
|
12
|
+
an account, funding it and queueing a PLP supply in one transaction meant hand-writing
|
|
13
|
+
`plp::request_supply` as a raw `moveCall`. Every Predict module with a callable function is now
|
|
14
|
+
reachable as a namespace of transaction thunks (`plpMoveCalls`, `expiryMarketMoveCalls`,
|
|
15
|
+
`predictAccountMoveCalls`, `protocolConfigMoveCalls`, `registryMoveCalls`, `builderCodeMoveCalls`,
|
|
16
|
+
`marketManagerMoveCalls`, `pricingMoveCalls`, `rangeCodecMoveCalls`, and the cap modules),
|
|
17
|
+
alongside the event layouts (`vaultEvents`, `orderEvents`, `configEvents`, `builderCodeEvents`).
|
|
18
|
+
Pass `config: toGeneratedConfig(cfg)` and the shared objects fill themselves in; owner-authorized
|
|
19
|
+
calls take an `Auth` from `generateAuth(cfg)`. Additive only: no existing export changes.
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- ee8df5d: Predict docs: document both recorded deployments. `PREDICT.md` and the README now
|
|
24
|
+
describe the `deepbook-predict-mainnet` and `deepbook-predict-testnet` records that `getConfig`,
|
|
25
|
+
`getDeployment`, `getUnits`, `getAccountConfig`, and `getSessionsConfig` resolve, the quote coin
|
|
26
|
+
per network (Circle native USDC on mainnet, a mintable test coin that displays as DUSDC on
|
|
27
|
+
testnet, read from `quoteCoinType`), the `side: 'range'` descriptor arm, which decoders have
|
|
28
|
+
plural forms, what is exported for PTB composition, that `read.markets()` returns
|
|
29
|
+
live-and-not-yet-settled markets, and the `supplyPlp` / `withdrawPlp` floor options as shipped.
|
|
30
|
+
Documentation only; no runtime change.
|
|
31
|
+
|
|
3
32
|
## 2.3.0
|
|
4
33
|
|
|
5
34
|
### Minor Changes
|
package/PREDICT.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# DeepBook Predict (`@mysten/deepbook-v3/predict`)
|
|
2
2
|
|
|
3
|
-
TypeScript SDK for DeepBook Predict — binary markets on Sui. Builds ready-to-sign
|
|
4
|
-
reads on-chain state through your Sui client. The SDK never signs and never touches
|
|
5
|
-
`tx.*` method returns a `Transaction` for your wallet (dapp-kit) or signer to execute.
|
|
3
|
+
TypeScript SDK for DeepBook Predict — binary and range markets on Sui. Builds ready-to-sign
|
|
4
|
+
transactions and reads on-chain state through your Sui client. The SDK never signs and never touches
|
|
5
|
+
keys: every `tx.*` method returns a `Transaction` for your wallet (dapp-kit) or signer to execute.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -12,8 +12,10 @@ npm i @mysten/deepbook-v3 @mysten/sui
|
|
|
12
12
|
|
|
13
13
|
`@mysten/sui` is a peer dependency.
|
|
14
14
|
|
|
15
|
-
>
|
|
16
|
-
>
|
|
15
|
+
> Two deployments are recorded, **testnet** and **mainnet**: `predict({ network })` and
|
|
16
|
+
> `getConfig(network)` resolve either, and any other network throws. They settle in different coins
|
|
17
|
+
> that share one Move module path — read `quoteCoinType` from the config rather than assuming a
|
|
18
|
+
> symbol or a type. See [Networks & deployments](#networks--deployments).
|
|
17
19
|
|
|
18
20
|
## Quickstart
|
|
19
21
|
|
|
@@ -32,16 +34,22 @@ const client = new SuiGrpcClient({
|
|
|
32
34
|
// One-time: create your Predict account (a shared AccountWrapper).
|
|
33
35
|
const createTx = client.predict.tx.createManager();
|
|
34
36
|
|
|
35
|
-
// Fund it: pulls
|
|
37
|
+
// Fund it: pulls the deployment's quote coin (`client.predict.cfg.quoteCoinType`) from your
|
|
38
|
+
// address (coin objects and/or address balance).
|
|
36
39
|
const depositTx = client.predict.tx.deposit(myAddress, 250); // $250
|
|
37
40
|
|
|
38
|
-
// Cash out: lands in your
|
|
41
|
+
// Cash out: lands in your quote-coin address balance by default (no coin-object churn).
|
|
39
42
|
// Pass { toCoinObject: true } if you need a discrete Coin<T> instead.
|
|
40
43
|
const withdrawTx = client.predict.tx.withdraw(myAddress, 100); // $100
|
|
41
44
|
|
|
42
|
-
// Pick a
|
|
45
|
+
// Pick a market. `read.markets()` lists ACTIVE markets — live and not yet settled — which
|
|
46
|
+
// includes a market past its expiry that nobody has settled yet; quoting against one aborts.
|
|
47
|
+
// Expiries are absolute timestamps, so never hardcode one: filter on `expiryMs`, leaving
|
|
48
|
+
// room to quote, sign and land (and clear the pre-expiry no-trade window).
|
|
43
49
|
const markets = await client.predict.read.markets();
|
|
44
|
-
|
|
50
|
+
// -> [{ id, expiryMs, tickSize, admissionTickSize, mintPaused, referencePrice }, ...]
|
|
51
|
+
const tradeable = markets.filter((m) => Number(m.expiryMs) > Date.now() + 30_000 && !m.mintPaused);
|
|
52
|
+
const expiryMs = tradeable[0].expiryMs;
|
|
45
53
|
|
|
46
54
|
// Describe the position once and reuse it — quoting and minting take the same descriptor.
|
|
47
55
|
const desc = { underlying: 'BTC', expiryMs, strike: 'reference', side: 'up' } as const;
|
|
@@ -73,14 +81,10 @@ receipt.entryProbability; // your fill price (0..1 per $1 payout)
|
|
|
73
81
|
receipt.premium; // exact cost breakdown
|
|
74
82
|
receipt.fees;
|
|
75
83
|
|
|
76
|
-
// Read:
|
|
77
|
-
const
|
|
78
|
-
// -> [{ id, expiryMs, tickSize, admissionTickSize, mintPaused, referencePrice }, ...]
|
|
79
|
-
const market = await client.predict.read.market({
|
|
80
|
-
underlying: 'BTC',
|
|
81
|
-
expiryMs: markets[0].expiryMs,
|
|
82
|
-
});
|
|
84
|
+
// Read: one market's live state (+ NAV) and the pool.
|
|
85
|
+
const market = await client.predict.read.market({ underlying: 'BTC', expiryMs });
|
|
83
86
|
console.log(market?.nav, market?.tickSize, market?.mintPaused);
|
|
87
|
+
const pool = await client.predict.read.pool();
|
|
84
88
|
```
|
|
85
89
|
|
|
86
90
|
## ⚠ Slippage defaults are UNCAPPED
|
|
@@ -89,30 +93,41 @@ console.log(market?.nav, market?.tickSize, market?.mintPaused);
|
|
|
89
93
|
**uncapped** — if the price moves between your quote and execution, the position can cost up to your
|
|
90
94
|
full account balance. **Call `read.quoteMint` and pass its `cost` (plus your buffer) as `maxCost`.**
|
|
91
95
|
The same applies to `redeem`: the deployed `redeem_live` DOES take `min_probability` /
|
|
92
|
-
`min_proceeds` floors, but the facade does not surface them
|
|
93
|
-
`read.quoteRedeem` first, close fast
|
|
96
|
+
`min_proceeds` floors, but the facade's `tx.redeem` does not surface them and always sends `0`
|
|
97
|
+
(uncapped). `read.quoteRedeem` first, close fast. The floors are reachable through `/sessions`:
|
|
98
|
+
`SessionsContract.redeemLive` takes `minProbability` / `minProceeds` (raw units —
|
|
99
|
+
`probabilityToRaw`, `usdcToRaw`) plus a `pricer` from `loadLivePricer`, and is signed by a session
|
|
100
|
+
key the owner has authorized (see the README's `/sessions` section).
|
|
94
101
|
|
|
95
102
|
## Units
|
|
96
103
|
|
|
97
104
|
Everything human-facing is decimal; everything on-chain is scaled integers. The facade converts
|
|
98
105
|
**inputs** exactly (string/bigint math — no floats on the money path in). Read outputs typed
|
|
99
|
-
`number` are display values: above 2^53 raw they lose low-digit precision —
|
|
100
|
-
|
|
106
|
+
`number` are display values: above 2^53 raw they lose low-digit precision — quotes and receipts
|
|
107
|
+
carry a `raw` block of `bigint`s alongside, and `plpBalance` / `pool().plpTotalSupply` are raw
|
|
108
|
+
`bigint` already.
|
|
109
|
+
|
|
110
|
+
Amounts are in the deployment's quote coin — `getConfig(network).quoteCoinType`: Circle native USDC
|
|
111
|
+
on mainnet, a mintable 6-decimal test coin on testnet. Both are `…::usdc::USDC`, so only the package
|
|
112
|
+
address tells them apart; read the type, never assume a symbol.
|
|
101
113
|
|
|
102
114
|
| Concept | You pass / receive | On-chain raw |
|
|
103
115
|
| ------------------------------------------- | -------------------------------------------------------------- | ------------------------------------- |
|
|
104
|
-
| Amounts (deposit, spend, maxCost, balances) | USD decimal number or string (`12.5`, `"12.5"`) | ×1e6 (
|
|
116
|
+
| Amounts (deposit, spend, maxCost, balances) | USD decimal number or string (`12.5`, `"12.5"`) | ×1e6 (quote coin) |
|
|
105
117
|
| `quantity` | **max payout** in USD; positions pay $1 per contract at expiry | ×1e6, in $0.01 lots |
|
|
106
118
|
| `strike` | USD (`105_000`) | ×1e9, must land on the admission grid |
|
|
107
119
|
| `maxProbability` | 0..1 (`0.35` = 35¢ per $1 contract) | ×1e9 |
|
|
108
120
|
| PLP shares (`withdrawPlp`, `plpBalance`) | raw `bigint` shares | 6-decimal coin |
|
|
109
121
|
|
|
110
|
-
`side: "up"` wins if the settlement price is above the strike; `"down"` below
|
|
122
|
+
`side: "up"` wins if the settlement price is above the strike; `"down"` below; `"range"` (see
|
|
123
|
+
[Range positions](#range-positions)) if it lands inside `(lower, upper]`.
|
|
111
124
|
|
|
112
125
|
Trading closes slightly before expiry: the protocol enforces a short pre-expiry no-trade window
|
|
113
|
-
(`no_trade_window_ms` on the live `ProtocolConfig`,
|
|
114
|
-
|
|
115
|
-
|
|
126
|
+
(`no_trade_window_ms` on the live `ProtocolConfig`, 2 s on both recorded deployments), so a mint or
|
|
127
|
+
redeem submitted inside it aborts `ETradeWindowClosed` rather than filling. Treat the last seconds
|
|
128
|
+
of a window as untradeable rather than retrying, and when choosing a market from `read.markets()`
|
|
129
|
+
leave enough of the window to quote, sign and land — a quote taken seconds before expiry executes
|
|
130
|
+
inside the window.
|
|
116
131
|
|
|
117
132
|
## Reference-price markets (Polymarket-style windows)
|
|
118
133
|
|
|
@@ -139,11 +154,11 @@ strikes away from the reference remain fully supported.
|
|
|
139
154
|
### Numeric strikes must sit on the admission grid
|
|
140
155
|
|
|
141
156
|
New mint strikes must be a whole multiple of the market's **`admissionTickSize`** — a step
|
|
142
|
-
deliberately coarser than `tickSize`, and it
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
157
|
+
deliberately coarser than `tickSize`, and it is configured per cadence (both recorded deployments
|
|
158
|
+
run `$1` against a `$0.01` tick on their enabled cadences, 1m and 5m). Always read it off the market
|
|
159
|
+
rather than assuming a value. The market's `referencePrice` is the one finite strike the chain
|
|
160
|
+
admits off-grid. `read.markets()` and `read.market()` both report `admissionTickSize`, so a board
|
|
161
|
+
can be built from it directly:
|
|
147
162
|
|
|
148
163
|
```ts
|
|
149
164
|
const m = (await client.predict.read.markets())[0];
|
|
@@ -153,6 +168,23 @@ const strike = Math.round(target / m.admissionTickSize) * m.admissionTickSize;
|
|
|
153
168
|
An off-grid numeric strike throws `PredictInputError` at build time rather than aborting on chain
|
|
154
169
|
with `EInvalidAdmissionTick`.
|
|
155
170
|
|
|
171
|
+
### Range positions
|
|
172
|
+
|
|
173
|
+
`MarketDescriptor` has a third arm: `{ underlying, expiryMs, side: 'range', lower, upper }`. It pays
|
|
174
|
+
$1 per contract when the settlement price lands inside `(lower, upper]` — left-open, right-closed,
|
|
175
|
+
the same convention as the on-chain range key. Both bounds are USD strikes that must be finite, on
|
|
176
|
+
the tick grid, with `lower < upper`, and **each is admission-grid checked** exactly like a binary
|
|
177
|
+
numeric strike. `strike: 'reference'` is binary-only — a range has no single reference strike — and
|
|
178
|
+
`read.price` is binary-only too; price a range locally with `pricer.range(lower, upper)`.
|
|
179
|
+
|
|
180
|
+
```ts
|
|
181
|
+
const tx = await client.predict.tx.mint(
|
|
182
|
+
myAddress,
|
|
183
|
+
{ underlying: 'BTC', expiryMs, side: 'range', lower: 104_000, upper: 106_000 },
|
|
184
|
+
{ quantity: 25, maxCost: 10 },
|
|
185
|
+
);
|
|
186
|
+
```
|
|
187
|
+
|
|
156
188
|
## What's in the box
|
|
157
189
|
|
|
158
190
|
- **`client.predict.tx`** — `createManager`, `deposit`, `withdraw`, `mint`, `mintAmount`, `redeem`,
|
|
@@ -160,23 +192,59 @@ with `EInvalidAdmissionTick`.
|
|
|
160
192
|
`setBuilderCode`, `unsetBuilderCode`. Market-resolving builders
|
|
161
193
|
(`mint`/`mintAmount`/`redeem`/`claimSettled`) are async: they resolve the market object from
|
|
162
194
|
`{ underlying, expiryMs, strike, side }` via the on-chain registry (cached per client).
|
|
163
|
-
- **`client.predict.read`** — `markets()` (
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
195
|
+
- **`client.predict.read`** — `markets()` (summaries of the pool's **active** markets — live and not
|
|
196
|
+
yet settled, so a market past expiry that nobody has settled is still listed and quoting against
|
|
197
|
+
it aborts; filter on `expiryMs` and `mintPaused` before trading: id, expiry, tick size, admission
|
|
198
|
+
tick size, mint-paused, reference price), `market(desc)` (state + live NAV), `price(m)` (anonymous
|
|
199
|
+
both-sides pricing for any strike, one chain call per strike), `pricer(m)` (a **client-side board
|
|
200
|
+
pricer** — one chain read of the resolved pricer, then price every strike locally; see below),
|
|
167
201
|
`quoteMint(owner, m, opts)` / `quoteRedeem(owner, m, opts)` (exact dry-run quotes: real fees from
|
|
168
202
|
the real code path — and they throw the same typed errors the real trade would, so a quote doubles
|
|
169
203
|
as preflight), `balance(owner)`, `plpBalance(owner)`, `pool()`, `positions(owner)` (chain-only
|
|
170
204
|
enumeration of open positions), `hasPosition(owner, marketId, orderId)`. All reads run over the
|
|
171
205
|
client's `simulateTransaction`; no indexer required.
|
|
172
206
|
- **`client.predict.decode`** — pure execution-result decoders (no network): `mint`, `redeem`,
|
|
173
|
-
`claim`, `createManager`, `deposit`, `withdraw`, `plpRequest`, `plpCancel`, `builderCode
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
207
|
+
`claim`, `createManager`, `deposit`, `withdraw`, `plpRequest`, `plpCancel`, `builderCode`. Each
|
|
208
|
+
singular form throws unless exactly one matching event is present; `mints`, `redeems` and `claims`
|
|
209
|
+
are the plural forms for batched PTBs and return every receipt (the other decoders have no
|
|
210
|
+
plural). Execute transactions with events included and pass the result; receipts come back in SDK
|
|
211
|
+
units with raw bigints alongside. Decoding uses the events' canonical BCS bytes, so it is
|
|
212
|
+
transport-independent.
|
|
213
|
+
- **PTB composition** — each `client.predict.tx.*` builder returns a finished `Transaction`, so to
|
|
214
|
+
put a Predict call into a PTB you are building, use the generated move-call bindings `/predict`
|
|
215
|
+
exports: one namespace of transaction thunks per Predict module (`plpMoveCalls`,
|
|
216
|
+
`expiryMarketMoveCalls`, `predictAccountMoveCalls`, `protocolConfigMoveCalls`,
|
|
217
|
+
`registryMoveCalls`, `builderCodeMoveCalls`, `marketManagerMoveCalls`, `pricingMoveCalls`,
|
|
218
|
+
`rangeCodecMoveCalls`, `adminMoveCalls` and the cap modules) plus the event layouts
|
|
219
|
+
(`vaultEvents`, `orderEvents`, `configEvents`, `builderCodeEvents`). Pass
|
|
220
|
+
`config: toGeneratedConfig(cfg)` — the flat config slice the bindings resolve the shared objects
|
|
221
|
+
against — and give owner-authorized calls `auth: tx.add(generateAuth(cfg))`, the hot-potato `Auth`
|
|
222
|
+
the account calls consume. The account itself (create, deposit, share) is
|
|
223
|
+
`@mysten/deepbook-v3/account`'s `accountRegistryMoveCalls` / `accountMoveCalls`. Also exported:
|
|
224
|
+
`loadLivePricer(toGeneratedConfig(cfg), { expiryMarketId, ...cfg.underlyings[sym] })` — the
|
|
225
|
+
`pricer` every live trade call borrows, which the `/sessions` Predict wrappers take as a PTB
|
|
226
|
+
result — and `deriveAccountWrapperId(cfg, owner)`.
|
|
227
|
+
|
|
228
|
+
```ts
|
|
229
|
+
// Create an account, fund it, and queue a PLP supply — one PTB, one signature.
|
|
230
|
+
const config = toGeneratedConfig(cfg);
|
|
231
|
+
const wrapper = tx.add(accountRegistryMoveCalls._new({ config }));
|
|
232
|
+
tx.add(
|
|
233
|
+
accountMoveCalls.depositFunds({
|
|
234
|
+
config,
|
|
235
|
+
arguments: { wrapper, auth: tx.add(generateAuth(cfg)), coin },
|
|
236
|
+
typeArguments: [cfg.quoteCoinType],
|
|
237
|
+
}),
|
|
238
|
+
);
|
|
239
|
+
tx.add(
|
|
240
|
+
plpMoveCalls.requestSupply({
|
|
241
|
+
config,
|
|
242
|
+
arguments: { wrapper, auth: tx.add(generateAuth(cfg)), amount, minPlpOut },
|
|
243
|
+
}),
|
|
244
|
+
);
|
|
245
|
+
tx.add(accountMoveCalls.share({ config, arguments: { self: wrapper } }));
|
|
246
|
+
```
|
|
247
|
+
|
|
180
248
|
- **Typed errors** — invalid inputs throw `PredictInputError` before the chain sees them; failed
|
|
181
249
|
simulations throw `PredictMoveError` with the decoded Move abort (`module`, `code`, `abortName`).
|
|
182
250
|
|
|
@@ -203,9 +271,9 @@ on-chain; the client only evaluates the digital. It throws the same typed stale-
|
|
|
203
271
|
The math is a faithful float port of the deployed `pricing::compute_nd2` (SVI with the skew
|
|
204
272
|
correction, signed params, and the remaining-time roll-down). It agrees with the chain closely —
|
|
205
273
|
within ~1e-4 in probability, up to ~1e-4 near ATM where the chain's fixed-point truncation dominates
|
|
206
|
-
(`
|
|
207
|
-
namespace for callers who already hold their own oracle inputs (e.g. a live feed) and want
|
|
208
|
-
chain calls:
|
|
274
|
+
(`test/predict/testnet/pricing.test.ts` bounds it live). The pure functions are exported under a
|
|
275
|
+
`pricing` namespace for callers who already hold their own oracle inputs (e.g. a live feed) and want
|
|
276
|
+
zero chain calls:
|
|
209
277
|
|
|
210
278
|
```ts
|
|
211
279
|
import { pricing } from '@mysten/deepbook-v3/predict';
|
|
@@ -223,11 +291,29 @@ const rolled = pricing.rollDown(rawSvi, remainingMs, anchorTteMs); // decay a, b
|
|
|
223
291
|
|
|
224
292
|
## Networks & deployments
|
|
225
293
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
294
|
+
Two deployments are recorded. `getDeployment(network)` names each one and the deepbookv3 commit its
|
|
295
|
+
ids were generated at:
|
|
296
|
+
|
|
297
|
+
| Network | Deployment | Chain id | Source commit | `quoteCoinType` |
|
|
298
|
+
| --------- | -------------------------- | ---------- | ------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
299
|
+
| `mainnet` | `deepbook-predict-mainnet` | `35834a8a` | `14a7e8f8` | Circle native USDC — `0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC` |
|
|
300
|
+
| `testnet` | `deepbook-predict-testnet` | `4c78adac` | `a928bd2d` | mintable test coin, displays as `DUSDC` — `0xc028557a1ed49e42ed091e115aedefd70a442b184c18fbec5c48d5b6c0b8c184::usdc::USDC` |
|
|
301
|
+
|
|
302
|
+
Object ids for both are baked into the SDK — `MAINNET_CONFIG` / `TESTNET_CONFIG`, with
|
|
303
|
+
`MAINNET_DEPLOYMENT` / `TESTNET_DEPLOYMENT` and `MAINNET_UNITS` / `TESTNET_UNITS` alongside — and
|
|
304
|
+
are regenerated, with a release, whenever a deployment moves. `getConfig`, `getDeployment` and
|
|
305
|
+
`getUnits` resolve both networks and throw on any other; `getAccountConfig` (`/account`) and
|
|
306
|
+
`getSessionsConfig` (`/sessions`) read slices of the same generated record, so the three subpaths
|
|
307
|
+
cannot address different deployments. Units are identical on both (`$0.01` lots, 6 quote decimals,
|
|
308
|
+
1e9 fixed-point scale).
|
|
309
|
+
|
|
310
|
+
Move-call targets resolve from the config's package ids, so a deployment of your own is addressed by
|
|
311
|
+
passing `config` — `predict({ network, config })` or
|
|
312
|
+
`new PredictClient({ client, network, config })` — and `network` is then not consulted.
|
|
313
|
+
|
|
314
|
+
An expired market stays in `read.markets()` until someone settles it — the list is the pool's
|
|
315
|
+
live-and-not-yet-settled set, not a tradeable set. On either network, check `expiryMs` against the
|
|
316
|
+
clock (and `mintPaused`) before quoting rather than assuming the list is tradeable.
|
|
231
317
|
|
|
232
318
|
## Notes
|
|
233
319
|
|
|
@@ -239,12 +325,20 @@ stop requiring an SDK release for target resolution.
|
|
|
239
325
|
- PLP supply/withdraw are queued and fill at the next pool flush; cancels take the queue `index` —
|
|
240
326
|
get it from `decode.plpRequest(result).index`.
|
|
241
327
|
- **Both take an optional price floor**, and default to none:
|
|
242
|
-
`supplyPlp(owner,
|
|
243
|
-
`withdrawPlp(owner, shares, { minUsdcOut })` (USD decimals
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
328
|
+
`supplyPlp(owner, amountUsdc, { minPlpOut })` (`PlpSupplyOptions`, raw `bigint` shares; omitted →
|
|
329
|
+
`0n`) and `withdrawPlp(owner, shares, { minUsdcOut })` (`PlpWithdrawOptions`, USD decimals as
|
|
330
|
+
`number | string`, measured after the protocol's withdraw fee; omitted → no floor). Each floors
|
|
331
|
+
the flush's MARK for the whole request rather than naming a quantity — a flush quoting less
|
|
332
|
+
declines instead of filling smaller. What a miss costs is the deployment's
|
|
333
|
+
`lp_request_limit_flush_attempts`: the deployed value is one on both recorded deployments, so the
|
|
334
|
+
first flush below the floor cancels the request and refunds it, and re-queueing is a fresh
|
|
335
|
+
transaction (three is the configurable maximum, not the default). Leave the floor off and the
|
|
336
|
+
request takes whatever mark the flush quotes.
|
|
337
|
+
- **First-time funding in one PTB**: `deposit(owner, amount, { create: true })` creates the wrapper,
|
|
338
|
+
deposits through the fresh handle and shares it last. `owner` must be the transaction signer (the
|
|
339
|
+
wrapper is derived from the sender), and it aborts if the account already exists — the builder
|
|
340
|
+
does no chain read, so gate on `wrapperIdFor(owner)` + a `getObject`, or fall back to `deposit`
|
|
341
|
+
without the flag on that abort.
|
|
248
342
|
- `claimSettled` closes the order in full — the deployed entrypoint takes no quantity.
|
|
249
343
|
- **`withdraw` lands in your address balance by default** (`0x2::coin::send_funds`), not a coin
|
|
250
344
|
object — it merges into the versionless accumulator `deposit` already draws from, so the round
|
package/README.md
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Entry points
|
|
4
4
|
|
|
5
|
-
| Import | Contents
|
|
6
|
-
| ------------------------------ |
|
|
7
|
-
| `@mysten/deepbook-v3` | DeepBook spot and margin — pools, orders, balance managers, flash loans, governance, margin managers/pools, TPSL.
|
|
8
|
-
| `@mysten/deepbook-v3/account` | The shared on-chain **account primitive** (`AccountContract`): the canonical `AccountWrapper`, `Auth`, and custody balances that DeepBook's core account wrapper and DeepBook Predict both build on.
|
|
9
|
-
| `@mysten/deepbook-v3/sessions` | **Time-limited trading sessions** over a canonical Account (`SessionsContract`): grant an ephemeral address bounded authority until a fixed expiry. Covers the session lifecycle and the DeepBook Predict wrappers.
|
|
10
|
-
| `@mysten/deepbook-v3/predict` | **DeepBook Predict** — binary markets: market discovery, quotes, mint/redeem/claim, PLP, typed receipts and a client-side board pricer. See [PREDICT.md](./PREDICT.md).
|
|
5
|
+
| Import | Contents |
|
|
6
|
+
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
7
|
+
| `@mysten/deepbook-v3` | DeepBook spot and margin — pools, orders, balance managers, flash loans, governance, margin managers/pools, TPSL. |
|
|
8
|
+
| `@mysten/deepbook-v3/account` | The shared on-chain **account primitive** (`AccountContract`): the canonical `AccountWrapper`, `Auth`, and custody balances that DeepBook's core account wrapper and DeepBook Predict both build on. |
|
|
9
|
+
| `@mysten/deepbook-v3/sessions` | **Time-limited trading sessions** over a canonical Account (`SessionsContract`): grant an ephemeral address bounded authority until a fixed expiry. Covers the session lifecycle and the DeepBook Predict wrappers. |
|
|
10
|
+
| `@mysten/deepbook-v3/predict` | **DeepBook Predict** — binary and range markets: market discovery, quotes, mint/redeem/claim, PLP, typed receipts and a client-side board pricer, with deployed ids for testnet and mainnet. See [PREDICT.md](./PREDICT.md). |
|
|
11
11
|
|
|
12
12
|
Subpaths are separate module graphs — importing `@mysten/deepbook-v3/account` does not load any spot
|
|
13
13
|
or margin code.
|
|
@@ -15,10 +15,13 @@ or margin code.
|
|
|
15
15
|
Each subpath also exports the **deployed ids** for its own surface, so a caller never transcribes
|
|
16
16
|
them: `getAccountConfig(network)` on `/account`, `getSessionsConfig(network)` on `/sessions`,
|
|
17
17
|
`getConfig(network)` on `/predict`. All three read one generated record (`src/deployments/`), so a
|
|
18
|
-
redeploy updates every subpath at once and they cannot end up addressing different deployments.
|
|
19
|
-
`
|
|
20
|
-
|
|
21
|
-
rather than returning placeholder ids.
|
|
18
|
+
redeploy updates every subpath at once and they cannot end up addressing different deployments. Two
|
|
19
|
+
networks are recorded, `testnet` (`deepbook-predict-testnet`) and `mainnet`
|
|
20
|
+
(`deepbook-predict-mainnet`); `getDeployment(network)` names the deployment and the deepbookv3
|
|
21
|
+
commit those ids came from, and an unrecorded network throws rather than returning placeholder ids.
|
|
22
|
+
The two deployments settle in different coins that share one Move module path — Circle native USDC
|
|
23
|
+
on mainnet, a mintable test coin (displayed as `DUSDC`) on testnet — so take the coin type from
|
|
24
|
+
`getConfig(network).quoteCoinType` on `/predict` rather than assuming either.
|
|
22
25
|
|
|
23
26
|
### `@mysten/deepbook-v3/account`
|
|
24
27
|
|
|
@@ -30,7 +33,7 @@ is computable off-chain with no chain read. `AccountContract` takes only the dep
|
|
|
30
33
|
import { Transaction } from '@mysten/sui/transactions';
|
|
31
34
|
import { AccountContract, getAccountConfig } from '@mysten/deepbook-v3/account';
|
|
32
35
|
|
|
33
|
-
// Deployed ids ship with the package — no transcription.
|
|
36
|
+
// Deployed ids ship with the package — no transcription. 'testnet' | 'mainnet'.
|
|
34
37
|
const account = new AccountContract(getAccountConfig('testnet'));
|
|
35
38
|
|
|
36
39
|
// …or drive a deployment of your own:
|
|
@@ -38,8 +41,10 @@ const custom = new AccountContract({ accountPackageId: '0x…', accountRegistry:
|
|
|
38
41
|
|
|
39
42
|
const wrapperId = account.deriveAccountWrapperId(owner);
|
|
40
43
|
|
|
44
|
+
// `quoteCoinType` is the deployment's settlement coin — `getConfig(network).quoteCoinType`
|
|
45
|
+
// from `/predict` — not a symbol you assume.
|
|
41
46
|
const tx = new Transaction();
|
|
42
|
-
tx.add(account.depositFunds({ wrapperId, coin, coinType:
|
|
47
|
+
tx.add(account.depositFunds({ wrapperId, coin, coinType: quoteCoinType }));
|
|
43
48
|
```
|
|
44
49
|
|
|
45
50
|
> `Account` exported from the package root is `@deepbook/core::account::Account` (the per-pool
|
|
@@ -61,7 +66,7 @@ withdrawal or arbitrary-mutation entrypoint.
|
|
|
61
66
|
```ts
|
|
62
67
|
import { SessionsContract, getSessionsConfig } from '@mysten/deepbook-v3/sessions';
|
|
63
68
|
|
|
64
|
-
// Deployed ids ship with the package — no transcription.
|
|
69
|
+
// Deployed ids ship with the package — no transcription. 'testnet' | 'mainnet'.
|
|
65
70
|
const sessions = new SessionsContract(getSessionsConfig('testnet'));
|
|
66
71
|
|
|
67
72
|
const wrapperId = sessions.deriveAccountWrapperId(owner);
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import { MoveStruct } from "../utils/index.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _mysten_sui_bcs10 from "@mysten/sui/bcs";
|
|
3
3
|
|
|
4
4
|
//#region src/contracts/account/account_events.d.ts
|
|
5
5
|
declare namespace account_events_d_exports {
|
|
6
6
|
export { AccountCreated, AppAuthorized, AppDeauthorized, Deposited, FundsSettled, Withdrawn };
|
|
7
7
|
}
|
|
8
8
|
declare const AccountCreated: MoveStruct<{
|
|
9
|
-
account_id:
|
|
10
|
-
wrapper_id:
|
|
11
|
-
owner:
|
|
12
|
-
self_owned:
|
|
13
|
-
referrer_account_id:
|
|
9
|
+
account_id: _mysten_sui_bcs10.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
10
|
+
wrapper_id: _mysten_sui_bcs10.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
11
|
+
owner: _mysten_sui_bcs10.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
12
|
+
self_owned: _mysten_sui_bcs10.BcsType<boolean, boolean, "bool">;
|
|
13
|
+
referrer_account_id: _mysten_sui_bcs10.BcsType<string | null, string | Uint8Array<ArrayBufferLike> | null | undefined, "Option<bytes[32]>">;
|
|
14
14
|
}, "@local-pkg/account::account_events::AccountCreated">;
|
|
15
15
|
declare const AppAuthorized: MoveStruct<{
|
|
16
|
-
/** Fully-qualified `App` witness type name. */app:
|
|
16
|
+
/** Fully-qualified `App` witness type name. */app: _mysten_sui_bcs10.BcsType<string, string, "string">;
|
|
17
17
|
}, "@local-pkg/account::account_events::AppAuthorized">;
|
|
18
18
|
declare const AppDeauthorized: MoveStruct<{
|
|
19
|
-
app:
|
|
19
|
+
app: _mysten_sui_bcs10.BcsType<string, string, "string">;
|
|
20
20
|
}, "@local-pkg/account::account_events::AppDeauthorized">;
|
|
21
21
|
declare const Deposited: MoveStruct<{
|
|
22
|
-
account_id:
|
|
23
|
-
coin_type:
|
|
24
|
-
amount:
|
|
25
|
-
new_balance:
|
|
22
|
+
account_id: _mysten_sui_bcs10.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
23
|
+
coin_type: _mysten_sui_bcs10.BcsType<string, string, "string">;
|
|
24
|
+
amount: _mysten_sui_bcs10.BcsType<bigint, string | number | bigint, "u64">;
|
|
25
|
+
new_balance: _mysten_sui_bcs10.BcsType<bigint, string | number | bigint, "u64">;
|
|
26
26
|
}, "@local-pkg/account::account_events::Deposited">;
|
|
27
27
|
declare const Withdrawn: MoveStruct<{
|
|
28
|
-
account_id:
|
|
29
|
-
coin_type:
|
|
30
|
-
amount:
|
|
31
|
-
new_balance:
|
|
28
|
+
account_id: _mysten_sui_bcs10.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
29
|
+
coin_type: _mysten_sui_bcs10.BcsType<string, string, "string">;
|
|
30
|
+
amount: _mysten_sui_bcs10.BcsType<bigint, string | number | bigint, "u64">;
|
|
31
|
+
new_balance: _mysten_sui_bcs10.BcsType<bigint, string | number | bigint, "u64">;
|
|
32
32
|
}, "@local-pkg/account::account_events::Withdrawn">;
|
|
33
33
|
declare const FundsSettled: MoveStruct<{
|
|
34
|
-
account_id:
|
|
35
|
-
coin_type:
|
|
36
|
-
amount:
|
|
37
|
-
new_balance:
|
|
34
|
+
account_id: _mysten_sui_bcs10.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
35
|
+
coin_type: _mysten_sui_bcs10.BcsType<string, string, "string">;
|
|
36
|
+
amount: _mysten_sui_bcs10.BcsType<bigint, string | number | bigint, "u64">;
|
|
37
|
+
new_balance: _mysten_sui_bcs10.BcsType<bigint, string | number | bigint, "u64">;
|
|
38
38
|
}, "@local-pkg/account::account_events::FundsSettled">;
|
|
39
39
|
//#endregion
|
|
40
40
|
export { account_events_d_exports };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account_events.d.mts","names":[],"sources":["../../../src/contracts/account/account_events.ts"],"mappings":";;;;;;;cAca,cAAA,EAAc,UAAA;;;;;;;cAUd,aAAA,EAAa,UAAA;sDAMxB,
|
|
1
|
+
{"version":3,"file":"account_events.d.mts","names":[],"sources":["../../../src/contracts/account/account_events.ts"],"mappings":";;;;;;;cAca,cAAA,EAAc,UAAA;;;;;;;cAUd,aAAA,EAAa,UAAA;sDAMxB,iBAAA,CAAA,OAAA;AAAA;AAAA,cACW,eAAA,EAAe,UAAA;OAK1B,iBAAA,CAAA,OAAA;AAAA;AAAA,cACW,SAAA,EAAS,UAAA;;;;;;cAST,SAAA,EAAS,UAAA;;;;;;cAST,YAAA,EAAY,UAAA"}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { MoveStruct } from "../utils/index.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _mysten_sui_bcs475 from "@mysten/sui/bcs";
|
|
3
3
|
import { Transaction, TransactionArgument } from "@mysten/sui/transactions";
|
|
4
4
|
|
|
5
5
|
//#region src/contracts/deepbook/account.d.ts
|
|
6
6
|
declare const Account: MoveStruct<{
|
|
7
|
-
epoch:
|
|
7
|
+
epoch: _mysten_sui_bcs475.BcsType<string, string | number | bigint, "u64">;
|
|
8
8
|
open_orders: MoveStruct<{
|
|
9
|
-
contents:
|
|
9
|
+
contents: _mysten_sui_bcs475.BcsType<string[], Iterable<string | number | bigint> & {
|
|
10
10
|
length: number;
|
|
11
11
|
}, string>;
|
|
12
12
|
}, "0x2::vec_set::VecSet<u128>">;
|
|
13
|
-
taker_volume:
|
|
14
|
-
maker_volume:
|
|
15
|
-
active_stake:
|
|
16
|
-
inactive_stake:
|
|
17
|
-
created_proposal:
|
|
18
|
-
voted_proposal:
|
|
13
|
+
taker_volume: _mysten_sui_bcs475.BcsType<string, string | number | bigint, "u128">;
|
|
14
|
+
maker_volume: _mysten_sui_bcs475.BcsType<string, string | number | bigint, "u128">;
|
|
15
|
+
active_stake: _mysten_sui_bcs475.BcsType<string, string | number | bigint, "u64">;
|
|
16
|
+
inactive_stake: _mysten_sui_bcs475.BcsType<string, string | number | bigint, "u64">;
|
|
17
|
+
created_proposal: _mysten_sui_bcs475.BcsType<boolean, boolean, "bool">;
|
|
18
|
+
voted_proposal: _mysten_sui_bcs475.BcsType<string | null, string | Uint8Array<ArrayBufferLike> | null | undefined, "Option<bytes[32]>">;
|
|
19
19
|
unclaimed_rebates: MoveStruct<{
|
|
20
|
-
base:
|
|
21
|
-
quote:
|
|
22
|
-
deep:
|
|
20
|
+
base: _mysten_sui_bcs475.BcsType<string, string | number | bigint, "u64">;
|
|
21
|
+
quote: _mysten_sui_bcs475.BcsType<string, string | number | bigint, "u64">;
|
|
22
|
+
deep: _mysten_sui_bcs475.BcsType<string, string | number | bigint, "u64">;
|
|
23
23
|
}, "@deepbook/core::balances::Balances">;
|
|
24
24
|
settled_balances: MoveStruct<{
|
|
25
|
-
base:
|
|
26
|
-
quote:
|
|
27
|
-
deep:
|
|
25
|
+
base: _mysten_sui_bcs475.BcsType<string, string | number | bigint, "u64">;
|
|
26
|
+
quote: _mysten_sui_bcs475.BcsType<string, string | number | bigint, "u64">;
|
|
27
|
+
deep: _mysten_sui_bcs475.BcsType<string, string | number | bigint, "u64">;
|
|
28
28
|
}, "@deepbook/core::balances::Balances">;
|
|
29
29
|
owed_balances: MoveStruct<{
|
|
30
|
-
base:
|
|
31
|
-
quote:
|
|
32
|
-
deep:
|
|
30
|
+
base: _mysten_sui_bcs475.BcsType<string, string | number | bigint, "u64">;
|
|
31
|
+
quote: _mysten_sui_bcs475.BcsType<string, string | number | bigint, "u64">;
|
|
32
|
+
deep: _mysten_sui_bcs475.BcsType<string, string | number | bigint, "u64">;
|
|
33
33
|
}, "@deepbook/core::balances::Balances">;
|
|
34
34
|
}, "@deepbook/core::account::Account">;
|
|
35
35
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.mts","names":[],"sources":["../../../src/contracts/deepbook/account.ts"],"mappings":";;;;;cAYa,OAAA,EAAO,UAAA;SAelB,
|
|
1
|
+
{"version":3,"file":"account.d.mts","names":[],"sources":["../../../src/contracts/deepbook/account.ts"],"mappings":";;;;;cAYa,OAAA,EAAO,UAAA;SAelB,kBAAA,CAAA,OAAA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { MoveStruct } from "../utils/index.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _mysten_sui_bcs492 from "@mysten/sui/bcs";
|
|
3
3
|
|
|
4
4
|
//#region src/contracts/deepbook/balances.d.ts
|
|
5
5
|
declare const Balances: MoveStruct<{
|
|
6
|
-
base:
|
|
7
|
-
quote:
|
|
8
|
-
deep:
|
|
6
|
+
base: _mysten_sui_bcs492.BcsType<string, string | number | bigint, "u64">;
|
|
7
|
+
quote: _mysten_sui_bcs492.BcsType<string, string | number | bigint, "u64">;
|
|
8
|
+
deep: _mysten_sui_bcs492.BcsType<string, string | number | bigint, "u64">;
|
|
9
9
|
}, "@deepbook/core::balances::Balances">;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Balances };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"balances.d.mts","names":[],"sources":["../../../src/contracts/deepbook/balances.ts"],"mappings":";;;;cAYa,QAAA,EAAQ,UAAA;QAOnB,
|
|
1
|
+
{"version":3,"file":"balances.d.mts","names":[],"sources":["../../../src/contracts/deepbook/balances.ts"],"mappings":";;;;cAYa,QAAA,EAAQ,UAAA;QAOnB,kBAAA,CAAA,OAAA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { MoveStruct } from "../utils/index.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _mysten_sui_bcs495 from "@mysten/sui/bcs";
|
|
3
3
|
import { Transaction, TransactionArgument } from "@mysten/sui/transactions";
|
|
4
4
|
|
|
5
5
|
//#region src/contracts/deepbook/deep_price.d.ts
|
|
6
6
|
declare const OrderDeepPrice: MoveStruct<{
|
|
7
|
-
asset_is_base:
|
|
8
|
-
deep_per_asset:
|
|
7
|
+
asset_is_base: _mysten_sui_bcs495.BcsType<boolean, boolean, "bool">;
|
|
8
|
+
deep_per_asset: _mysten_sui_bcs495.BcsType<string, string | number | bigint, "u64">;
|
|
9
9
|
}, "@deepbook/core::deep_price::OrderDeepPrice">;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { OrderDeepPrice };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deep_price.d.mts","names":[],"sources":["../../../src/contracts/deepbook/deep_price.ts"],"mappings":";;;;;cAuCa,cAAA,EAAc,UAAA;iBAMzB,
|
|
1
|
+
{"version":3,"file":"deep_price.d.mts","names":[],"sources":["../../../src/contracts/deepbook/deep_price.ts"],"mappings":";;;;;cAuCa,cAAA,EAAc,UAAA;iBAMzB,kBAAA,CAAA,OAAA"}
|