Skip to content

test: multiple markets — funding rates are independent and do not bleed across markets #266

Description

@abayomicornelius

Goal

Verify that funding rate state for ETH/USD market does not affect or contaminate the BTC/USD market funding state.

Scenario

  1. Create ETH/USD market (long-heavy: 80% long OI)
  2. Create BTC/USD market (balanced: 50/50 OI)
  3. Advance 100 ledgers
  4. Update funding state for both markets
  5. Open a long position in ETH/USD — assert large funding debit
  6. Open a long position in BTC/USD — assert near-zero funding (balanced market)

Assertions

  • ETH/USD funding_amount_per_size accumulates significantly
  • BTC/USD funding_amount_per_size remains near 0
  • No cross-market state leakage in data_store

Acceptance Criteria

  • Test uses two separate market addresses throughout
  • Data store keys are market-scoped (verified by checking raw storage)
  • File: tests/multi_market_funding_isolation.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    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