Well, well, well, if this isn't the solution for finally trading those stocks without paying ta-cough what?
Sorry, what we meant to say was that this project is a new approach to perpetual onchain futures. There have been quite a few approaches in the past, but we believe that none of them match our idea, especially in terms of stability.
Here is how it works:
- Users register new futures (e.g., consumer price index) in the main contract.
- Contract deploys long and short tokens and three UniswapV3 pools: long-short, long-collateral, and short-collateral.
- Futures are issued in overlapping periods.
- Users can buy an equal amount of long and short tokens using a fixed collateral. The opposite side is auto-sold in the Uniswap pool.
- Users can redeem tokens for the initial collateral during the period.
- UMA's Optimistic Oracle resolves the price movement at the period end. Token holders claim collateral at resolved rates.
This idea is not entirely new. While we are not aware of any protocols offering arbitrary futures, the general concept has existed for quite some time in the traditional markets.
However, we think the following feature is quite innovative:
Perpetuals
- Users wanting perpetual futures get perpetual tokens by locking short and long tokens in a contract.
- Bots swap old-period tokens for new ones during overlapping phases, incentivized like a funding rate.
- Risk is on the bots, who can hedge on traditional markets.
No dynamic pricing or pool contract risk. Entirely game-theory and individual hedging based.
We have used the following technologies:
- The frontend consists of multiple components, two of have been deployed on the Near BOS, utilizing Bootstrap and CSS.
- The remainder of the frontend is build in Tailwind, Next JS and Typescript.
- Metamask SDK is used to interact with the blockchain.
- Out backend consists of four solidity smart contracts which are interacting the UMA protocol contracts to create new LongShortPairs and resolve them via the Optimistic Oracle, and the UniswapV3 core and periphery contracts to create new pools, provide liquidity and sell tokens to those pools. Both protocols proved to be essential for our use case.
- All contracts were coded using the smart contract development toolchain Foundry.
- We have deployed the contracts on the Gnosis chain because of its scalability and favourable dependency-contract situation.