Borrower Service
1. Introduction
1.1 Purpose The purpose of this document is to provide a comprehensive technical overview of the Borrower Service, detailing its responsibilities, interactions, and integration points.
1.2 Scope The scope of the Borrower Service spans from facilitating loan transactions to ensuring data consistency between the backend database and on chain. It includes interactions with the Wallet Service, the Risk Engine, and the smart contracts.
1.3 Document Overview This document outlines the system's architecture, the responsibilities of the Borrower Service and its components, data management strategies, security considerations, potential future enhancements, and concludes by summarising the service's role within the loan ecosystem.
2. System Overview
2.1 Architecture Diagram
[Insert architecture diagram illustrating the interaction between Borrower Service, Wallet Service, Risk Engine, Smart Contracts, and Data Base.]
2.2 Workflow Overview The typical workflow of the Borrower Service involves receiving loan requests, validating borrower information, storing Loan-to-Value (LTV) ratios and other data, interacting with the Wallet Service, executing smart contracts, and ensuring data consistency.
2.3 Key Stakeholders
Borrowers: Users seeking loans through the system.
Wallet Service: Provides wallet creation and transaction signing services.
Risk Engine: Calculates LTV ratios for risk assessment.
Backend Database: Stores loan and policy information for quick retrieval.
Smart Contracts: Implement the logic governing loan processes and data integrity.
3. Components
3.1 Borrower Service
3.1.1 Responsibilities The Borrower Service is responsible for:
Receiving loan requests through API endpoints.
Validating borrower information.
Initiating LTV calculation with the Risk Engine.
Creating wallets through the Wallet Service.
Executing smart contract functions for loan operations.
3.1.2 Interaction with Blockchain State The Borrower Service interacts with the blockchain by initiating transactions that update the state. It ensures the accuracy and consistency of data across the blockchain and the backend database.
3.1.3 Integration with Wallet Service The Borrower Service collaborates with the Wallet Service to create wallets associated with borrowers. These wallets are used to sign and send transactions to the blockchain.
3.2 Loan Information Schema and Risk Engine
3.2.1 Loan Information Schema The loan information schema includes borrower details, loan amount, collateral information, insurance coverage, and other relevant data. It provides a structured format for managing loan-related information.
3.2.2 Requesting LTV from Risk Engine The Borrower Service communicates with the Risk Engine to calculate the LTV ratio based on collateral and loan information. This ratio aids in assessing risk associated with the loan.
3.2.3 API Endpoint and Webhook The service exposes an API endpoint for receiving loan requests. It also integrates a webhook to handle updates related to risk engine.
3.3 Data Management and Source of Truth
3.3.1 Backend Data Storage Loan and policy information is stored in the backend database for efficient retrieval during checks and verification.
3.3.2 Data Synchronisation with Smart Contracts To ensure data consistency, the Borrower Service synchronises information between the backend database and smart contracts. The smart contracts remain the definitive source of truth.
3.4 Borrow Function Smart Contract Execution
3.4.1 Initiating Borrow Function The Borrower Service triggers the execution of the borrow function in the smart contract. It passes borrower data, loan details, collateral information, and the calculated LTV ratio.
3.4.2 Interaction with Loan and Policy Information The service interacts with both loan and policy information during the borrowing process. This includes collateral validation, insurance coverage confirmation, and loan term updates.
3.4.3 Ensuring Data Consistency Before and after executing smart contracts, the Borrower Service verifies data consistency between the blockchain and the backend database, rectifying discrepancies if necessary.
4. Security Considerations
4.1 Authentication and Authorization Strong authentication mechanisms are implemented to restrict access to authorised users only. Access controls ensure that users have the appropriate permissions.
4.2 Data Privacy Sensitive borrower and policy information are treated with strict privacy measures. Encryption and access controls prevent unauthorized access to confidential data.
5. Future Enhancements
5.1 Scalability The architecture is designed to handle increasing transaction volumes. Load testing and optimization strategies ensure seamless scalability.
6. Conclusion
The Borrower Service serves as a crucial component within the concrete system, facilitating secure loan transactions and ensuring data accuracy across the blockchain and backend systems. By integrating with the Wallet Service, orchestrating interactions with the Risk Engine, and executing smart contracts, the Borrower Service contributes to a seamless and trustworthy borrowing experience.
Last updated