Skip to content

Build Stellar DEX Order Book Snapshot Tests for Price Feed Validation #627

@temma02

Description

@temma02

Description

Implement order book snapshot tests that validate the DEX price feed logic correctly interprets Stellar order book data and computes accurate prices across various market conditions.

Requirements and Context

  • Correctness: Price computation must be accurate for all order book states
  • Testing: Test price computation against order book snapshots
  • Documentation: Document the price computation logic

Suggested Execution

Branch: feat/issue-091-stellar-dex-orderbook-tests

Implement Changes

  • Create order book snapshot fixtures for various market conditions (thin, deep, empty)
  • Add tests validating price computation against each snapshot
  • Test edge cases: empty order book, single-sided book, crossed book
  • Assert price accuracy within an acceptable tolerance

Test and Commit

  • Cover thin, deep, empty, and crossed order book scenarios
  • Assert accurate price computation for each
  • Document the price computation logic

Example Commit Message

feat(stellar): add DEX order book snapshot tests for price feed validation

- Create order book fixtures for various market conditions
- Validate price computation against each snapshot
- Test empty, single-sided, and crossed book edge cases

Guidelines

  • Use realistic order book fixtures matching Horizon's format
  • Test edge cases explicitly
  • Assert prices within a defined tolerance

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions