Skip to content

Add Nord Pool market adapter module#8

Merged
tommed merged 1 commit into
mainfrom
feat/add-nordpool-module
Mar 13, 2026
Merged

Add Nord Pool market adapter module#8
tommed merged 1 commit into
mainfrom
feat/add-nordpool-module

Conversation

@tommed

@tommed tommed commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Implements nordpool.py — converts internal bid objects into Nord Pool Auction API request payloads (CurveOrderCreate, BlockListCreate)
  • Supports all four bid types: SimpleBid → curve orders; BlockBid, LinkedBlockBid, ExclusiveGroupBid → block list orders
  • ContractIdResolver type alias lets callers supply their own MTU → contract ID mapping (requires Nord Pool products API at runtime)
  • Bidding zone → area code mapping covering Nordic (NO1–NO5, SE1–SE4, FI, DK1, DK2) and Baltic (EE, LV, LT) zones; unsupported zones raise ValueError
  • order_book_to_nord_pool() converts a whole OrderBook into a NordPoolSubmission in one call
  • 53 tests in tests/test_nordpool.py, 100% coverage on nordpool.py, overall suite at 98.42%
  • README updated with three worked examples (curve order, block/linked orders, full order book conversion)

Test plan

  • make test — 308 tests pass, coverage 98.42% (target ≥ 97.89%)
  • poetry run mypy src — no type errors
  • poetry run ruff check src tests — no lint errors
  • poetry run ruff format src tests — no formatting issues

🤖 Generated with Claude Code

Implements nordpool.py to convert internal bid objects (SimpleBid,
BlockBid, LinkedBlockBid, ExclusiveGroupBid, OrderBook) into Nord Pool
Auction API request payloads (CurveOrderCreate, BlockListCreate).

Includes ContractIdResolver type alias, BiddingZone → area code mapping
for Nordic/Baltic zones, signed volume convention (SELL positive, BUY
negative), and NordPoolSubmission container. Unsupported zones (CWE,
Iberian, Italian, GB) raise ValueError.

- 53 tests in test_nordpool.py, 100% coverage on nordpool.py
- README updated with three Nord Pool submission examples
- CLAUDE.md code layout updated to include nordpool.py and epex_spot.py

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov

codecov Bot commented Mar 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tommed tommed merged commit f1c8bff into main Mar 13, 2026
3 checks passed
@tommed tommed deleted the feat/add-nordpool-module branch March 13, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant