Skip to content

Chore/optimize market accountant - #716

Merged
fatemeh-i merged 5 commits into
devfrom
chore/optimize-market-accountant
Aug 13, 2026
Merged

Chore/optimize market accountant#716
fatemeh-i merged 5 commits into
devfrom
chore/optimize-market-accountant

Conversation

@fatemeh-i

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR optimizes persistence behavior in the market Postgres persister by reducing duplicate-order write exceptions and loosening trade-duplicate detection around small timestamp differences.

Changes:

  • Treat trades with matching payloads as duplicate deliveries even if tradeDate differs slightly (within a tolerance).
  • Replace order creation try/catch-on-duplicate with a Postgres INSERT ... ON CONFLICT DO NOTHING flow.
  • Add a custom repository insert query to support “insert if absent” semantics.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
market/market-ports/market-persister-postgres/src/main/kotlin/co/nilin/opex/market/ports/postgres/impl/TradePersisterImpl.kt Adjusts duplicate-trade payload matching to allow small tradeDate deltas.
market/market-ports/market-persister-postgres/src/main/kotlin/co/nilin/opex/market/ports/postgres/impl/OrderPersisterImpl.kt Uses repository-level insert-if-absent instead of catching duplicate insert exceptions.
market/market-ports/market-persister-postgres/src/main/kotlin/co/nilin/opex/market/ports/postgres/dao/OrderRepository.kt Adds insertOrderIfAbsent query with ON CONFLICT (ouid) DO NOTHING.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@fatemeh-i
fatemeh-i merged commit cfc8456 into dev Aug 13, 2026
1 check passed
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.

3 participants