mirror of
https://github.com/luxfi/dex.git
synced 2026-09-24 00:26:31 +00:00
Add pkg/price package with pluggable price sources: - OrderbookSource: Local orderbook mid-price (<100ns target) - PythSource: Pyth Network WebSocket real-time feed - ChainlinkSource: Chainlink oracle polling - CChainSource: Lux C-Chain AMM pool prices Oracle aggregator with: - Weighted median price aggregation - TWAP/VWAP calculations (5-minute windows) - Circuit breakers for price validation - Multi-source confidence scoring - Outlier detection and filtering Designed for co-located HFT clients requiring sub-millisecond latency for cross-market arbitrage. Also adds LLM.md project documentation with CLAUDE.md and AGENTS.md symlinked for AI assistant context.
18 lines
470 B
Go
18 lines
470 B
Go
package price
|
|
|
|
import "errors"
|
|
|
|
var (
|
|
// ErrNotFound indicates a price is not available.
|
|
ErrNotFound = errors.New("price not found")
|
|
|
|
// ErrStale indicates a price is too old.
|
|
ErrStale = errors.New("price is stale")
|
|
|
|
// ErrInsufficientSources indicates not enough price sources.
|
|
ErrInsufficientSources = errors.New("insufficient price sources")
|
|
|
|
// ErrCircuitBreaker indicates circuit breaker tripped.
|
|
ErrCircuitBreaker = errors.New("circuit breaker tripped")
|
|
)
|