mirror of
https://github.com/luxfi/chains.git
synced 2026-09-24 00:26:00 +00:00
- dexvm.VMID: [32]byte → ids.ID (consistent with other 10 VMs) - quantumvm RPC service: "qvm" → "quantumvm" (matches package + dir) Removes last vestiges of the old short-name convention.
50 lines
1.5 KiB
Go
50 lines
1.5 KiB
Go
// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
// Package dexvm implements a high-performance decentralized exchange VM
|
|
// for the Lux blockchain network.
|
|
//
|
|
// The DEX VM provides:
|
|
// - Central Limit Order Book (CLOB) trading with nanosecond price updates
|
|
// - Automated Market Maker (AMM) liquidity pools
|
|
// - Cross-chain atomic swaps via Warp messaging
|
|
// - 200ms block times for high-frequency trading
|
|
// - LX-First arbitrage strategy support
|
|
//
|
|
// Architecture:
|
|
// - Uses Quasar consensus (BLS + Corona + ML-DSA) for finality
|
|
// - Integrates with Warp 1.5 for cross-chain messaging
|
|
// - Supports both spot and perpetual trading
|
|
// - Designed for institutional-grade performance
|
|
package dexvm
|
|
|
|
import (
|
|
"github.com/luxfi/chains/dexvm/config"
|
|
"github.com/luxfi/ids"
|
|
"github.com/luxfi/log"
|
|
"github.com/luxfi/node/vms"
|
|
)
|
|
|
|
var (
|
|
// VMID is the unique identifier for the DEX VM
|
|
VMID = ids.ID{'d', 'e', 'x', 'v', 'm'}
|
|
|
|
_ vms.Factory = (*Factory)(nil)
|
|
)
|
|
|
|
// Factory creates new DEX VM instances.
|
|
type Factory struct {
|
|
config.Config
|
|
}
|
|
|
|
// New implements vms.Factory interface.
|
|
// It creates a new DEX ChainVM instance with the factory's configuration.
|
|
// The ChainVM wrapper implements block.ChainVM for integration with the chains manager.
|
|
func (f *Factory) New(logger log.Logger) (interface{}, error) {
|
|
// Create the ChainVM wrapper which implements block.ChainVM
|
|
chainVM := NewChainVM(logger)
|
|
// Apply factory config to inner VM
|
|
chainVM.inner.Config = f.Config
|
|
return chainVM, nil
|
|
}
|