Fonzo.fun is a trading protocol for decentralized and permissionless peer to pool prediction trading built on the Flare blockchain, leveraging Flare Time Series Oracle version 2.
The protocol is designed to be fully decentralized without the need for an offchain operator for matching and settlement. All trading happens completely onchain.
Fonzo.fun uses a singleton-style architecture, where all market state is managed in the FonzoMarket.sol contract. The following entry point functions are available for anyone or smart contracts or wallets to call;
bearish- to open a bear position in a marketbullish- to open a bull position in a marketsettle- to collect rewards due in a marketinitializeMarket- to initialize a new marketresolve- to settle a market using FTSOV2 Oracle
Detailed call signatures can be found on the contract interface with documentations.
Flare Times Series Oracle acts as a vital infrastructure component that provides us with decentralized, block-latency data feeds to accurately settle market predictions completely on-chain.
This near real time price feeds provided by the FTSO are essential for the core functioning of Fonzo prediction market, a platform that allow users to bet on the outcome of future events.
To see how we use FTSO in our smart contract please see the implementation of resolve function in the FonzoMarket.sol contract.
$ forge build$ forge test$ forge fmt$ forge snapshot$ anvilBefore deployment, you should copy and .env.example to .env file on the root folder and update accordingly.
$ bash deploy.sh -k <your_private_key>$ cast <subcommand>$ forge --help
$ anvil --help
$ cast --help