mirror of
https://github.com/luxfi/dex.git
synced 2026-07-27 02:57:58 +00:00
refactor(dex): finish lx→dex fold — fix doc refs (pkg/lx → pkg/dex)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
8f67ba50f8
commit
9f7875d28b
@@ -2016,7 +2016,7 @@ go test -v ./pkg/gateway/...
|
||||
|
||||
Unified swap routing across on-chain V4 pools and off-chain broker venues. This package implements a Uniswap-style Trading API that aggregates liquidity from multiple sources — native DEX precompiles, V2/V3 AMM routers, and the Lux Broker REST API — returning the best-price quote to the caller. All endpoints are `net/http` handlers mounted on a standard `http.ServeMux` (Go 1.22+ method routing).
|
||||
|
||||
The package is consumed directly by a regulated securities ATS for its exchange trading API.
|
||||
The package is consumed directly by non-custodial trading front-ends and venue operators for their exchange trading API.
|
||||
|
||||
### Constructor
|
||||
|
||||
@@ -2097,9 +2097,9 @@ ABI encoding for the LXRouter precompile at `0x000000000000000000000000000000000
|
||||
|
||||
**Decoding helpers:** `DecodeCalldata` (split selector + params), `DecodeUint256`, `DecodeAddress` — used by tests and downstream consumers to verify built calldata.
|
||||
|
||||
### Usage by ATS
|
||||
### Usage by a venue operator
|
||||
|
||||
A regulated securities ATS imports the trading package and wires it with venue instances:
|
||||
A non-custodial venue operator imports the trading package and wires it with venue instances:
|
||||
|
||||
```go
|
||||
import "github.com/luxfi/dex/pkg/trading"
|
||||
|
||||
@@ -89,7 +89,7 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/luxfi/dex/pkg/lx"
|
||||
"github.com/luxfi/dex/pkg/dex"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -287,7 +287,7 @@ fmt.Printf("Latency: %d ns\n", result.LatencyNanos)
|
||||
The `TradingEngine` orchestrates multiple order books and integrates with DeFi components:
|
||||
|
||||
```go
|
||||
import "github.com/luxfi/dex/pkg/lx"
|
||||
import "github.com/luxfi/dex/pkg/dex"
|
||||
|
||||
config := lx.EngineConfig{
|
||||
EnablePerps: true,
|
||||
|
||||
@@ -100,7 +100,7 @@ chmod +x lx-dex
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/luxfi/dex/pkg/lx"
|
||||
"github.com/luxfi/dex/pkg/dex"
|
||||
"github.com/luxfi/dex/pkg/types"
|
||||
)
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ The matching engine itself is completely asset-agnostic. All regulatory logic li
|
||||
### 1. Define Your Market
|
||||
|
||||
```go
|
||||
import "github.com/luxfi/dex/pkg/lx"
|
||||
import "github.com/luxfi/dex/pkg/dex"
|
||||
|
||||
market := lx.NewSecuritiesMarket(lx.MarketConfig{
|
||||
Symbol: "ACME-USD",
|
||||
@@ -382,7 +382,7 @@ import (
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/luxfi/dex/pkg/lx"
|
||||
"github.com/luxfi/dex/pkg/dex"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -441,9 +441,9 @@ func main() {
|
||||
See the Go package documentation:
|
||||
|
||||
```bash
|
||||
go doc github.com/luxfi/dex/pkg/lx SecuritiesMarket
|
||||
go doc github.com/luxfi/dex/pkg/lx MarketConfig
|
||||
go doc github.com/luxfi/dex/pkg/lx StandardEligibilityChecker
|
||||
go doc github.com/luxfi/dex/pkg/lx TransferRestriction
|
||||
go doc github.com/luxfi/dex/pkg/lx ComplianceError
|
||||
go doc github.com/luxfi/dex/pkg/dex SecuritiesMarket
|
||||
go doc github.com/luxfi/dex/pkg/dex MarketConfig
|
||||
go doc github.com/luxfi/dex/pkg/dex StandardEligibilityChecker
|
||||
go doc github.com/luxfi/dex/pkg/dex TransferRestriction
|
||||
go doc github.com/luxfi/dex/pkg/dex ComplianceError
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user