deltamesh-federated-privacy.../delta_mesh/EnergiBridge.h

45 lines
1.6 KiB
C

// Minimal EnergiBridge: bridge DeltaMesh primitives to a vendor-agnostic CatOpt representation
// This is a tiny, production-friendly adapter skeleton to demonstrate a canonical bridge
// and deterministic data-plane mappings for MVP instrumentation.
#ifndef ENERGY_BRIDGE_H
#define ENERGY_BRIDGE_H
#include "LocalMarket.h"
#include "SharedSignals.h"
#include "PlanDelta.h"
// Canonical CatOpt-like object representation
typedef struct CatOpt_Object {
const char* venue; // venue identifier
double inventory; // per-venue inventory proxy
double risk_budget; // risk budget allocated to this venue
unsigned long version; // per-message version for replayability
} CatOpt_Object;
// Canonical CatOpt-like signal representation (aggregated signals)
typedef struct CatOpt_Signal {
double aggregated_greeks;
double implied_vol;
unsigned long version;
} CatOpt_Signal;
// Canonical CatOpt-like plan delta representation (routing/hedge plan)
typedef struct CatOpt_PlanDelta {
double quote;
double hedge;
unsigned long timestamp; // monotonic timestamp for replay
unsigned long version;
} CatOpt_PlanDelta;
// Map a LocalMarket instance to a CatOpt_Object. This is intentionally simple and side-effect free.
void EnergiBridge_map_LocalMarket_to_CatOpt(const LocalMarket* lm, CatOpt_Object* out);
// Map SharedSignals to a CatOpt_Signal.
void EnergiBridge_map_SharedSignals_to_CatOpt(const SharedSignals* ss, CatOpt_Signal* out);
// Map PlanDelta to a CatOpt_PlanDelta (with version for conformance).
void EnergiBridge_map_PlanDelta_to_CatOpt(const PlanDelta* pd, CatOpt_PlanDelta* out);
#endif