2. Participant Roles and Quoting Process
Sphinx considers how the game between different participants can satisfy the above three principles. First of all, there are three roles in the Sphinx system.
Provide quotes and pay commissions to get SPX tokens, the set of miners is denoted as O. Anyone can be a miner.
If a quote deviates from the market price, the verifier can trade with the quoted asset at that price and make a profit. The validator is required to force the offer while the deal is being made. The offer is not subject to commission and does not participate in mining. The set of validators is denoted as A. Anyone can be a validator.
2.3 Price caller
A contract or account that calls and pays for a quote provided by Sphinx is called a price caller, and the set of price callers is denoted as C. Any contract or account can become a price caller,usually for the DeFi protocol.
2.4 Quoting Process
The following is an example of the quoting process, using the BNB to USDT price as an example.
1.Miners pass their approved prices into the quoting contract and then credit the two assets in proportion to their prices. They charge X% of BNB as a commission for mining to get an SPX token reward.
Note: There is a certain capital threshold here, depending on the transaction size of the asset. In order to ensure accurate prices, miners need to pledge a certain size of assets and take risks corresponding to it in order to ensure price resistance to attack. Because of this, it’s more suitable for professional miners to participate as they are most likely to have the capital and quoting power to benefit from the role. Despite this, anyone may become a miner if they choose.
The Uniswap-like AMM market maker mechanism allows anyone to participate in liquidity, but with a higher risk of suffering impermanent losses. Traditional active market makers, on the other hand, have the flexibility to provide liquidity at a risk they can tolerate based on market volatility. Here Sphinx requires miners to take some risk and is the basis for ensuring that the system is resistant to attack.
2.After hitting the asset contract and waiting for T0 time, the verifier can use the miner's offer to buy BNB or USDT during this cycle, if no one deals within T0, the offer is accepted by the system; if the verified person completely deals then the price is invalid, and partial deal is partially invalid. After this time, the asset can be retrieved.
Note, here you can see the difference between Sphinx and other indirect oracle in the market. It requires miners to deposit real money to guarantee the accuracy of the price, thus avoiding the risk of introducing third parties outside the chain. Validators are similar to the presence of arbitrageurs in Uniswap, with the potential for unpredictable losses to liquidity providers. This is exactly the mechanism by which Uniswap forms prices. In order for an offer not to be closed by a validator, the miner then needs to have no room for arbitrage in either direction. The price prognosticator of the Sphinx protocol actually predicts the price in the future T0 cycle to some extent, rather than just being an indirect prognosticator's reaction to past prices. The setting of T0 here depends on the verification time of the block and the frequency of trading of the underlying asset. T0 can be set as short as 1 block, about 3 seconds, on the Binance Smart Chain.
3.While taking orders, the verifier needs to quote a new offer order out, and the size of the new offer order is required to be beta times the size of his own order. The verifier does not have to pay a commission when eating the order and does not participate in the mining reward.
Note, the verifier cannot only eat the miner's offer, but can also eat the previous verifier's offer, but should also meet the size of the eat order, which is beta times the previous one. This results in a price chain p0 -> p1 -> p2 with T0 time as the maximum offer interval, and an asset size chain x0-> x1 -> x2 where the price chain and the asset size chain will eventually terminate due to the limitation of the asset size due to the limitation of the capital.
Meanwhile, the system can set the beta flexibly according to the volatility of the asset. For example, when the current offer deviates more than 10% relative to the last effective offer, the current offer size factor beta equals 10.
4.The final block price is generated by a certain algorithm in the Sphinx protocol, according to the block record, by the quotes in effect in the block, assuming that the quotes in effect in a block are (p1, x1), (p2, x2) (p3, x3) then the block price P=∑pi*xi/∑xi. If there is no quote in effect in the block, then the previous block price is used.
Note that the block price formation is the result of a game between miners and validators, and the final block price is a weighted average of the offers. During the gaming process, the verifier cannot use a flash loan to attack the oracle, because unreasonable offers will be eaten by other verifiers, thus making the loanee unable to repay the loan and invalidating the transaction.
5.Broadcasting block prices through cross-chain communication protocols. The Sphinx protocol constructs a price oracle network for heterogeneous networks. The oracle network supports only one-way price transmissions. The price-generating oracle runs on top of the Sphinx Hub, which is responsible for broadcasting the oracle prices. The messages are propagated via the Interchain Communication Protocol (IBC). A proxy node collects the messages and independently verifies the authenticity of the oracle price information (transaction pair, block height, time, signature), etc. The problem of double spending is ignored here, thus simplifying the model and strictly ordering the messages.
Note that the cross-chain communication protocol here focuses on the latency and throughput of the cross-chain protocol. The Sphinx Hub that generates the price information has the highest block-out speed. When the price information is synchronized to a block with a slower block production speed, it is adapted by the proxy node to aggregate the price information of multiple blocks into a single price.
6.Invoking Sphinx oracle prices. As one price per block exists for Sphinx, a price sequence is thus formed. DeFi protocols that require quotes can use the arithmetic average price SMA or the exponential moving average price EMA of N consecutive blocks as the adopted effective quote. Note, It’s not just quotes that are required in DeFi systems, price volatility is often used as an important parameter for derivatives. DeFi protocols can calculate volatility from quotes over N consecutive blocks.
Although Sphinx offers a quality of service equal to that of a professional data service provider in traditional financial markets, Sphinx does not charge price callers, thus expanding Sphinx's ecological partners. After the number of Sphinx price callers exceeds 100, Sphinx will launch a community proposal to vote on whether to charge a fee and at what rate. This will help the Sphinx protocol create a positive cycle, fully unleash the community's governance capacity, and result in a well-established ecosystem of SPX tokens.
It can be seen that the design of the Sphinx protocol in the miner offer size, commission percentage x%, system waiting time T0, and beta coefficient ensure the first principle of the oracle; the setting of T0 time takes into account the second principle of the oracle, and the cross-chain communication protocol ensures the third principle of the oracle.
The parameters of the Sphinx protocol are important controllers to maintain the three principles of the oracle in a decentralized manner. Miners who contribute more to the Sphinx Protocol, mine more SPX tokens and maintain the security and stability of the network as the maintainer of the oracle network in a DAO manner.
Here is a brief assessment of the impact of the Beta parameter change on the oracle. Due to the presence of the verifier, after someone quotes a false price as a miner or verifier, it will be quickly sold by the verifier, and the money required to quote again is a multiple of the previous Beta. From this, it can be simply simulated that the cost of evil increases with exponential scale. The figure below shows the rising trend of cost at different values of Beta respectively. When the evil-doer wants to control the price significantly (10% or more deviation), its capital cost makes it an impossible task. (It reaches 10,000 times the initial funding after five rounds.)