build(agent): new-agents-2#7e3bbc iteration
This commit is contained in:
parent
63d2b6d6c0
commit
88f9ec21d7
|
|
@ -0,0 +1,21 @@
|
||||||
|
node_modules/
|
||||||
|
.npmrc
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
__tests__/
|
||||||
|
coverage/
|
||||||
|
.nyc_output/
|
||||||
|
dist/
|
||||||
|
build/
|
||||||
|
.cache/
|
||||||
|
*.log
|
||||||
|
.DS_Store
|
||||||
|
tmp/
|
||||||
|
.tmp/
|
||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
.venv/
|
||||||
|
venv/
|
||||||
|
*.egg-info/
|
||||||
|
.pytest_cache/
|
||||||
|
READY_TO_PUBLISH
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
# DeltaMesh MVP and Architecture
|
||||||
|
|
||||||
|
Overview
|
||||||
|
- DeltaMesh is a federated, privacy-preserving cross-venue options market-making engine.
|
||||||
|
- This repo contains an initial, production-oriented skeleton to bootstrap an MVP focused on the federation and privacy aspects, with a minimal, compilable C prototype for local markets, shared signals, and delta planning.
|
||||||
|
|
||||||
|
What you will find here
|
||||||
|
- Canonical primitives (LocalMarket, SharedSignals, PlanDelta) with tiny, well-scoped C implementations.
|
||||||
|
- A lightweight ADMM-like coordinator implemented as delta synchronization at the toy level (admm_lite).
|
||||||
|
- An adapter-stub that demonstrates how a data feed and a venue adapter could be wired in; for now it’s a toy example in demo_main.c.
|
||||||
|
- A small, self-contained test harness (test.sh) to compile and run the demo in a deterministic, repeatable way.
|
||||||
|
|
||||||
|
How to contribute
|
||||||
|
- Start with the delta_mesh/ directory; add adapters under delta_mesh/Adapters if needed.
|
||||||
|
- Keep interfaces minimal and stable; add new primitives only when they are durable enough for reuse across venues.
|
||||||
|
- Ensure tests compile and pass locally before proposing broader changes.
|
||||||
|
|
||||||
|
Development process
|
||||||
|
- Use the MVP plan: Phase 0 skeleton, Phase 1 governance and secure aggregation, Phase 2 cross-venue pilot, Phase 3 SDKs and conformance tests.
|
||||||
|
- For new features, add a small integration test that demonstrates the feature in a deterministic, isolated way.
|
||||||
|
|
||||||
|
Guidance for reviewers
|
||||||
|
- Prioritize safety, privacy, and auditor-ability aspects; ensure deterministic behavior on reconnects and partition handling.
|
||||||
|
- Avoid exposing real inventories or live quotes in tests; use toy values.
|
||||||
17
README.md
17
README.md
|
|
@ -1,3 +1,18 @@
|
||||||
# deltamesh-federated-privacy-preserving-c
|
# deltamesh-federated-privacy-preserving-c
|
||||||
|
|
||||||
Problem: Cross-venue options liquidity is fragmented and current market-making tools force users to share sensitive inventory, quotes, and risk signals with centralized servers, exposing edge data and increasing regulatory/compliance risk. Latency, d
|
This repository contains an initial skeleton for DeltaMesh, a federated, privacy-preserving cross-venue options market-making engine. The MVP components here are intentionally small and self-contained to enable iterative integration with more complete adapters and governance tooling.
|
||||||
|
|
||||||
|
MVP snapshot
|
||||||
|
- LocalMarket, SharedSignals, PlanDelta primitives (C structs) with tiny stubs
|
||||||
|
- Lightweight ADMM-lite coordination in admm_lite.c
|
||||||
|
- Toy demo and test harness under delta_mesh/ (demo_main.c, test.sh)
|
||||||
|
- An AGENTS.md documenting project governance and integration approach
|
||||||
|
|
||||||
|
How to run the MVP demo
|
||||||
|
- Ensure you have a C toolchain (gcc) available.
|
||||||
|
- From the repo root, run: ./test.sh
|
||||||
|
|
||||||
|
This will compile a small demo that fabricates two venue inventories and shows an aggregated quote produced by a toy ADMM-like step.
|
||||||
|
|
||||||
|
|
||||||
|
Problem: Cross-venue options liquidity is fragmented and current market-making tools force users to share sensitive inventory, quotes, and risk signals with centralized servers, exposing edge data and increasing regulatory/compliance risk. Latency, d
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
#include "LocalMarket.h"
|
||||||
|
// Minimal implementation file for LocalMarket (toy MVP).
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
// Minimal LocalMarket primitive: per-venue market/book state.
|
||||||
|
// This header defines the core struct used by the toy MVP demo.
|
||||||
|
typedef struct LocalMarket {
|
||||||
|
const char* venue; // venue identifier (name)
|
||||||
|
double inventory; // simple inventory proxy (not a real book)
|
||||||
|
double risk_budget; // risk budget allocated to this venue
|
||||||
|
} LocalMarket;
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,13 @@
|
||||||
|
CC := gcc
|
||||||
|
CFLAGS := -Wall -Wextra -O2
|
||||||
|
|
||||||
|
all: delta_mesh_demo
|
||||||
|
|
||||||
|
delta_mesh_demo: demo_main.o admm_lite.o LocalMarket.o SharedSignals.o PlanDelta.o
|
||||||
|
$(CC) $(CFLAGS) -o delta_mesh_demo/demo delta_mesh/demo_main.o delta_mesh/admm_lite.o delta_mesh/LocalMarket.o delta_mesh/SharedSignals.o delta_mesh/PlanDelta.o
|
||||||
|
|
||||||
|
%.o: %.c
|
||||||
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *.o delta_mesh_demo/demo
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
#include "PlanDelta.h"
|
||||||
|
// Minimal implementation file for PlanDelta (toy MVP).
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
// Minimal PlanDelta primitive: routing/updating plan for quotes/hedges.
|
||||||
|
typedef struct PlanDelta {
|
||||||
|
double quote; // proposed quote level
|
||||||
|
double hedge; // proposed hedge amount
|
||||||
|
unsigned long timestamp; // monotonic timestamp for replayability
|
||||||
|
} PlanDelta;
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,2 @@
|
||||||
|
#include "SharedSignals.h"
|
||||||
|
// Minimal implementation file for SharedSignals (toy MVP).
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
// Minimal SharedSignals primitive: aggregated greeks and liquidity hints.
|
||||||
|
typedef struct SharedSignals {
|
||||||
|
double aggregated_greeks;
|
||||||
|
double implied_vol;
|
||||||
|
} SharedSignals;
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,12 @@
|
||||||
|
#include "admm_lite.h"
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
// Simple average aggregator to mock cross-venue coordination.
|
||||||
|
void admm_lite_step(const double* quotes, int n, double* out_aggregate) {
|
||||||
|
if (quotes == NULL || n <= 0 || out_aggregate == NULL) return;
|
||||||
|
double sum = 0.0;
|
||||||
|
for (int i = 0; i < n; ++i) {
|
||||||
|
sum += quotes[i];
|
||||||
|
}
|
||||||
|
*out_aggregate = sum / (double)n;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
// Lightweight ADMM-like coordination interface (toy implementation).
|
||||||
|
// Exposes a single-step aggregation over a set of venue quotes.
|
||||||
|
void admm_lite_step(const double* quotes, int n, double* out_aggregate);
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,16 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "LocalMarket.h"
|
||||||
|
#include "admm_lite.h"
|
||||||
|
|
||||||
|
// A tiny demo that creates two LocalMarkets and demonstrates a simple ADMM-lite step.
|
||||||
|
int main(void) {
|
||||||
|
LocalMarket v1 = {"VenueA", 100.0, 50.0};
|
||||||
|
LocalMarket v2 = {"VenueB", 150.0, 75.0};
|
||||||
|
|
||||||
|
double quotes[2] = { v1.inventory, v2.inventory };
|
||||||
|
double aggregate = 0.0;
|
||||||
|
admm_lite_step(quotes, 2, &aggregate);
|
||||||
|
|
||||||
|
printf("DeltaMesh DEMO: aggregated quote = %f\n", aggregate);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,20 @@
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
echo "Building DeltaMesh toy MVP..."
|
||||||
|
cc=gcc
|
||||||
|
CCFLAGS="-Wall -Wextra -O2"
|
||||||
|
ROOT=$(pwd)
|
||||||
|
|
||||||
|
mkdir -p delta_mesh
|
||||||
|
echo "Compiling delta_mesh components..."
|
||||||
|
$cc $CCFLAGS -c delta_mesh/demo_main.c -o delta_mesh/demo_main.o
|
||||||
|
$cc $CCFLAGS -c delta_mesh/admm_lite.c -o delta_mesh/admm_lite.o
|
||||||
|
$cc $CCFLAGS -c delta_mesh/LocalMarket.c -o delta_mesh/LocalMarket.o || true
|
||||||
|
$cc $CCFLAGS -c delta_mesh/SharedSignals.c -o delta_mesh/SharedSignals.o || true
|
||||||
|
$cc $CCFLAGS -c delta_mesh/PlanDelta.c -o delta_mesh/PlanDelta.o || true
|
||||||
|
$cc $CCFLAGS -o delta_mesh/demo delta_mesh/demo_main.o delta_mesh/admm_lite.o delta_mesh/LocalMarket.o delta_mesh/SharedSignals.o delta_mesh/PlanDelta.o
|
||||||
|
|
||||||
|
echo "Running demo..."
|
||||||
|
./delta_mesh/demo
|
||||||
|
|
||||||
|
echo "Done."
|
||||||
Loading…
Reference in New Issue