Skip to content

UgwujaGeorge/obscura

Repository files navigation

Obscura

Obscura is a sealed-rate lending market on Solana powered by Arcium MPC.

Borrowers post wSOL collateral and request USDC. Lenders compete by submitting encrypted APR offers. The auction is a reverse sealed-bid auction: the lowest valid rate wins, while every losing lender's rate stays sealed forever.

Live Demo

Why Obscura

Most on-chain lending markets expose pricing intent in public. Obscura keeps lender rates private during bidding and after settlement, revealing only the winning rate needed to activate the loan.

This makes Obscura useful for sealed credit markets, private OTC lending, and competitive lender discovery where the final market-clearing rate matters but losing bids should not become public data.

How It Works

  1. A borrower creates a loan request with wSOL collateral, USDC principal, a fixed term, and a bidding deadline.
  2. Lenders submit encrypted rate offers and lock the requested USDC principal.
  3. After bidding closes, the app queues Arcium MPC to evaluate the encrypted offers.
  4. The MPC circuit selects the lowest valid APR and returns only the winning lender index and winning rate.
  5. The borrower activates the loan, receives USDC, and the winning lender becomes the creditor.
  6. The borrower repays principal plus interest before maturity, or the winning lender claims collateral after default.

Core Features

  • Reverse sealed-bid lending auctions where the lowest APR wins
  • Arcium MPC circuit for private rate comparison
  • Anchor program for loan creation, bidding, activation, repayment, refund, and default settlement
  • Next.js frontend with Phantom/Solflare wallet support
  • Mock USDC faucet for reliable devnet testing
  • Frontend privacy hardening: losing lender addresses are never rendered

Project Structure

.
├── Anchor.toml                 # Anchor workspace config
├── Arcium.toml                 # Arcium/MXE config
├── programs/obscura/           # Anchor smart contract
│   ├── Cargo.toml
│   └── src/lib.rs
├── encrypted-ixs/              # Arcium encrypted instruction circuit
│   ├── Cargo.toml
│   └── src/lib.rs
├── app/                        # Next.js frontend
│   ├── app/page.tsx            # Home / loan discovery page
│   ├── app/create/page.tsx     # Create loan request flow
│   ├── app/loan/[address]/     # Loan detail and lender actions
│   ├── app/api/faucet/route.ts # Mock USDC faucet endpoint
│   ├── app/components/         # UI and wallet components
│   ├── app/lib/                # Program, PDA, Arcium, and formatting helpers
│   └── idl/                    # Generated Obscura IDL
├── scripts/                    # Devnet helper scripts
├── tests/obscura.ts            # Anchor integration tests
├── migrations/deploy.ts        # Anchor deploy hook
└── docs/screenshots/           # Frontend screenshots

Privacy Properties

  • What stays sealed: every losing lender's rate offer, the distribution of offered rates, the relative ordering of losers — forever, even after the loan is fully repaid or defaults
  • What's revealed: the winning lender's rate (necessarily — it's the actual loan rate), the winning lender's address (necessarily — they're now the on-chain creditor)
  • What's inherently public: loan principal, collateral, term, and the borrower's address (because they're the on-chain creator)
  • Frontend hardening: no losing lender's address is ever rendered to the DOM. Lender slots show #0, #1, ... only

Running Locally

git clone https://github.com/UgwujaGeorge/obscura.git
cd obscura
yarn install
cd app && yarn install && yarn dev

Open http://localhost:3000 and connect a Phantom wallet on Solana Devnet.

For local frontend configuration, copy app/.env.local.example to app/.env.local and set the required devnet RPC, program, mint, and faucet values.

Deployed Program

The Obscura program is deployed and verified on Solana Devnet:

Note on USDC

On devnet, Obscura uses a mock USDC mint with an in-app faucet button for reliable testing — Circle's official devnet USDC faucet is rate-limited to 20 USDC per 2 hours, which isn't practical for testing a 200 USDC loan. On mainnet, this would be Circle's official USDC at EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v — a one-line config change.

Team

Built for the Arcium RTG by Ugwuja George (@UgwujaGeorge)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors