How opexdev/core works
OPEX Core is a Kotlin microservice cryptocurrency exchange and matching engine. A representative order path begins with a user request, is validated by the matching gateway against pair settings and accountant limits, and is submitted as an event; the tree also shows matching, accounting, market-query, wallet, identity, and pricing services. These are distinct product capabilities, not a verified end-to-end deployment sequence. The sampled order service establishes its immediate dependencies; connections among other services are marked unverified because their wiring was not shown.
Main entry points: OrderService.kt Order Validation · TransferService.kt Wallet Service · UserDataController.kt Market Queries · LoginService.kt Authentication
Components 22
Trading and Matching
- Order API
matching-gateway/matching-gateway-app/src/main/kotlin/co/nilin/opex/matching/gateway/app/controller/OrderController.kt - Order Validation
matching-gateway/matching-gateway-app/src/main/kotlin/co/nilin/opex/matching/gateway/app/service/OrderService.kt - Pair Settings
matching-gateway/matching-gateway-port/matching-gateway-persister-postgres/src/main/kotlin/co/nilin/opex/matching/gateway/ports/postgres/service/PairSettingService.kt - Pair Configuration
matching-gateway/matching-gateway-app/src/main/kotlin/co/nilin/opex/matching/gateway/app/service/OrderService.kt - Order Event Submitter
matching-gateway/matching-gateway-app/src/main/kotlin/co/nilin/opex/matching/gateway/app/service/OrderService.kt - Matching Engine
matching-engine/matching-engine-app/src/main/kotlin/co/nilin/opex/matching/engine/app/listener/MatchingEngineEventListener.kt
Accounting
- Accountant Limits
matching-gateway/matching-gateway-app/src/main/kotlin/co/nilin/opex/matching/gateway/app/service/OrderService.kt - Accounting Service
accountant/accountant-app/src/main/kotlin/co/nilin/opex/accountant/app/AccountantApp.kt - Trade and Financial Actions
accountant/accountant-core/src/main/kotlin/co/nilin/opex/accountant/core/service/TradeManagerImpl.kt - Accounting Records
accountant/accountant-ports/accountant-persister-postgres/src/main/kotlin/co/nilin/opex/accountant/ports/postgres/impl/FinancialActionPersisterImpl.kt
Market Data
- Market Queries
market/market-app/src/main/kotlin/co/nilin/opex/market/app/controller/UserDataController.kt - Market Query Handler
market/market-ports/market-persister-postgres/src/main/kotlin/co/nilin/opex/market/ports/postgres/impl/MarketQueryHandlerImpl.kt - User Trade History
market/market-ports/market-persister-postgres/src/main/kotlin/co/nilin/opex/market/ports/postgres/impl/UserQueryHandlerImpl.kt - Market Records
market/market-ports/market-persister-postgres/src/main/kotlin/co/nilin/opex/market/ports/postgres/dao/TradeRepository.kt
Wallet and Pricing
- Wallet Service
wallet/wallet-app/src/main/kotlin/co/nilin/opex/wallet/app/service/TransferService.kt - Withdrawals
wallet/wallet-core/src/main/kotlin/co/nilin/opex/wallet/core/service/WithdrawService.kt - Price Management
price-management/price-management-core/src/main/kotlin/co/nilin/opex/price/core/service/CrossRateService.kt
Identity and API
- Authentication
auth-gateway/auth-gateway-app/src/main/kotlin/co/nilin/opex/auth/service/LoginService.kt - Device Sessions
device-management/device-management-core/src/main/kotlin/co/nilin/opex/device/core/service/UserSessionDeviceService.kt - Storage API
api/api-ports/api-opex-rest/src/main/kotlin/co/nilin/opex/api/ports/opex/controller/StorageController.kt - One-Time Codes
otp/otp-app/src/main/kotlin/co/nilin/opex/otp/app/service/OTPService.kt
Other components
- Exchange User
Connections 18
- Exchange User → Order API: submits order
- Order API → Order Validation: handles request
- Order Validation → Pair Settings: loads settings
matching-gateway/matching-gateway-app/src/main/kotlin/co/nilin/opex/matching/gateway/app/service/OrderService.kt - Order Validation → Pair Configuration: loads pair config
matching-gateway/matching-gateway-app/src/main/kotlin/co/nilin/opex/matching/gateway/app/service/OrderService.kt - Order Validation → Accountant Limits: checks order limit
matching-gateway/matching-gateway-app/src/main/kotlin/co/nilin/opex/matching/gateway/app/service/OrderService.kt - Order Validation → Order Event Submitter: submits event
matching-gateway/matching-gateway-app/src/main/kotlin/co/nilin/opex/matching/gateway/app/service/OrderService.kt - Order Event Submitter → Matching Engine: routes order event
- Accounting Service → Trade and Financial Actions: runs accounting
- Trade and Financial Actions → Accounting Records: persists actions
- Market Queries → Market Query Handler: queries market
- Market Queries → User Trade History: queries history
- Market Query Handler → Market Records: reads trades
market/market-ports/market-persister-postgres/src/main/kotlin/co/nilin/opex/market/ports/postgres/impl/MarketQueryHandlerImpl.kt - User Trade History → Market Records: reads trades
market/market-ports/market-persister-postgres/src/main/kotlin/co/nilin/opex/market/ports/postgres/impl/UserQueryHandlerImpl.kt - Wallet Service → Withdrawals: supports withdrawals
- Wallet Service → Price Management: uses exchange rates
- Authentication → Device Sessions: uses session service
- Authentication → One-Time Codes: uses verification codes
- Storage API → Wallet Service: accesses wallet storage