Price feeds that are indexed and referenced for the JOJO markets

What is Oracle and Why Does JOJO Need It?

In the world of blockchain and cryptocurrency, an oracle is a third-party service that provides data to smart contracts. Smart contracts are self-executing contracts with the terms of the agreement between buyer and seller being directly written into lines of code. Oracles are entities that connect blockchains to external systems, allowing smart contracts to execute depending on real-world inputs and outputs. Oracle is also crucial for a perpetual trading platform like JOJO because it provides reliable and accurate price data for the platform's trading pairs.

Without Oracle, JOJO would not function properly since we rely on accurate and up-to-date market data to execute trades. Oracle's data feeds are essential for ensuring that the platform operates efficiently and effectively, providing traders with the information they need to make informed decisions. In addition, Oracle's technology allows for the secure and efficient transmission of price data to the trading platform, which is critical for ensuring that the platform operates smoothly and without interruption.

The high-performance decentralized exchange design of JOJO requires an oracle architecture that is specifically designed to provide ultra-low-latency and reliable oracle feeds for a wide range of market pairs. To ensure optimal performance of a decentralized perpetual trading platform, oracles must provide price feeds for every market on the exchange that possesses certain essential characteristics. These include decentralization, robustness, low latency, and cost-effectiveness. The price feeds are crucial for calculating complex functions such as account collateralization and perpetual funding rates. Additionally, the referencing of oracle prices must ensure redundancy across data publishers to prevent stale prices from reference providers, such as third-party exchanges, and to enable operation without a single point of failure.

Therefore, JOJO has adopted Chainlink and Uniswap V3 as the current oracle structure for Arbitrum Network, along with JOJO self-built oracle.

JOJO Oracle Architecture

Basically, JOJO uses Chainlink as the primary decentralized oracle provider and Uniswap V3 as a complement, with JOJO self-built oracle to serve as an emergency oracle.

Chainlink is a decentralized oracle network and is designed as a blockchain-based middleware application that functions as an intermediary between blockchain technology and non-blockchain technology. Through the use of secure oracles, Chainlink extends the functionality of blockchains by connecting smart contracts to real-world data, events, payments, and off-chain computation in a highly tamper-resistant and reliable manner. This capability allows smart contracts to evaluate variables in contracts using off-chain data.

The reason why JOJO use Chianlink as primary orcle procider mainly because:

  • Decentralization: Chainlink utilizes multiple independently operated nodes to provide data, which helps to reduce the risk of single point failures and increase the reliability and security of the system.

  • Accuracy and reliability: Chainlink nodes can retrieve information from multiple data sources and aggregate it, providing more accurate and reliable data.

  • Security: The Chainlink network incentivizes and punishes nodes, encouraging them to provide accurate data and preventing fraudulent behavior.

However, there may be certain trading pairs for which Chainlink does not support price feeds, such as $ARB. In these cases, Uniswap V3 is used as the oracle to provide price feeds.

Uniswap V3 TWAP Oracle

All Uniswap V3 pools can serve as oracles, offering access to historical price and liquidity data. This capability unlocks a wide range of on-chain use cases. TWAP stands for the time-weighted average price. It’s a reliable average price that can exclude short-term price fluctuation or manipulation.

Uniswap V3 has changed the status variable of the contract's observations. In addition, the storage of triggered data no longer requires off-chain programs to be triggered at regular intervals, but is automatically triggered when trading occurs on Uniswap. As a result, there is no longer a need for off-chain programs to regularly trigger price updates, and maintenance costs have correspondingly decreased.

JOJO contract uses Uniswap V3 as oraclefeed1 and the emergencyOracle provided by the backend as oraclefeed2. After obtaining the price from oraclefeed1, it is compared with oraclefeed2. If it falls within the threshold, it returns directly; if it falls outside the threshold, an error is reported. This design ensures that the price obtained from Uniswap does not deviate too far from the price obtained from centralized exchanges.

JOJO's Self-Built Oracle

JOJO's backend will retrieve the price feed from Binance. There are two primary factors to consider:

  1. Modification of the contract, which facilitates three modes of operation: utilizing Binance price, implementing JOJO oracle, and enhancing the price precision of Binance.

  2. Backend operation and maintenance, which requires the ability to operate consistently over an extended period of time, establish update strategies, and promptly update prices when certain accounts approach liquidation.

Overall, Chainlink is a type of off-chain oracle that sources its price data from multiple exchanges, but it has limited support for tokens and is primarily useful for obtaining prices of mainstream tokens. Uniswap V3's TWAP, on the other hand, is an on-chain oracle that can be used to obtain the price of any token that exists on Uniswap. The two complement each other and jointly build JOJO's oracle structure. At the same time, JOJO is also preparing a self-built oracle as an emergency oracle to provide users with the best trading experience. On top of that, we will be able to use the self-built oracle to achieve real-time quotes for JOJO in the chains that don't use Chainlink or Uniswap V3 as oracle.

JOJO Price

  • Index Price: obtained in real-time from the centralized exchange spot price and does not need to record on blockchain. This is used for backend calculations of funding rates. By default, the index price is taken from Binance's index price. This does not refer to Binance's spot price, as Binance has already completed a round of aggregation and security checks, making it more reliable to use.

  • Mark Price: introduced directly from Chainlink, used for calculating PNL. In the process of calculating funding rates, the mark price does not need to be considered.

JUSD Price Mechanism

JUSD is a stablecoin developed by the JOJO system to support multi-collateralization. This feature allows users to use other non-stablecoin assets (BTC, ETH, etc.) as a margin for trading. JUSD works like DAI and users can mint JUSD by staking other ERC20 tokens as collateral.

JUSD is designed to assist JOJOers who lack USDC funds to minimize their borrowing expenses. At JOJO, JUSD functions identically to USDC. Presently, the JOJO team maintains complete authority over JUSD to permit potential expansion of its applications. JUSD's sole purpose is to facilitate the JOJO system's accommodation of additional collateral. Our team has established only the JUSDBank (ERC20 version) at this time, with plans to expand to NFTBank and other new asset types necessary for Layer2 defi users.

The use of multi-signature control for JUSD issuance is our preferred method, as we believe it is the most secure and expandable. At the current stage, we guarantee that we will provide an explanation for every JUSD issuance. The issuance power of JUSD will ultimately transfer to DAO once the JOJO system matures and operates.

For more detailed info about JUSD, you may read this article:

🔰pageUnderstanding JUSD

Last updated