DiceAlpha

Protocol Specifications

Integration Specification & API

Technical specifications for developers executing custom high-frequency algorithms, linking WebSocket sub-nodes, and utilizing the local sandbox Lua compiler core.

1. Virtual machine

DiceAlpha parses algorithms using a client-side Lua 5.3 sandbox environment compiling to optimized bytecode for immediate execution.

2. Socket connection

Maintains secure WebSocket sessions running at up to 100Hz with standard binary encryption. Average ping latency stays under 12ms.

3. Local Sandbox

All processes run entirely isolated in a web worker environment, safeguarding client secrets and preventing host pollution.

Execution Loop Context

Sandboxed API global parameters

The integrated script runtime exposes the following globally accessible hooks and utility functions to orchestrate your strategy wagers:

roll(amount, chance, target)

Dispatches execution roll with wager amount, 0-100 win percentage, and "high" or "low" target.

onBet(win, profit, payout)

Primary event callback fired immediately upon resolution of a wagering outcome returning state values.

logInfo(message)

Saves trace system information to the debugger console terminal inside the editor workspace.

stop()

Instantly suspends programmatic loop execution and flags active nodes as disconnected from the marketplace.

Reference Lua Code snippet
RFC-4412 COMPLIANT
---
-- DiceAlpha Pro - High-Frequency Martingale
-- Target: Wolf.bet API v2 Protocol
---

local baseBet   = 0.00100000 -- Base wager in coin format
local targetWin = 49.50      -- Exact win probability %
local multiplier = 2.00      -- Calculated payout multiplier

local currentBet = baseBet
local totalLosses = 0

-- Register core engine bet hook
function onBet(win, profit, payout)
    if win then
        -- Reset wager back to base boundary
        currentBet = baseBet
        totalLosses = 0
        logInfo("Wager reset: win acquired")
    else
        -- Binary progression multiplier
        currentBet = currentBet * 2.0
        totalLosses = totalLosses + 1
        logWarning("Draw occurred. Loss multiplier applied. Current Stake: " .. currentBet)
    end
    
    -- Command execution on the core runner loop
    roll(currentBet, targetWin, "high")
end