Kubera is a decentralized finance (DeFi) platform built on the Solana blockchain. It facilitates peer-to-peer lending and borrowing with an option for guarantors to support loans. The project consists of a Rust-based Anchor backend for on-chain operations and a Next.js frontend for user interactions.
- Features
- Tech Stack
- Project Structure
- Getting Started
- Running the Project
- Testing
- Contributing
- License
- Create and manage loan offers
- Browse and accept available loans
- Provide guarantees for loans
- Deposit and withdraw collateral
- Repay loans
- Solana blockchain
- Anchor framework
- Rust programming language
- Next.js
- React
- TypeScript
- Tailwind CSS
- shadcn/ui components
- Anchor CLI
- Solana CLI
- Node.js and npm
The project is organized into two main parts:
-
Anchor Backend: Contains the Rust code for the Solana program.
lib.rs: Main program fileerrors.rs: Custom error definitionsmodels.rs: Data structures and enumsstates.rs: Account structures- Various instruction files (e.g.,
create_loan_offer.rs,accept_loan.rs, etc.)
-
Next.js Frontend: Contains the web application code.
pages/: Next.js pagescomponents/: React components, including the main Dashboardutils/: Utility functions and configurationsstyles/: CSS and Tailwind configurations
- Rust and Cargo
- Solana CLI
- Anchor CLI
- Node.js and npm
- Git
-
Clone the repository:
git clone https://github.com/your-username/kubera-defi.git cd kubera-defi -
Install Anchor dependencies:
anchor build -
Install frontend dependencies:
cd app npm install
-
Start a local Solana validator:
solana-test-validator -
Deploy the Anchor program:
anchor deploy -
Start the Next.js development server:
cd app npm run dev -
Open your browser and navigate to
http://localhost:3000
To run the Anchor tests:
anchor test
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.