stochastix/core
Stochastix Core provides the foundational Laravel package layer for Stochastix: shared service providers, configuration, and reusable utilities with clean APIs and sensible defaults. Install via Composer to build modular, maintainable Laravel apps.
Architecture fit. stochastix/core is a Symfony-based backtesting framework rather than a Laravel package. It targets a fundamentally different runtime profile than a typical Laravel request/response application: backtests are long-running, CPU-bound batch jobs over historical time-series data. It therefore does not "fit" the Laravel application layer — it fits behind it, as a domain engine consumed by queue workers, Artisan commands, or a dedicated CLI service. Treating it as an in-request dependency is the primary architectural anti-pattern to avoid.
Integration feasibility. Technically viable but non-trivial. Laravel composes Symfony components (Console, HttpFoundation, Process, etc.), so shared-library conflicts are the concrete risk rather than conceptual incompatibility. The real integration surface is: (1) how market data is fed in (files, DB, API), (2) how results are persisted (Doctrine vs. Eloquent assumptions), (3) how the backtest is invoked (Symfony Console vs. Laravel Artisan). Each of these is likely to require an adapter layer. Expect to write glue code, not to composer require and go.
Technical risk. High, concentrated in three areas:
Key questions.
Stack fit. Poor on the surface, workable with deliberate isolation. The correct pattern is anti-corruption layer: define our own BacktestEngine interface in the Laravel domain, implement it with a StochastixAdapter, and never let stochastix/core types leak into controllers, models, or domain services. That single decision converts an uncomfortable dependency into a swappable one and is the difference between a two-week spike and a two-quarter lock-in.
Migration path. Do not migrate anything into the main application. Instead:
Compatibility. Pin an exact version. Audit composer why-not against our Laravel/Symfony constraints before committing; if versions collide, the fallback is running the engine in a separate containerized CLI with its own dependency tree, communicating via a job payload and a results table. That fallback is cheap to build and removes the dependency-conflict risk entirely — recommend designing for it from day one.
Sequencing. (1) Dependency and license audit → (2) isolated correctness spike → (3) go/no-go gate on reconciliation → (4) ACL adapter + queue integration → (5) internal documentation and a fork-and-patch contingency. Budget the spike as discovery, not delivery; the most likely outcome of step 2 is "promising but needs our own patches," which is a decision point, not a failure.
Maintenance. This is the dominant cost. With one maintainer and no downstream dependents, we should assume we will eventually own the code. Plan for a vendored fork from the outset: mirror the repo, apply patches locally, and keep a diff log. Do not build a workflow that requires upstream fixes to unblock us. Assign explicit internal ownership — an unowned backtest engine that silently drifts from reality is worse than none.
Support. No commercial support, no SLA, no community to lean on for triage. Internal engineers must be able to read the source. Given a Symfony/PHP team this is realistic; given a team that is Laravel-only and framework-fluent rather than framework-internals-fluent, budget ramp-up time accordingly.
Scaling. Backtests scale with CPU and data volume, not with request concurrency. Isolate onto a dedicated queue with its own worker pool and resource limits so a large backtest cannot starve user-facing jobs. Watch memory: in-memory time-series over multi-year, multi-instrument datasets is the classic failure point. Persist intermediate results and design for resumable/segmented runs rather than assuming single-shot execution completes.
Failure modes.
composer update. Mitigate by pinning and by isolating the dependency tree.Ramp-up. Expect 1–2 weeks for a competent PHP engineer to reach productive spike velocity, plus additional time for whoever owns long-term correctness to build real fluency in the engine's execution model. The learning curve is less about Laravel/Symfony and more about backtesting semantics — that is the expensive knowledge, and it does not come from the package's documentation. Recommend pairing the integration with someone who has quantitative finance background, or the correctness gate in the Integration Approach cannot be meaningfully evaluated.
Recommendation. Proceed to a time-boxed, isolated correctness spike only. Do not commit to production integration until the engine reconciles against an independent reference implementation. The licensing is permissive and the concept is sound, but the adoption signals (14 stars, 0 dependents, single maintainer) mean the burden of proof sits entirely with us, and the cost of being wrong — a silently inaccurate backtest driving a capital decision — is asymmetric.
How can I help you explore Laravel packages today?