Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
18571f9
refactor(keeper): consume unified order aggregates
shev-titan Aug 7, 2026
4f1a1c5
refactor: use typed contract batch methods
shev-titan Aug 7, 2026
f807ff7
refactor: retire expired-order sweeper
shev-titan Aug 7, 2026
890fc7c
perf(pme): specialize resting order checks
shev-titan Aug 8, 2026
2bf1d05
perf(pme): compute liquidation margins together
shev-titan Aug 8, 2026
c0ecd98
fix(pme): fail closed on invalid spot prices
shev-titan Aug 8, 2026
b445276
fix(pme): preserve signed option convexity
shev-titan Aug 8, 2026
8661576
perf(pme): fast-return zero order margin
shev-titan Aug 8, 2026
863a4e6
perf(pme): collapse equivalent stress scenarios
shev-titan Aug 8, 2026
559f3af
fix(contracts): mirror signed perps entry value
shev-titan Aug 10, 2026
60aed6a
fix(keeper): decode signed perps entry value
shev-titan Aug 10, 2026
9e24a51
fix(market-maker): decode signed perps entry value
shev-titan Aug 10, 2026
e642d9b
fix(keeper): align integration harness with siblings
shev-titan Aug 10, 2026
ed089e7
refactor(futures): consume HashPowerFutures artifact
shev-titan Aug 10, 2026
fbc4515
fix(futures): sync consumer ABI
shev-titan Aug 10, 2026
ecb877b
fix(keeper): read futures orders via AtExpiration multicalls
shev-titan Aug 10, 2026
b4e8d29
feat(pme): add isLiquidatable — the canonical cross-venue health pred…
shev-titan Aug 10, 2026
d6eea43
refactor: drop venue isLiquidatable from mocks, ABIs and consumers
shev-titan Aug 10, 2026
b8a7647
fix(keeper): pin pnpm 10 to keep git subpath deps
shev-titan Aug 17, 2026
5f74df8
fix(ci): run market-maker tests on node 24
shev-titan Aug 17, 2026
d4e7659
fix(ci): pin siblings to the converged contract branches
shev-titan Aug 17, 2026
a8ac309
fix(keeper): read futures order ids without multicall3
shev-titan Aug 17, 2026
a1bf400
fix(ci): run market-maker tests through the package script
shev-titan Aug 17, 2026
a06131f
chore: adopt pnpm 11.22 across every package
shev-titan Aug 17, 2026
c4c6153
fix(ci): declare build allowances for pnpm 11
shev-titan Aug 17, 2026
8741e70
chore(points-indexer): track matchstick-ts by tag
shev-titan Aug 17, 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
52 changes: 15 additions & 37 deletions .github/workflows/keeper-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,44 +51,22 @@ jobs:
working-directory: ./keeper
run: pnpm install --frozen-lockfile

# pnpm git path deps must keep `path: /contracts/abi` in the lockfile
# resolution. If that field is dropped (integrity-only), a cold CI store
# unpacks the whole futures-marketplace repo and TypeCheck fails with
# TS2307 on futures-marketplace-abi/Futures.ts.
- name: Verify futures ABI package layout
# Keep the generated HashPowerFutures artifact vendored with the keeper
# until the upstream ABI package publishes the renamed module.
- name: Verify vendored HashPowerFutures ABI
working-directory: ./keeper
run: |
set -euo pipefail
pkg="node_modules/futures-marketplace-abi"
if [[ ! -e "$pkg" ]]; then
echo "::error::$pkg is missing after pnpm install"
ls -la node_modules | head -40
abi="src/abi/HashPowerFutures.ts"
if [[ ! -f "$abi" ]]; then
echo "::error::$abi is missing"
exit 1
fi
if [[ ! -f "$pkg/Futures.ts" ]]; then
echo "::error::$pkg/Futures.ts missing; lockfile likely dropped path:/contracts/abi (full repo unpacked)"
ls -la "$pkg" | head -40
if [[ -f "$pkg/contracts/abi/Futures.ts" ]]; then
echo "::error::Found Futures.ts under $pkg/contracts/abi — restore path: /contracts/abi in pnpm-lock.yaml resolution"
fi
if ! grep -q 'export const HashPowerFuturesAbi' "$abi"; then
echo "::error::$abi does not export HashPowerFuturesAbi"
exit 1
fi
if [[ ! -f "$pkg/package.json" ]]; then
echo "::error::$pkg/package.json missing"
ls -la "$pkg" | head -40
exit 1
fi
if grep -q '_pnpmPlaceholder' "$pkg/package.json"; then
echo "::error::$pkg/package.json is a pnpm placeholder; lockfile likely lost path:/contracts/abi"
exit 1
fi
if ! grep -q '"name": "futures-marketplace-abi"' "$pkg/package.json"; then
echo "::error::$pkg/package.json is not the abi package manifest"
cat "$pkg/package.json"
exit 1
fi
echo "futures-marketplace-abi layout ok:"
ls -la "$pkg" | head -20
echo "Vendored HashPowerFutures ABI present"

- name: Lint
working-directory: ./keeper
Expand All @@ -110,18 +88,18 @@ jobs:
uses: actions/checkout@v5
with:
repository: Lumerin-protocol/derivatives-marketplace
# createOrder with explicit TIF + getRiskView; implements this branch's
# engine interface (PR #90).
ref: 8df78601bbbad049cee962509f9c9e8b9d9b2503
# Signed netEntryValue on the position tuple; implements this branch's
# engine interface (PR #97).
ref: 316be14c529071df4d2ff71321ab4a6fbedcfaaf
path: perps

- name: Checkout futures-marketplace
uses: actions/checkout@v5
with:
repository: Lumerin-protocol/futures-marketplace
# createOrder with explicit TIF + getRiskView; implements this branch's
# engine interface (PR #247).
ref: 16d026960fa15d0fb73822e6750ae8e3f14a4c6d
# HashPowerFutures rename and per-delivery order reads; implements this
# branch's engine interface (PR #258).
ref: 5a543ae0c59c651790bc99a8550da9a2ffd30c2b
path: futures-marketplace

- name: Install perps contracts dependencies
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/market-maker-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Install pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@v6
with:
package_json_file: market-maker/package.json

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: "22"
node-version: "24"
cache: "pnpm"
cache-dependency-path: market-maker/pnpm-lock.yaml

Expand All @@ -63,8 +63,8 @@ jobs:
- name: Typecheck
run: pnpm typecheck

# Skip the pretest (which calls sync-abi.sh, requires the perps and
# futures-marketplace contract repos to be checked out side-by-side).
# Tests cover core/ and apps/ logic; ABI shape is validated at runtime.
# Must go through the package script: it supplies `--import=amaro/strip`,
# without which node refuses to strip types from the contract ABIs that
# ship as .ts inside node_modules.
- name: Run tests
run: node --test --test-force-exit --test-concurrency=1 'tests/**/*.test.ts'
run: pnpm test
5 changes: 5 additions & 0 deletions contracts/abi/ContractErrors.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"name": "NoPoints",
"type": "error"
},
{
"inputs": [],
"name": "OracleStale",
"type": "error"
},
{
"inputs": [
{
Expand Down
5 changes: 5 additions & 0 deletions contracts/abi/ContractErrors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ export const contractErrors = [
"name": "NoPoints",
"type": "error"
},
{
"inputs": [],
"name": "OracleStale",
"type": "error"
},
{
"inputs": [
{
Expand Down
43 changes: 43 additions & 0 deletions contracts/abi/IPortfolioMarginEngine.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,30 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "user",
"type": "address"
}
],
"name": "computePortfolioMargins",
"outputs": [
{
"internalType": "uint256",
"name": "im",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "mm",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
Expand Down Expand Up @@ -69,6 +93,25 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "user",
"type": "address"
}
],
"name": "isLiquidatable",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
Expand Down
43 changes: 43 additions & 0 deletions contracts/abi/IPortfolioMarginEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,30 @@ export const IPortfolioMarginEngineAbi = [
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "user",
"type": "address"
}
],
"name": "computePortfolioMargins",
"outputs": [
{
"internalType": "uint256",
"name": "im",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "mm",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
Expand Down Expand Up @@ -69,6 +93,25 @@ export const IPortfolioMarginEngineAbi = [
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "user",
"type": "address"
}
],
"name": "isLiquidatable",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
Expand Down
48 changes: 48 additions & 0 deletions contracts/abi/PortfolioMarginEngine.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@
"name": "OracleNotSet",
"type": "error"
},
{
"inputs": [],
"name": "OracleStale",
"type": "error"
},
{
"inputs": [
{
Expand Down Expand Up @@ -361,6 +366,30 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "user",
"type": "address"
}
],
"name": "computePortfolioMargins",
"outputs": [
{
"internalType": "uint256",
"name": "im",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "mm",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getLinearMarkets",
Expand Down Expand Up @@ -452,6 +481,25 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "user",
"type": "address"
}
],
"name": "isLiquidatable",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
Expand Down
48 changes: 48 additions & 0 deletions contracts/abi/PortfolioMarginEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ export const PortfolioMarginEngineAbi = [
"name": "OracleNotSet",
"type": "error"
},
{
"inputs": [],
"name": "OracleStale",
"type": "error"
},
{
"inputs": [
{
Expand Down Expand Up @@ -361,6 +366,30 @@ export const PortfolioMarginEngineAbi = [
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "user",
"type": "address"
}
],
"name": "computePortfolioMargins",
"outputs": [
{
"internalType": "uint256",
"name": "im",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "mm",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getLinearMarkets",
Expand Down Expand Up @@ -452,6 +481,25 @@ export const PortfolioMarginEngineAbi = [
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "user",
"type": "address"
}
],
"name": "isLiquidatable",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
Expand Down
Loading
Loading