Inspiration

Sarafu is inspired by the emergence of decentralized finance, DeFi. The new paradigm of offering financial services on the blockchain is the core concept behind Sarafu. Sarafu is a hybrid solution encompassing the expertise of traditional finance and virtues of decentralized finance.

What it does

Sarafu allows users to borrow local fiat against their crypto assets. Sarafu aims to address the following problems:

  1. Complexies in USD-based crypto loans
    - Fluctuations in exchange rates
    - Overdependence on the P2P markets liquidity
    - P2P add additional risks and steps to the loan process

  2. Misuse/ Loss of user collateral

How I built it

Sarafu is made up a couple of moving parts:

  1. The UI/ Frontend
  2. Web3 Providers
  3. Backend API
  4. Smart Contracts
  5. Chainlink Services

The frontend: Built with Quasar Framework
Allows interaction with the smart contract and backend.
Through the frontend, users can request and manage their loans; however, due to the decentralized nature of Sarafu, the frontend is completely optional

Providers: Alchemy and MetaMask
Allow access to the blockchain

Backend API: Built with FastAPI and Deta Space
Performs Admin functions such as account verification
Allows Loan processing and Loan Management
It interfaces with payment service provider for fiat payments processing

Sarafu Loan Smart Contract: Built with Solidity
Manages Loan data
Holds collateral
Loan management such as liquidation, top up, withdraw excess collateral, repayments

Sarafu Verification Smart Contract: Built with Solidity
Sarafu is a permissioned service and therefore users must be verified.
The contract manages the verification of accounts.

Chainlink Services:

  1. Functions:
    Allows the smart contract to interact with the backend API
    It alerts the backend API to process a loan request

  2. Automation:
    Checks if there is a loan to be liquidated. This protects the platform from bad debt
    Loans are liquidated via Uniswap v3

  3. Data Feeds:
    Provides the Sarafu loan smart contract with collateral prices.

    Challenges I ran into

    The main challenge is the integration of Chainlink functions. The resource is still in beta with limited resources and access. Integrations with external services such as payment service providers and Uniswap v3.

    Accomplishments that I'm proud of

    Architecting the project with a lot of moving parts and ensuring they all function in synchrony.

    What we learned

    Working with Chainlink services, especially the potential of Chainlink functions. Architecting hybrid permissioned decentralized applications.

    What's next for Sarafu

    We keep on buidling. Sarafu has a lot of potential especially in emerging markets where access to the USD is limited.

Built With

Share this project:

Updates