Skip to content

Repository files navigation

GitBranch

GitHub native RWA stock vault. Own real stocks onchain with no wallet app, no brokerage account, and no gas fees.

Chain Solidity License Bot

Dashboard · Install Bot · Docs · Explorer

Tag @gitbranchbot in any GitHub issue to buy, sell, swap, or withdraw real tokenized stocks. All onchain, all from your keyboard.

Table of Contents

  1. What is GitBranch?
  2. How It Works
  3. Core Features
  4. Smart Contract Architecture
  5. Supported Assets
  6. Bot Command Reference
  7. Technical Stack
  8. Monorepo Structure
  9. Getting Started
  10. Environment Variables

What is GitBranch?

GitBranch is a GitHub native banking platform that lets developers buy and hold real tokenized stocks (RWA) directly from GitHub issues. No wallet setup, no brokerage account, no gas fees for users.

When you tag @gitbranchbot, the bot:

  1. Creates a soul bound vault onchain (your personal vault, tied to your GitHub identity)
  2. Accepts USDG deposits on your behalf
  3. Swaps USDG for the stock token you want via Uniswap V3 on Robinhood Network
  4. Holds the token in your vault until you withdraw

How It Works

GitHub Issue  ->  @gitbranchbot  ->  API Server  ->  GitBranchVault (onchain)
                                          |
                                 Uniswap V3 Router
                                          |
                              RWA Token: gitNVDA, gitTSLA, gitAAPL ...

Step by step:

  1. User comments @gitbranchbot buy $NVDA 50 in any GitHub issue
  2. Bot webhook fires and the API server parses the command
  3. API server deposits USDG into the user vault onchain
  4. Vault calls Uniswap V3 to swap USDG for the gitNVDA token
  5. Token sits in the vault; user can sell or withdraw any time

Core Features

Soul bound vaults. Each GitHub user gets exactly one vault contract tied to their GitHub ID. The vault is not transferable and holds their stock tokens onchain.

Gasless for users. The relayer covers all gas fees. Users only interact via GitHub comments.

Real RWA tokens. Stock tokens (gitNVDA, gitTSLA, gitAAPL, etc.) are backed by real tokenized assets on Robinhood Network.

MCP support. Use GitBranch from Claude, Cursor, or ChatGPT via the MCP server. See gitbranch-mcp.

No wallet required. Vaults are managed server side. Users can optionally link a wallet to withdraw tokens.


Smart Contract Architecture

Contract Description
GitBranchVaultFactory Deploys one soul bound vault per GitHub user
GitBranchVault Holds RWA tokens and executes swaps via Uniswap V3
GitBranchStockFactory Deploys ERC20 receipt tokens for each RWA asset
GitBranchStockToken ERC20 receipt token: gitNVDA, gitTSLA, gitAAPL and more
GitBranchToken Native GITB governance token

Key onchain addresses (Robinhood Network, chain 4663):

Contract Address
VaultFactory 0x2d63D4092Ab7a7DC8761394b22Bb2f6Ac1F226Ba
SwapRouter (Uniswap V3) 0xCaf681a66D020601342297493863E78C959E5cb2
QuoterV2 0x33e885ed0ec9bf04ecfb19341582aadcb4c8a9e7
WETH 0x4200000000000000000000000000000000000006
USDG 0x79A02482A880bCE3F13e09Da970dC34db4CD24d1

Supported Assets

Ticker Token Pool
NVDA gitNVDA USDG/gitNVDA 1%
TSLA gitTSLA USDG/gitTSLA 1%
AAPL gitAAPL USDG/gitAAPL 1%
MSFT gitMSFT USDG/gitMSFT 1%
AMZN gitAMZN USDG/gitAMZN 1%
GOOGL gitGOOGL USDG/gitGOOGL 1%
META gitMETA USDG/gitMETA 1%
SPY gitSPY USDG/gitSPY 0.3%
QQQ gitQQQ USDG/gitQQQ 0.3%

See packages/rwa/src/tokens.ts for the full list of 27 supported assets.


Bot Command Reference

Tag @gitbranchbot followed by any of these commands in a GitHub issue or PR comment:

Command Example Description
buy $TICKER AMOUNT buy $NVDA 100 Buy stock worth $100 USDG
sell $TICKER AMOUNT sell $TSLA 50 Sell $50 worth of TSLA
sell all $TICKER sell all $AAPL Sell your full AAPL position
portfolio portfolio Show all holdings and values
balance balance Show USDG balance
deposit deposit Get deposit instructions
withdraw $TICKER withdraw $NVDA Withdraw tokens to your wallet
swap $FROM $TO swap $NVDA $TSLA Swap one stock for another

Technical Stack

Layer Technology
Smart contracts Solidity 0.8.34 and Hardhat on Robinhood Network
Swap routing Uniswap V3 SwapRouter02 and QuoterV2
Backend API Node.js and Express and TypeScript
Web frontend React 18 and Vite and Tailwind CSS
Mobile Expo SDK and React Native
Database PostgreSQL with Drizzle ORM
AI interface MCP server compatible with Claude and Cursor
Auth GitHub Apps and OAuth
Payments x402 protocol and USDG stablecoin

Monorepo Structure

gitbranch/
  apps/
    web/           # React frontend (landing page and dashboard)
    api/           # Express API server and GitHub bot webhook handler
    social-cards/  # OG image and social card generator
  packages/
    db/            # Drizzle ORM schema and migrations
    rwa/           # RWA token registry and price feeds
    rh-swap/       # Uniswap V3 quote and swap helpers for Robinhood Network
    mcp/           # MCP server tools and handlers
    api-spec/      # OpenAPI spec shared between server and client
    api-zod/       # Zod validators generated from OpenAPI spec
    api-client-react/  # React Query hooks generated from the API spec
    x402/          # x402 payment protocol integration
  scripts/         # Dev and deploy scripts
  base-plugin/     # Vite base plugin shared across apps

Getting Started

Prerequisites

  • Node.js 20 or higher
  • pnpm 9 or higher
  • PostgreSQL database

Install

git clone https://github.com/gitbranchorg/gitbranch.git
cd gitbranch
pnpm install

Configure

cp .env.example .env
# Fill in your GitHub App credentials and database URL

Run

# API server
pnpm --filter @workspace/api-server dev

# Web frontend (in a separate terminal)
pnpm --filter @workspace/gitbank dev

Environment Variables

Variable Required Description
GITHUB_APP_ID Yes GitHub App numeric ID
GITHUB_APP_PEM Yes GitHub App private key (RSA)
GITHUB_CLIENT_ID Yes GitHub OAuth client ID
GITHUB_CLIENT_SECRET Yes GitHub OAuth client secret
GITHUB_WEBHOOK_SECRET Yes Webhook HMAC secret
SESSION_SECRET Yes Express session secret
ENCRYPTION_MASTER_KEY Yes 32 byte key for encrypting vault private keys
DEPLOYER_PRIVATE_KEY Yes EVM private key for contract deployment
RELAYER_SIGNING_KEY Yes EVM private key for gasless relay
DATABASE_URL Yes PostgreSQL connection string

License

Apache 2.0

About

GitHub native RWA stock banking: web app, API server, packages

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages