License & Fair Code Distribution
Relevant source files
The following files were used as context for generating this wiki page:
The vectorbt project is distributed under a "Fair Code" model, which combines the permissive Apache License 2.0 with the restrictive "Commons Clause" License Condition v1.0. This licensing structure is designed to keep the source code publicly available and free for the vast majority of users—including individuals and organizations—while preventing third parties from commercializing the software as a standalone product or service.
The software is authored and licensed by Oleg Polakow. The "Fair Code" distribution applies to the core Python library as well as the optional Rust acceleration engine. While the community edition remains open-source under these terms, it serves as the foundation for a more advanced hybrid backtesting library known as VectorBT PRO.
Sources: LICENSE.md:1-12, README.md:275-285, pyproject.toml:9-12
Licensing Architecture
The project utilizes a tiered licensing approach where the Commons Clause acts as a specific amendment to the broader Apache 2.0 terms.
The Commons Clause Restriction
The core of the "Fair Code" distribution is the prohibition against selling the software. Under this clause, "Sell" is defined as practicing any rights granted by the license to provide the software to third parties for a fee or consideration. This includes hosting, consulting, or support services where the value is substantially derived from vectorbt's functionality.
The diagram above illustrates how the project combines permissive open-source grants with a commercial restriction layer.
Sources: LICENSE.md:1-12, README.md:278-283
Apache License 2.0 Integration
Subject to the Commons Clause, the software grants users a perpetual, worldwide, non-exclusive, no-charge, and irrevocable copyright license. Users are permitted to reproduce, prepare derivative works, and distribute the work in source or object form, provided they meet specific attribution requirements.
| Feature | Apache 2.0 Provision |
|---|---|
| Redistribution | Permitted with a copy of the license and notices of changes. |
| Trademarks | No permission granted to use licensor trade names or marks. |
| Warranty | Provided on an "AS IS" BASIS without warranties. |
| Liability | Licensor is not liable for damages (tort, contract, etc.). |
Sources: LICENSE.md:16-160
Distribution of Project Components
The licensing model is applied consistently across the various sub-packages and extensions within the repository.
Core Python Library
The primary vectorbt package is identified in its configuration as being governed by the files specified in the license-files property. Every major source file in the generic modules includes a copyright header explicitly referencing the Apache 2.0 and Commons Clause terms.
Sources: pyproject.toml:13, vectorbt/generic/stats_builder.py:1-2
Rust Acceleration Engine
The optional Rust engine, distributed as vectorbt-rust, adheres to the same licensing requirements. Its metadata explicitly lists the license as "Apache-2.0 WITH Commons-Clause-1.0", ensuring that performance-critical kernels remain under the same usage restrictions as the Python core.
Sources: rust/README.md:12, rust/pyproject.toml:12
Usage and Compliance
The project maintainers emphasize that everyone is encouraged to use the software for free, provided it is not the primary value proposition of a paid service.
Permitted vs. Restricted Use
The following table summarizes common scenarios based on the definitions in the license files:
| Scenario | Status | Condition |
|---|---|---|
| Internal Research | Permitted | Free use for individuals and companies. |
| Academic/Educational | Permitted | Source available for learning. |
| SaaS Backtesting Tool | Restricted | "Sell" restriction applies if vbt provides the value. |
| Paid Support Services | Restricted | Prohibited if value derives from vectorbt functionality. |
Sources: LICENSE.md:5-10, README.md:278-283
Contact and Exceptions
For entities requiring usage that falls outside these terms—such as commercial integration into a paid product—the author provides a channel for requesting license exceptions or discussing commercial agreements.
Sources: README.md:284-285
Conclusion
The "License & Fair Code Distribution" of vectorbt ensures a sustainable balance between open-source community growth and the protection of the author's intellectual property against unauthorized commercial exploitation. By grounding the project in the Apache 2.0 license, it maintains standard open-source protections while the Commons Clause preserves the project's viability as a foundation for the VectorBT PRO ecosystem.
Sources: README.md:65-70, LICENSE.md:164-168