Shipped on Vercel and Holesky!
- Description
- Architecture
- Flow
- Screenshots
- Install Dependencies
- Run The Project Locally
- Running Frontend
- Run Tests
- Project Design And Video Demo
This project is a Multi-Outcome Prediction Market entirely on-chain, powered by Cartesi and EigenLayer.
Calculating share prices for multiple outcomes using the LSMR formula is computationally intensive and costly on the blockchain. Cartesi's Coprocessor offloads these calculations:
Reduces Gas Costs: By handling complex computations off-chain. Boosts Scalability: Enhances speed and efficiency of market operations. Ensures Security: With on-chain verification of off-chain results.
This approach makes sophisticated prediction markets accessible, accurate, and versatile, leveraging Cartesi's technology for a better user experience.


(need to install make first)
make install-all
- install cartesi cli and docker
- start devnet and publish app
cartesi-coprocessor start-devnet && cartesi-coprocessor publish --network devnet
- get
machine hash
andDevnet_task_issuer
cartesi-coprocessor address-book
- deploy
MultiOutcomePredictionMarket
contract
cartesi-coprocessor deploy --contract-name MultiOutcomePredictionMarket --network devnet --constructor-args <devnet_task_issuer> <Machine Hash>
- create new market
cast send <deployed contract> "createMarket(string,uint256[],uint256,string[])" "Who will win the Formula 1 championship?" [10,10,10] 100 '["Lewis Hamilton", "Max Verstappen", "Charles Leclerc"]' --rpc-url http://127.0.0.1:8545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 # no it's not a real private key
- invoke coprocessor
cast send <deployed contract> "prepareCallAndRunExecution(uint256,uint256,uint256)" 1 1 6 --rpc-url http://127.0.0.1:8545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 # no it's not a real private key
- check result
cast call <deployed contract> "getMarket(uint256)" 1 --rpc-url http://127.0.0.1:8545
- access FE folder
cd ui-coprocessor-template
- create .env file with these variables
NEXT_PUBLIC_CONTRACT_ADDRESS = 0x1429859428c0abc9c2c47c8ee9fbaf82cfa0f20f;
NEXT_PUBLIC_MARKET_ID = 4;
- run FE
npm run dev
cd contracts && forge test
Built by @fabriziogianni7 and @SolidityDrone - use at your own risk.