Short-term collateralized lending market built on Prividium - a privacy-preserving blockchain infrastructure.
Lenders create offers specifying loan terms (amount, collateral, duration, fee). Borrowers accept offers by depositing collateral and receiving funds. Loans must be repaid before deadline (plus 2-minute grace period) or lenders can claim collateral.
- Docker
- Prividium Docker Images access (provided by the MatterLabs team):
DOCKER_USERNAME=matterlabs_enterprise+your_username
DOCKER_PASSWORD=super_secret_provided_by_matterlabs
docker login -u=$DOCKER_USERNAME -p=$DOCKER_PASSWORD quay.io# Clone repo with submodules
git clone --recurse-submodules https://github.com/JackHamer09/prividium-institutional-demodocker compose -f ./prividium-utils/docker-compose-prividium.yaml up -d- Wait for all services to start — init containers (deposit, deploy, mint, bridge) will run automatically in order
- Continue by checking section Demo below
- Note: Chain data is not persisted between restarts. To run again you will firstly need to reset the environment:
docker compose -f ./prividium-utils/docker-compose-prividium.yaml down -v- You will need 2 separate browsers or Chrome browser profiles, to simulate 2 users.
- MetaMask wallet browser extension installed in both browsers/profiles.
- Setup MetaMask with demo accounts:
- Browser/Profile 1 (user1):
- Open MetaMask -> Account dropdown ->
Add Wallet->Import an account - Use private key:
0x6a657d9f98808f0d551411319b851b35e9ef6fca68f38ccc9b92871ec61e1efb
- Open MetaMask -> Account dropdown ->
- Browser/Profile 2 (user2):
- Open MetaMask -> Account dropdown ->
Add Wallet->Import an account - Use private key:
0x93dd39ca8b2666c9bf1cee643f18df4fef6ca96668302978675af1d717459706
- Open MetaMask -> Account dropdown ->
- Browser/Profile 1 (user1):
- Login to Prividium User Panel:
- Browser/Profile 1:
- Open Prividium User Panel - Chain 1
- Click on
Sign in with Keycloackbutton - Use credentials:
user1@local.dev/password
- Browser/Profile 2:
- Open Prividium User Panel - Chain 2
- Click on
Sign in with Keycloackbutton - Use credentials:
user2@local.dev/password - Repeat same on Prividium User Panel - Chain 1
- Browser/Profile 1:
- Add Prividium chains to MetaMask:
- Go to User Panel - Chain 1 wallets page
- In the
Network Configurationsection, clickAdd to Network to Wallet-> Confirm in MetaMask - Repeat for User Panel - Chain 2 wallets page
- Login to Intraday Repo App:
- Open Intraday Repo App in both browsers
- Login with Prividium (user1 in Browser 1, user2 in Browser 2)
- Connect the corresponding MetaMask account
- Start using the app!
- Create lending offers, accept them, repay loans, and claim collateral if needed.
- Intraday Repo App - localhost:3004
- Chain 1
- Prividium User Panel - localhost:3001
- Prividium Admin Panel - localhost:3000
- Block Explorer - localhost:3010
- Chain 2
- Prividium User Panel - localhost:3301
- Prividium Admin Panel - localhost:3300
- Block Explorer - localhost:3310
- Login to Admin Panel with credentials:
admin@local.dev/password- Note: Use a separate browser/profile or logout from demo user first via Prividium User Panel.
- Prividium Admin Panel - Chain 1
- Prividium Admin Panel - Chain 2
- Go to
Contractspage to view and manage permissions that are setup for each chain.
Mint test tokens to any address (only works with TestnetERC20Token contracts deployed on local chain):
./scripts/mint.sh <TO_ADDRESS> <TOKEN_ADDRESS> <AMOUNT> <PRIVATE_KEY> <RPC_URL>Decimal reference:
- USDC: 6 decimals (1 USDC = 1000000)
- TUST: 18 decimals (1 TUST = 1000000000000000000)
- SGD: 18 decimals (1 SGD = 1000000000000000000)
Example (mint 1000 USDC on chain 1):
./scripts/mint.sh 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 1000000000 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 http://localhost:3050Deposit ETH from L1 to L2 via the bridge contract. The script automatically fetches the Bridgehub contract address from L2:
./scripts/deposit.sh <CHAIN_ID> <TO_ADDRESS> <AMOUNT_IN_WEI> <PRIVATE_KEY> <L1_RPC> <L2_RPC>Example (deposit 1000 ETH to chain 1):
./scripts/deposit.sh 6565 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 1000000000000000000000 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 http://127.0.0.1:8545 http://127.0.0.1:3050Bridge a token from one chain to another. This approves the Native Token Vault and sends a bridge bundle. The caller must have sufficient token balance on the source chain. Requires the SDK to be built first (cd sdk && npm install && npm run build).
cd scripts && npm install
npm run bridge-token -- <TOKEN_ADDRESS> <AMOUNT> <RECIPIENT> <PRIVATE_KEY> <SOURCE_RPC> <DEST_RPC>Arguments:
TOKEN_ADDRESS: Address of the token to bridge on the source chainAMOUNT: Amount to bridge (in smallest unit, e.g., wei)RECIPIENT: Address to receive tokens on destination chainPRIVATE_KEY: Private key for signing transactionsSOURCE_RPC: RPC URL of the source chain (where token is deployed)DEST_RPC: RPC URL of the destination chain
Example (bridge 1000 USDC from chain 1 to chain 2):
npm run bridge-token -- 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 1000000000 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 http://localhost:3050 http://localhost:3051Note: The interop-relay must be running to execute the bridge bundle on the destination chain.
If you experience any of the following issues:
- Unable to add the MetaMask network
- Unable to send transactions in the app
- Seeing "Connection issue" warning in the chain selector
Watch the troubleshooting video for solutions to the most common problems.
Contract tests only. See contracts/README.md.
MIT