Files
dex/pkg/price/errors.go
T
zeekay 1b4c54b3a8 feat: Add multi-source price aggregation for HFT trading
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.
2025-12-11 11:54:54 -08:00

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")
)