Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
92551a6
Refactor Move tooling for contracts test-publish flow
CoveMB Feb 20, 2026
c34bc00
Add prop-amm manager contract and unit tests
CoveMB Feb 20, 2026
79527c3
Add prop-amm executor module skeleton
CoveMB Feb 20, 2026
24eff3f
Add AMM config domain model with create and view scripts
CoveMB Feb 20, 2026
27e89c1
Format tooling path and move unit test files
CoveMB Feb 20, 2026
730c737
Merge branch 'split/17-publish-foundation' into split/15-manager-cont…
CoveMB Feb 20, 2026
a3b531e
Merge branch 'split/15-manager-contracts' into split/16-executor-cont…
CoveMB Feb 20, 2026
3ed1fdf
Merge branch 'split/16-executor-contracts' into split/25-ammconfig-mo…
CoveMB Feb 20, 2026
8d75c8a
Stabilize baseline typecheck and dapp unit gates
CoveMB Feb 20, 2026
b528d53
Merge branch 'split/00-ci-hygiene-baseline' into split/17-publish-fou…
CoveMB Feb 20, 2026
a2ca3c3
Merge branch 'split/17-publish-foundation' into split/15-manager-cont…
CoveMB Feb 20, 2026
29a59e1
Merge branch 'split/15-manager-contracts' into split/16-executor-cont…
CoveMB Feb 20, 2026
c3752ad
Add shared mock and pyth helpers for AMM scripts
CoveMB Feb 20, 2026
109fdab
Merge branch 'split/24-shared-mock-prerequisites' into split/25-ammco…
CoveMB Feb 20, 2026
f537d55
Allow dapp integration to pass when no tests exist
CoveMB Feb 20, 2026
bcd4265
Merge branch 'split/00-ci-hygiene-baseline' into split/17-publish-fou…
CoveMB Feb 20, 2026
5468490
Merge branch 'split/17-publish-foundation' into split/15-manager-cont…
CoveMB Feb 20, 2026
d7ef4ac
Merge branch 'split/15-manager-contracts' into split/16-executor-cont…
CoveMB Feb 20, 2026
3de7292
Merge branch 'split/16-executor-contracts' into split/24-shared-mock-…
CoveMB Feb 20, 2026
ee1bbad
Merge branch 'split/24-shared-mock-prerequisites' into split/25-ammco…
CoveMB Feb 20, 2026
cb2b3ac
Skip AMM integration tests when pyth-mock is unavailable
CoveMB Feb 20, 2026
57a737d
Apply suggestions from code review
d-carmo Mar 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -euo pipefail

pnpm dapp format:move
pnpm lint:fix
node scripts/strip-move-localnet.js --staged
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ coverage

deployments/

packages/dapp/move/**/build/
packages/dapp/move/**/.trace
packages/dapp/move/**/.coverage*
packages/dapp/move/**/Pub.localnet.toml
packages/dapp/move/**/Move.lock
packages/dapp/move/**/Published.toml
packages/tooling/tests-integration/**/build/
packages/dapp/contracts/**/build/
packages/dapp/contracts/**/.trace
packages/dapp/contracts/**/.coverage*
packages/dapp/contracts/**/Pub.localnet.toml
packages/dapp/contracts/**/Published.toml

patches/pyth-crosschain/

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ To keep localnet-only Move.lock data out of commits, enable the repo hooks (this
git config --local core.hooksPath .githooks
```

This enables a pre-commit hook that strips the `[env.localnet]` block from any staged `Move.lock`.
Your working tree may still contain the localnet block; only the commit content is cleaned.
This enables a pre-commit hook that strips the `[env.test-publish]` block from any staged `Move.lock`.
Your working tree may still contain the test-publish block; only the commit content is cleaned.

To verify hooks are enabled:

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"ui": "pnpm --filter ui",
"script": "pnpm --filter dapp",
"dapp": "pnpm --filter dapp",
"learn": "pnpm --filter learn",
"tooling": "pnpm --filter tooling",
"typecheck": "tsc -b",
"lint": "eslint \"packages/**/*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}\"",
Expand Down
File renamed without changes.
71 changes: 71 additions & 0 deletions packages/dapp/contracts/prop-amm/Move.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Generated by move; do not edit
# This file should be checked in.

[move]
version = 4

[pinned.test-publish.MoveStdlib]
source = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/move-stdlib", rev = "22f9fc9781732d651e18384c9a8eb1dabddf73a6" }
use_environment = "test-publish"
manifest_digest = "C4FE4C91DE74CBF223B2E380AE40F592177D21870DC2D7EB6227D2D694E05363"
deps = {}

[pinned.test-publish.PropAmm]
source = { root = true }
use_environment = "test-publish"
manifest_digest = "C66389234060080B839236B8BDEF322DBBFD4F55C944FBDC236E812F170025F0"
deps = { deepbook = "deepbook", pyth = "Pyth", std = "MoveStdlib", sui = "Sui" }

[pinned.test-publish.Pyth]
source = { local = "../pyth-mock" }
use_environment = "test-publish"
manifest_digest = "2963D6B4689ED068546E86F8453FBCA51DCDF68A1C96D681328D2CDACE14B5CF"
deps = { std = "MoveStdlib", sui = "Sui" }

[pinned.test-publish.Sui]
source = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "22f9fc9781732d651e18384c9a8eb1dabddf73a6" }
use_environment = "test-publish"
manifest_digest = "7B6E5525FC0BFAECA61725298C425266BB21D456122669E3B2D3A4151A705F69"
deps = { MoveStdlib = "MoveStdlib" }

[pinned.test-publish.deepbook]
source = { git = "https://github.com/MystenLabs/deepbookv3.git", subdir = "packages/deepbook", rev = "4c2f8e22d54e40da9b44e297656ee1d4528612b2" }
use_environment = "test-publish"
manifest_digest = "4CE7EBF2D294B2073FAC96555A5584741C6DEAA89256AA4FD4FED535D3C79C54"
deps = { std = "MoveStdlib", sui = "Sui", token = "token" }

[pinned.test-publish.token]
source = { git = "https://github.com/MystenLabs/deepbookv3.git", subdir = "packages/token", rev = "4c2f8e22d54e40da9b44e297656ee1d4528612b2" }
use_environment = "test-publish"
manifest_digest = "2963D6B4689ED068546E86F8453FBCA51DCDF68A1C96D681328D2CDACE14B5CF"
deps = { std = "MoveStdlib", sui = "Sui" }

[pinned.testnet.MoveStdlib]
source = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/move-stdlib", rev = "563c15820b27dec9cbe75f826a3b6243ef44da1a" }
use_environment = "testnet"
manifest_digest = "C4FE4C91DE74CBF223B2E380AE40F592177D21870DC2D7EB6227D2D694E05363"
deps = {}

[pinned.testnet.PropAmm]
source = { root = true }
use_environment = "testnet"
manifest_digest = "EF55A39C03806D44F7224057AF3F6B7DC7E067950C63BB52702F3BF5557FC743"
deps = { deepbook = "deepbook", std = "MoveStdlib", sui = "Sui" }

[pinned.testnet.Sui]
source = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "563c15820b27dec9cbe75f826a3b6243ef44da1a" }
use_environment = "testnet"
manifest_digest = "7AFB66695545775FBFBB2D3078ADFD084244D5002392E837FDE21D9EA1C6D01C"
deps = { MoveStdlib = "MoveStdlib" }

[pinned.testnet.deepbook]
source = { git = "https://github.com/MystenLabs/deepbookv3.git", subdir = "packages/deepbook", rev = "4c2f8e22d54e40da9b44e297656ee1d4528612b2" }
use_environment = "testnet"
manifest_digest = "3101923B9428545A4F52FFAD1C4F959F9BFFF84CD09CE4BCC1CB831286999B5A"
deps = { std = "MoveStdlib", sui = "Sui", token = "token" }

[pinned.testnet.token]
source = { git = "https://github.com/MystenLabs/deepbookv3.git", subdir = "packages/token", rev = "4c2f8e22d54e40da9b44e297656ee1d4528612b2" }
use_environment = "testnet"
manifest_digest = "5745706258F61D6CE210904B3E6AE87A73CE9D31A6F93BE4718C442529332A87"
deps = { std = "MoveStdlib", sui = "Sui" }
13 changes: 13 additions & 0 deletions packages/dapp/contracts/prop-amm/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "amm"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name & version to be properly set.

edition = "2024"
version = "0.0.1"

[dependencies]
deepbook = { git = "https://github.com/MystenLabs/deepbookv3.git", subdir = "packages/deepbook", rev = "main" }
Comment on lines +6 to +7
Copy link

@coderabbitai coderabbitai bot Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Confirm whether this package still relies on a floating git ref and whether a lock file is the only immutable pin.
rg -n --glob 'Move.toml' 'deepbook.*rev\s*=\s*"main"'
fd '^Move\.lock(\.pinned)?$' packages/dapp/contracts -x sed -n '1,120p' {}

Repository: OpenZeppelin/openzeppelin-sui-amm

Length of output: 3712


Pin deepbook to an immutable ref in Move.toml.

Line 7 uses rev = "main", a floating reference. While Move.lock currently pins this to commit 4c2f8e22d54e40da9b44e297656ee1d4528612b2, the manifest should declare an explicit immutable ref (commit SHA or release tag) for clarity and to avoid relying on lock file regeneration. Pin it directly in Move.toml.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/dapp/contracts/prop-amm/Move.toml` around lines 6 - 7, Replace the
floating ref for the deepbook dependency in Move.toml (the [dependencies] entry
for deepbook) by pinning rev to the specific immutable commit SHA or release tag
currently used (the commit referenced in Move.lock, e.g.,
4c2f8e22d54e40da9b44e297656ee1d4528612b2) so the deepbook = { git = "...",
subdir = "packages/deepbook", rev = "<immutable-sha-or-tag>" } entry uses an
explicit immutable ref rather than "main".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to pin specific commit/version instead of main @CoveMB @qalisander

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!


[dep-replacements.test-publish]
pyth = { local = "../pyth-mock", rename-from = "Pyth", override = true }

[environments]
test-publish = "8051a268"
16 changes: 16 additions & 0 deletions packages/dapp/contracts/prop-amm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Prop AMM Move Package

This package contains the Prop AMM Move modules for configuration and execution.
It is experimental and unaudited.

## Purpose

- Define shared configuration for the AMM.
- Provide admin-gated updates and related events.
- Define execution-time state and events for trading.

## Usage

- Publish the package to initialize the admin capability.
- Call `create_amm_config_and_share` to create shared config and emit the creation event.
- Call `update_amm_config_and_emit` with an `AMMAdminCap` to change settings and emit the update event.
40 changes: 40 additions & 0 deletions packages/dapp/contracts/prop-amm/sources/executor.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/// Execution-time state and events for the AMM.
module amm::executor;

use sui::table::Table;

// === Structs ===

/// Per-trader account state.
///
/// Uses a table to map each pool ID to the trader's active order IDs.
public struct TraderAccount has key {
/// Unique ID for the account object.
id: UID,
/// Account owner.
owner: address,
/// Active order IDs keyed by pool ID (table entries are stored on-chain).
active_orders: Table<ID, vector<ID>>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it the best possible way for organising storage for order/pool ids?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is fine if we don't have that many ID's in vector. But would like to see how is it used

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fine if vector<ID> doesn't contain that many elements

}

// === Events ===

/// Emitted when a quote is updated.
public struct QuoteUpdatedEvent has copy, drop {
/// Pool identifier.
pool_id: ID,
/// Quote price.
price: u64,
/// Spread in basis points.
spread_bps: u64,
/// Quote timestamp in milliseconds.
timestamp_ms: u64,
}

/// Emitted when an order is executed.
public struct OrderExecutedEvent has copy, drop {
/// Order identifier.
order_id: ID,
/// Execution price.
fill_price: u64,
}
Loading