Developers Integration Guide

Complete guide for CTOs and developers of prop firms, brokers, and exchanges
Learn how to integrate VCP into your existing systems

Get Started in 5 Minutes

1. Install SDK

Choose SDK for your environment

2. Log Events

Record trading events in VCP format

3. Verify

Check transparency with VCP Explorer

Open VCP Explorer

Verify your VCP chain integrity in real-time

Recommended: Start with Silver Tier Shadow Logging

Begin with "shadow logging" to generate VCP logs in parallel with your production system without any impact.

# Simple Python implementation
pip install vcp-core-py

from vcp import VCPLogger, Tier

# Initialize Silver Tier logger
logger = VCPLogger(tier=Tier.SILVER, private_key="your-key")

# Record trading events
logger.log_order(
    symbol="EURUSD",
    side="BUY",
    quantity="100000",
    price="1.08450"
)

# Save locally (runs parallel to production)
logger.save("./vcp_logs/")

Official SDKs

vcp-core-py

Python 3.8+

For data scientists, risk managers, and backtesting. Easy integration with high-level API.

Backtest auditing
VCP-RISK log generation
RFC 8785 JSON canonicalization
pip install vcp-core-py
View code examples

vcp-core-cpp

C++17/20

For HFT engineers and exchange developers. Ultra-low latency implementation at microsecond level.

SBE binary encoding
PTP clock integration
Zero-copy memory pool
# Install via CMake
git clone https://github.com/vso/vcp-core-cpp
cmake -B build && cmake --build build
View code examples

vcp-mql-bridge

MQL4/5

For retail prop developers and EA developers. Easy MT4/MT5 integration via DLL/EA.

Async HTTP communication
Client-side signing
MT4/5 event hooks
// Copy to MT4/MT5 Expert folder
// #include <VCP_Bridge.mqh>
View code examples

Compliance Tiers

Choose from three compliance tiers based on your business requirements and technical constraints.

Platinum Tier

For HFT, Exchanges, Institutional Traders

Highest Precision

Technical Requirements

  • Clock Sync: PTP (IEEE 1588) nanosecond precision
  • Implementation: Kernel bypass (DPDK/AF_XDP)
  • Latency: <1μs logging overhead
  • SDK: vcp-core-cpp (C++17/20)

Use Cases

  • High-Frequency Trading (HFT)
  • Cryptocurrency Exchanges
  • Institutional Algorithmic Trading
  • Full MiFID II Compliance
// C++ Platinum implementation (SBE binary encoding)
#include <vcp/platinum.hpp>

vcp::PlatinumLogger logger(
    vcp::ClockSource::PTP_HARDWARE,  // PTP hardware clock
    vcp::Encoding::SBE                // Simple Binary Encoding
);

// High-precision logging in microseconds
logger.log_order_accepted(order_id, timestamp_ns);

Gold Tier

For Mid-Size Brokers & Prop Firms

Recommended

Technical Requirements

  • Clock Sync: NTP microsecond precision
  • Implementation: Server-side integration
  • Latency: <100μs logging overhead
  • SDK: vcp-core-py / vcp-core-cpp

Use Cases

  • Mid-size brokers
  • Prop trading firms
  • Algorithmic trading platforms
  • Regulatory compliance
# Python Gold implementation (server-side integration)
from vcp import VCPLogger, Tier, ClockSync

logger = VCPLogger(
    tier=Tier.GOLD,
    clock_sync=ClockSync.NTP_SYNCED,
    private_key_path="./server_key.pem"
)

# Intercept trading events on server side
@trading_engine.on_order_executed
def log_execution(order):
    logger.log_execution(
        order_id=order.id,
        symbol=order.symbol,
        side=order.side,
        quantity=str(order.quantity),
        price=str(order.price)
    )

Silver Tier

For White-Label & Small-Scale Operators

Fastest Setup

Technical Requirements

  • Clock Sync: NTP/Best-effort millisecond precision
  • Implementation: Client-side integration
  • Latency: Async (no impact on trading)
  • SDK: vcp-mql-bridge (MT4/MT5)

Use Cases

  • White-label prop firms
  • Small brokers
  • Individual trader EAs
  • Pilot deployment & PoC

Strategic Value of Silver Tier

White-label operators cannot modify broker servers, but Silver Tier's "client-side signing" allows independent audit logs without broker involvement. This is not a technical compromise—it's a governance innovation.

// MQL5 Silver implementation (client-side signing)
#include <VCP_Bridge.mqh>

// Setup VCP logger on EA initialization
int OnInit() {
    VCP_Init(TIER_SILVER, "client_private_key");
    return INIT_SUCCEEDED;
}

// Automatic logging on orders
void OnTradeTransaction(const MqlTradeTransaction& trans) {
    if (trans.type == TRADE_TRANSACTION_ORDER_ADD) {
        // Send VCP log async (no impact on trading)
        VCP_LogOrder(trans.order, trans.symbol, trans.volume);
    }
}

Integration Patterns

Pattern A: Sidecar Integration

Run as external process parallel to trading platform without modifying core engine.

Data Flow

  1. Order placed from trader's terminal
  2. Bridge EA detects event, generates UUID
  3. Build JSON payload and sign
  4. Send async to VeritasChain Cloud (VCC)

Benefits

  • • Independent from broker infrastructure
  • • Generate independent audit logs
  • • Detect data tampering

Pattern B: Shadow Logging

RECOMMENDED

Generate VCP logs parallel to existing system (initial migration phase). Perfect for PoC and risk-free deployment.

Phased Migration Process

1
Shadow Logging

Run parallel to existing system, no production impact

2
Hybrid Operation

Start referencing VCP logs for internal audits and dispute resolution

3
Full Migration

Designate VCP chain as Golden Source

Why This Works for Prop Firms

Silver/Gold Tier operators can start logging without touching production systems. This is the standard path recommended in VCP Specification for initial deployment.

Pattern C: VeritasChain Cloud (VCC)

SaaS solution: Achieve VCP compliance without running your own nodes.

VCC Features

  • No infrastructure management
  • Send logs via REST API
  • Automatic anchoring & verification
  • Dashboard & Explorer provided
# VCC API usage example
curl -X POST https://api.veritaschain.cloud/v1/events \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "event_type": "ORDER_ACCEPTED",
    "symbol": "BTCUSD",
    "side": "BUY",
    "quantity": "0.5",
    "price": "45000.00"
  }'

Pattern D: VeritasChain Cloud (VCC)

Bypass OS network stack, access data directly from NIC. For HFT firms only.

Technical Details

# VCC API usage example
curl -X POST https://api.veritaschain.cloud/v1/events \
  -H "Authorization: Bearer YOUR_API_KEY" \
                    

HFT Optimization

In microsecond-competitive HFT environments, logging is designed not to block trading threads. Platinum Tier exclusive ultra-low latency implementation.

Code Examples

Python: Backtest Audit Implementation

#!/usr/bin/env python3
"""
VCP Backtest Audit Logger
Record all backtest trades in auditable format
"""
from vcp import VCPLogger, Tier, EventType
from datetime import datetime
import uuid

# Initialize logger (Silver Tier, test environment)
logger = VCPLogger(
    tier=Tier.SILVER,
    private_key_path="./test_key.pem",
    output_dir="./vcp_audit_logs/"
)

# Log backtest trade events
def log_backtest_trade(symbol, side, quantity, price, timestamp):
    """
    Log backtest trade in VCP format
    
    Args:
        symbol: Currency pair (e.g., "EURUSD")
        side: BUY / SELL
        quantity: Quantity (String type to maintain precision)
        price: Price (String type to maintain precision)
        timestamp: Trading timestamp
    """
    event_id = str(uuid.uuid7())  # UUID v7 for chronological sorting
    
    logger.log_event(
        event_id=event_id,
        event_type=EventType.ORDER_ACCEPTED,
        timestamp=timestamp,
        payload={
            "symbol": symbol,
            "side": side,
            "quantity": str(quantity),  # Must be String type
            "price": str(price),        # Must be String type
            "backtest": True,
            "strategy": "mean_reversion_v2"
        }
    )

# Usage example
if __name__ == "__main__":
    # Backtest loop
    trades = [
        ("EURUSD", "BUY", "100000", "1.08450", datetime.now()),
        ("GBPUSD", "SELL", "50000", "1.26320", datetime.now()),
    ]
    
    for symbol, side, qty, price, ts in trades:
        log_backtest_trade(symbol, side, qty, price, ts)
    
    # Verify VCP chain
    if logger.verify_chain():
        print("✓ Backtest log integrity confirmed")
        logger.export_json("backtest_audit_2024.json")
    else:
        print("✗ Chain integrity error detected")

C++: Ultra-Low Latency HFT Implementation

/**
 * VCP Platinum Tier Logger for HFT
 * Microsecond-level low latency implementation
 */
#include <vcp/platinum.hpp>
#include <vcp/sbe_encoder.hpp>
#include <vcp/ptp_clock.hpp>

class HFTVCPLogger {
private:
    vcp::PlatinumLogger logger_;
    vcp::PTPClock ptp_clock_;
    vcp::SBEEncoder encoder_;
    vcp::RingBuffer<vcp::TradeEvent, 65536> event_buffer_;

public:
    HFTVCPLogger() 
        : logger_(vcp::ClockSource::PTP_HARDWARE, vcp::Encoding::SBE),
          ptp_clock_("/dev/ptp0"),
          encoder_(),
          event_buffer_() {
        // Lock-free ring buffer for async logging
        logger_.set_async_mode(true);
    }

    // Log order accepted event with nanosecond precision
    inline void log_order_accepted(
        uint64_t order_id,
        const char* symbol,
        Side side,
        const char* quantity,
        const char* price
    ) {
        // Get timestamp directly from PTP hardware clock
        uint64_t timestamp_ns = ptp_clock_.now_ns();
        
        // Zero-copy encoding with SBE
        vcp::TradeEvent event;
        event.event_id = vcp::uuid_v7_generate(timestamp_ns);
        event.event_type = vcp::EventType::ORDER_ACCEPTED;
        event.timestamp_ns = timestamp_ns;
        event.order_id = order_id;
        std::strncpy(event.symbol, symbol, sizeof(event.symbol));
        event.side = side;
        std::strncpy(event.quantity, quantity, sizeof(event.quantity));
        std::strncpy(event.price, price, sizeof(event.price));
        
        // Push to ring buffer (lock-free, doesn't block trading thread)
        event_buffer_.push(event);
    }

    // Periodic flush in background thread
    void async_flush_worker() {
        while (running_) {
            vcp::TradeEvent event;
            if (event_buffer_.pop(event)) {
                logger_.write_event(event);
            }
        }
    }
};

// Usage example
int main() {
    HFTVCPLogger vcp_logger;
    
    // Trading engine callback
    trading_engine.on_order_accepted([&](const Order& order) {
        // Less than 1 microsecond overhead
        vcp_logger.log_order_accepted(
            order.id,
            order.symbol.c_str(),
            order.side,
            order.quantity_str.c_str(),
            order.price_str.c_str()
        );
    });
    
    return 0;
}

MQL5: Client-Side Signing EA for MT5

//+------------------------------------------------------------------+
//|                                            VCP_ClientLogger.mq5 |
//|                                  VeritasChain Standards Org     |
//|                                       https://veritaschain.org  |
//+------------------------------------------------------------------+
#property copyright "VeritasChain Standards Organization"
#property link      "https://veritaschain.org"
#property version   "1.00"

#include <VCP_Bridge.mqh>

// Global variables
CVCPBridge vcp;
string private_key = "your_private_key_here";  // Retrieve from encrypted storage in production

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit() {
    // Initialize VCP Bridge (Silver Tier, client-side signing)
    if (!vcp.Init(TIER_SILVER, private_key)) {
        Print("VCP initialization error");
        return INIT_FAILED;
    }
    
    Print("VCP Logger initialized (Silver Tier)");
    Print("Client-side signing mode: Broker-independent");
    
    return INIT_SUCCEEDED;
}

//+------------------------------------------------------------------+
//| Trade transaction event handler                                  |
//+------------------------------------------------------------------+
void OnTradeTransaction(
    const MqlTradeTransaction& trans,
    const MqlTradeRequest& request,
    const MqlTradeResult& result
) {
    // When order is added
    if (trans.type == TRADE_TRANSACTION_ORDER_ADD) {
        LogOrderAccepted(trans, request);
    }
    
    // When order is executed
    if (trans.type == TRADE_TRANSACTION_DEAL_ADD) {
        LogOrderExecuted(trans, result);
    }
}

//+------------------------------------------------------------------+
//| Log order accepted to VCP                                        |
//+------------------------------------------------------------------+
void LogOrderAccepted(
    const MqlTradeTransaction& trans,
    const MqlTradeRequest& request
) {
    // Build VCP event
    VCPEvent event;
    event.event_id = vcp.GenerateUUIDv7();  // Generate UUID v7
    event.event_type = "ORDER_ACCEPTED";
    event.timestamp = TimeGMT();
    
    // Payload (JSON format)
    string payload = StringFormat(
        "{\"symbol\":\"%s\",\"side\":\"%s\",\"quantity\":\"%s\",\"price\":\"%s\",\"order_id\":%I64d}",
        trans.symbol,
        (trans.order_type == ORDER_TYPE_BUY || trans.order_type == ORDER_TYPE_BUY_LIMIT) ? "BUY" : "SELL",
        DoubleToString(trans.volume, 2),  // Convert to String (maintain precision)
        DoubleToString(trans.price, _Digits),  // Convert to String
        trans.order
    );
    event.payload = payload;
    
    // Sign client-side and send to VCC
    if (vcp.SendEventAsync(event)) {
        Print("✓ VCP log sent successfully: ", event.event_id);
    } else {
        Print("✗ VCP log send failed (added to retry queue)");
    }
}

//+------------------------------------------------------------------+
//| Log order execution to VCP                                       |
//+------------------------------------------------------------------+
void LogOrderExecuted(
    const MqlTradeTransaction& trans,
    const MqlTradeResult& result
) {
    VCPEvent event;
    event.event_id = vcp.GenerateUUIDv7();
    event.event_type = "ORDER_EXECUTED";
    event.timestamp = TimeGMT();
    
    string payload = StringFormat(
        "{\"deal_id\":%I64d,\"order_id\":%I64d,\"symbol\":\"%s\",\"volume\":\"%s\",\"price\":\"%s\"}",
        trans.deal,
        trans.order,
        trans.symbol,
        DoubleToString(trans.volume, 2),
        DoubleToString(trans.price, _Digits)
    );
    event.payload = payload;
    
    vcp.SendEventAsync(event);
}

//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason) {
    // Flush pending events
    vcp.FlushPendingEvents();
    Print("VCP Logger stopped");
}

GitHub Repositories

VCP Specification

Official specification, schema definitions, conformance tests

View vcp-spec

Python SDK

vcp-core-py: Python library and documentation

View vcp-core-py

C++ SDK

vcp-core-cpp: C++ library for HFT

View vcp-core-cpp

MQL Bridge

vcp-mql-bridge: MT4/MT5 integration library

View vcp-mql-bridge

Community Contributions

VCP is an open standard. We welcome pull requests, bug reports, and feature proposals.

View GitHub Organization

Need Technical Support?

Contact us for integration questions, PoC support, or enterprise deployment consultation