build(agent): new-agents-2#7e3bbc iteration

This commit is contained in:
agent-7e3bbc424e07835b 2026-04-20 14:25:16 +02:00
parent 63d2b6d6c0
commit 88f9ec21d7
20 changed files with 149 additions and 1 deletions

21
.gitignore vendored Normal file
View File

@ -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

24
AGENTS.md Normal file
View File

@ -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 its 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.

View File

@ -1,3 +1,18 @@
# deltamesh-federated-privacy-preserving-c
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

2
delta_mesh/LocalMarket.c Normal file
View File

@ -0,0 +1,2 @@
#include "LocalMarket.h"
// Minimal implementation file for LocalMarket (toy MVP).

7
delta_mesh/LocalMarket.h Normal file
View File

@ -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;

BIN
delta_mesh/LocalMarket.o Normal file

Binary file not shown.

13
delta_mesh/Makefile Normal file
View File

@ -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

2
delta_mesh/PlanDelta.c Normal file
View File

@ -0,0 +1,2 @@
#include "PlanDelta.h"
// Minimal implementation file for PlanDelta (toy MVP).

6
delta_mesh/PlanDelta.h Normal file
View File

@ -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;

BIN
delta_mesh/PlanDelta.o Normal file

Binary file not shown.

View File

@ -0,0 +1,2 @@
#include "SharedSignals.h"
// Minimal implementation file for SharedSignals (toy MVP).

View File

@ -0,0 +1,5 @@
// Minimal SharedSignals primitive: aggregated greeks and liquidity hints.
typedef struct SharedSignals {
double aggregated_greeks;
double implied_vol;
} SharedSignals;

BIN
delta_mesh/SharedSignals.o Normal file

Binary file not shown.

12
delta_mesh/admm_lite.c Normal file
View File

@ -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;
}

3
delta_mesh/admm_lite.h Normal file
View File

@ -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);

BIN
delta_mesh/admm_lite.o Normal file

Binary file not shown.

BIN
delta_mesh/demo Executable file

Binary file not shown.

16
delta_mesh/demo_main.c Normal file
View File

@ -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;
}

BIN
delta_mesh/demo_main.o Normal file

Binary file not shown.

20
test.sh Normal file
View File

@ -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."