Modularity
Vision
At Flary, we believe in staying ahead of the curve, which is why our protocol is designed with a forward-thinking approach. Our emphasis on modularity ensures that our platform can easily adapt and evolve, allowing for the seamless integration of new features and the ability to connect with emerging networks nor enhancing protocol with new services. This modular framework not only improves the flexibility of our protocol but also ensures its longevity and relevance in the fast-paced world of blockchain technology. The right vector for further development is ensured by holders of $FLFI, who are empowered to decide which new modules to adopt. This way voting on which networks and services Flary Finance should adopt is going to be in hands of community. Learn more about governance: "$FLFI"
How it works?
Building a protocol with a modular approach involves designing it in a way that its various components can be independently developed, replaced, or upgraded without affecting the entire system.
Plug-and-Play Architecture
Serves as Flary's backbone infrastructure, allowing various services and networks to be added, removed, or replaced without disrupting the system. This is achieved through a dynamic loading mechanism, often implemented using dependency injection or service discovery patterns.
Example: Adding a New Service
Technical steps:
Module Registration:
When a new module (e.g., a new DeFi service) is developed, it is registered with the system’s central registry.
API Call:
registerModule(moduleIdentifier, moduleEndpoint)
Service Discovery:
Existing modules can discover the new module through the central registry.
API Call:
discoverModule(moduleIdentifier)
Dependency Injection:
The system dynamically injects the new module into the relevant workflows based on its dependencies.
Configuration:
injectDependency(lendingModule, interestRateModule)
Adjusted protocol usage example:
Modules:
Existing Modules:
Networking Module
Storage Module
Interest Rate Module
Smart Contract Module (existing, a.e. bridging)
API Module
Security Module
New Modules:
New Service Smart Contract (e.g., a DeFi lending platform)
Additional new module if required (e.g., Collateral Management Module)
New Network Integration Smart Contract (e.g., interoperability with another blockchain)
Interaction Example:
API Module: Receives a request to use the new DeFi lending service.
New Service Smart Contract: Processes the lending request, interacting with user balances and collateral management.
Networking Module: Facilitates communication with other nodes and, if necessary, with another blockchain via the new network integration smart contract.
Interest Rate Module: Calculates interest rates dynamically.
Storage Module: Records transactions and state changes related to the new service.
Security Module: Verifies the transaction’s security and integrity.
Other benefits:
1. Component Isolation
Each module should operate independently, communicating with other modules via well-defined interfaces or APIs. This separation of concerns allows developers to focus on individual components without worrying about the entire system.
2. Interoperability
Modules should be designed to work seamlessly with each other. This can be achieved through standardized communication protocols and data formats. Interoperability ensures that modules developed by different teams or even third parties can be integrated without issues.
3. Versioning and Compatibility
To manage updates and ensure backward compatibility, versioning of modules is crucial. Each module should declare its version and compatibility requirements, enabling the protocol to manage dependencies and resolve conflicts.
4. Security Considerations
Modularity also means that each component must be secure in isolation. Secure communication channels, authentication mechanisms, and regular security audits are essential to ensure the integrity of each module.
Last updated