The current system requires the frontend to calculate the necessary collateral for a loan, which is not optimal. The backend should be responsible for determining if the user has deposited sufficient collateral and is eligible to borrow a certain amount. The frontend's role should be limited to attempting the loan transaction, with the backend providing a simple approval or rejection response.
Additionally, for the repayment process, the user should repay a specified amount of the loan's underlying asset. Subsequently, the backend should automatically release the proportionate amount of the user's frozen collateral based on the repayment value.
This ticket aims to discuss and implement the necessary changes to streamline the borrowing and repayment process, ensuring that responsibilities are correctly assigned to the frontend and backend systems.
The current system requires the frontend to calculate the necessary collateral for a loan, which is not optimal. The backend should be responsible for determining if the user has deposited sufficient collateral and is eligible to borrow a certain amount. The frontend's role should be limited to attempting the loan transaction, with the backend providing a simple approval or rejection response.
Additionally, for the repayment process, the user should repay a specified amount of the loan's underlying asset. Subsequently, the backend should automatically release the proportionate amount of the user's frozen collateral based on the repayment value.
This ticket aims to discuss and implement the necessary changes to streamline the borrowing and repayment process, ensuring that responsibilities are correctly assigned to the frontend and backend systems.
Related story #60