Skip to content

Sol-Estate | A decentralized Real World Asset (RWA) platform on Solana for fractional real estate investment using USDC. Built with Anchor (Rust) and Next.js 14.

License

Notifications You must be signed in to change notification settings

raushan728/sol-estate-platform

Repository files navigation

Sol-Estate Platform

Sol-Estate is a decentralized Real World Asset (RWA) platform built on Solana using the Anchor Framework and Next.js. It allows users to invest in fractionalized real estate properties using USDC. The platform features an Admin Portal for listing properties, a Marketplace for viewing assets, and a User Dashboard for tracking portfolio performance.


Table of Contents


Introduction

Sol-Estate bridges the gap between traditional real estate and blockchain technology. By tokenizing properties on the Solana blockchain, we enable fractional ownership, increased liquidity, and transparent transaction history. This project demonstrates a full-stack Web3 application leveraging the high performance of Solana and the safety of the Anchor framework.


Key Features

  • Admin Portal: Secure interface for property owners/admins to list new real estate assets, specifying price, supply, and metadata.
  • Marketplace: Public-facing gallery where users can browse listed properties and view details.
  • Fractional Investment: Users can purchase fractional shares of properties using USDC.
  • User Dashboard: Dedicated portfolio view for users to track their investments and asset performance.
  • Custom SPL Token Integration: Fully functional implementation of SPL Token transactions (Fake USDC) with a dedicated faucet script.

System Architecture

The platform architecture follows a standard dApp pattern on Solana:

  1. Smart Contract (Program): Written in Rust using the Anchor Framework.
  2. Frontend: A Next.js 14 application using TypeScript and Tailwind CSS.
  3. Blockchain Interaction: The frontend communicates with the Solana cluster via @solana/web3.js and @coral-xyz/anchor.

Account Structure & Relationships

We utilize Program Derived Addresses (PDAs) to securely manage state and relationships.

  • Property Account (Property): Stores details about a specific real estate listing (price, location, total tokens, etc.).
    • Seeds: [b"property", owner_pubkey, property_id]
  • Vault Account (Vault): An associated token account (PDA) owned by the program to hold the USDC collected from sales.
    • Seeds: [b"vault", property_key]
  • User Investment Account (UserInvestment): Tracks how many shares of a specific property a user owns.
    • Seeds: [b"user-investment", property_key, user_pubkey]

Note

Using PDAs ensures deterministic addresses that cannot be manipulated by users, enforcing strict access control and data integrity.


Prerequisites

Ensure you have the following installed:

  • Node.js: v20+ recommended (Download)
  • Rust & Cargo: Latest stable version (Download)
  • Solana CLI: v1.18+ (Guide)
  • Anchor Framework: Latest version (Guide)
  • Yarn: (corepack enable or npm i -g yarn)

Getting Started

Installation

  1. Clone the Repository

    git clone https://github.com/raushan728/sol-estate-platform.git
    cd sol-estate-platform
  2. Install Backend Dependencies

    yarn install
  3. Install Frontend Dependencies

    cd app && yarn install
  4. Run Development Server

    npm run dev
    # or
    yarn dev

    The application will be available at http://localhost:3000.


Configuration

Proper configuration is essential for the program to interact correctly with the frontend.

1. Get Your Program ID

Run the following command to generate a new keypair if needed:

anchor keys sync

2. Update the Smart Contract

If not auto-updated, paste the new ID into programs/sol-estate/src/lib.rs:

declare_id!("YOUR_NEW_PROGRAM_ID");

3. Update Anchor.toml

Ensure the [programs.devnet] section in Anchor.toml matches your new ID.

4. Re-build the Program

anchor build

5. Deploy the Program

anchor deploy

6. Update Frontend Constants

  1. Copy the updated target/idl/sol_estate.json to app/src/app/idl/.
  2. Update the PROGRAM_ID in app/src/app/utils/constants.ts with your new address.

Wallet & Token Setup

This project requires a wallet funded with SOL (for gas) and our custom Fake USDC (for transactions).

1. Create Wallet

solana-keygen new --outfile ~/.config/solana/id.json
solana config set --keypair ~/.config/solana/id.json

2. Airdrop SOL

Switch to Devnet and request SOL:

solana config set --url devnet
solana airdrop 2

3. Mint Fake USDC

We provided a script to mint Fake USDC tokens to your wallet.

  1. Edit Script: Open app/scripts/mint-usdc.js and replace USER_WALLET_ADDRESS with your Public Key.
  2. Run Script:
    cd app
    node scripts/mint-usdc.js

Important

The script will output a New USDC Mint Address. Copy this address! You will need it to configure the "USDC Mint Address" when listing properties in the Admin Portal.


Visual Walkthrough & Usage

Phase 1: Admin Listing - The Admin Panel allows property owners to create new listings. Admin Listing

Phase 2: Successful Listing - Confirmation screen after successfully listing a real world asset. Listed successfully

Phase 3: Marketplace View - Users browse available properties on the main marketplace feed. Marketplace View

Phase 4: Investment Terminal - Clicking on a property reveals detailed information and the investment interface. Investment Details

Phase 5: Transaction & Payment - Users confirm the transaction through their wallet provider. Transaction

Phase 6: Portfolio Dashboard - After investing, users can track their holdings. Dashboard


Testing

Run the integration tests included in the repository:

anchor test

This validates the core mechanics including property initialization and investment logic.


Troubleshooting

Warning

Common Error: "Account not found" Ensure you have properly initialized the property before trying to invest in it. The Vault PDA must exist.

  • Transaction Simulation Failed: Check if you have enough SOL for gas and enough Fake USDC.
  • Wallet Connection Error: Verify you are on Solana Devnet.

Contributing

Contributions are welcome!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Connect with Me

If you have any questions or want to collaborate, feel free to reach out!


License

Distributed under the MIT License. See LICENSE for more information.

About

Sol-Estate | A decentralized Real World Asset (RWA) platform on Solana for fractional real estate investment using USDC. Built with Anchor (Rust) and Next.js 14.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published