Spec: auto-routing orders (+ tighten ckBTC lot)#190
Draft
gregorydemay wants to merge 3 commits into
Draft
Conversation
The launch-basket ckBTC lot (0.0001 BTC) priced one lot at ~$6-10, coarser than the doc's own $0.10-$1 lot-notional guidance and 10x Binance's. Rebalance to tick 0.1 USDT / lot 0.00001 BTC, keeping tick x lot = 10^8 so the settlement-exactness invariant still holds. DEFI-2861 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Spec for placing an order on a non-listed spoke/spoke pair, routed through the ckUSDT hub in a single hop. Covers the synchronous atomic taker execution model (plan + kill-or-apply, deferred chunked settlement), the discrete-lot transit residual returned to the user as hub change, the transparent entry point, and the route_id / two-leg / Expired-on-kill identity model. DEFI-2861 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new design/spec document describing auto-routing orders (synthetic spoke↔spoke orders executed atomically as two ckUSDT-hub legs), and updates docs navigation plus an admin-facing listing parameter tweak for ckBTC/ckUSDT.
Changes:
- Introduces spec DEFI-2861 — Auto-Routing Orders covering topology assumptions, FOK two-leg execution, residual disposition, and identity model (
route_id). - Adds the new spec to the docs sidebar (SUMMARY).
- Updates the documented ckBTC/ckUSDT tick/lot values in the admin usage table.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| docs/src/usage/for-admins.md | Updates the documented ckBTC/ckUSDT tick/lot parameters. |
| docs/src/SUMMARY.md | Adds the DEFI-2861 spec page to the documentation index. |
| docs/src/development/specs/DEFI-2861-auto-routing-orders.md | New spec defining requirements and design decisions for auto-routing spoke↔spoke orders via the ckUSDT hub. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+25
to
+27
| The hard constraint, from the ticket: this must be **all-or-nothing**. The user must | ||
| never be left holding the transit token (ckUSDT) — a token they neither provided nor | ||
| requested. |
Comment on lines
+86
to
+87
| and may additionally receive **bounded change in the hub token (ckUSDT)** — the leftover | ||
| transit, strictly less than one funding-leg lot. The user never ends with an unrequested |
Comment on lines
+172
to
+173
| *Leg 1 — sell ckBTC on `ckBTC/ckUSDT`* (tick `0.1 USDT`, **lot `0.00001 BTC`** — the | ||
| tightened value; the previous `0.0001 BTC` lot made this ~10× worse). Best bid |
Comment on lines
+237
to
+240
| Independently of routing, the launch-basket ckBTC lot (`0.0001 BTC`, ~$6–$10/lot) was | ||
| coarser than the doc's own `$0.10–$1` guidance and 10× Binance's. It has been retightened | ||
| to **tick `0.1 USDT` / lot `0.00001 BTC`** (`docs/src/usage/for-admins.md`), keeping | ||
| `tick × lot = 10⁸` so the settlement-exactness invariant holds. This also reduces the |
| | | Coinbase `ICP-USD` | `0.001` | `0.0001` | `$1` | | ||
| | | Kraken `ICPUSD` | `0.001` | `0.00000001` | `$0.50` | | ||
| | **ckBTC/ckUSDT** | OISY TRADE | `0.01` USDT = `10_000` | `0.0001` BTC = `10_000` | `$5` = `5_000_000` | | ||
| | **ckBTC/ckUSDT** | OISY TRADE | `0.1` USDT = `100_000` | `0.00001` BTC = `1_000` | `$5` = `5_000_000` | |
Contributor
|
Lock the limit-price decision to an input budget (reserve price x quantity of the input token; fund the smallest whole-lot sale netting the destination cost, capped at the reservation, else kill), with a worked buy example. Record the two-taker-fee / gross-matched-target contract (R9) and move the synthetic limit-price alternative to Discussed Alternatives. DEFI-2861 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the spec for auto-routing orders: placing an order on a non-listed spoke↔spoke pair (e.g. ICP/ckBTC) that the canister executes transparently as two real orders meeting at the ckUSDT hub, in a single hop.
Key decisions captured in the spec, in the order they were worked out this session:
route_idresolves the returned id to the legs; a killed route is a singleExpiredrecord.Also folds in a small independent listing fix: the ckBTC/ckUSDT lot was retightened to
0.00001 BTC(tick0.1 USDT), which also shrinks the worst-case routing residual ~10×.One sub-decision is intentionally left open in the spec (Implementation → Limit semantics): whether the limit is expressed as an input budget or a synthetic limit price. Recommendation noted inline.
Draft — spec only, no implementation yet.