The Onyx Ecosystem Litepaper – Creators of the first S&P 500 token

The Onyx Ecosystem Litepaper – Creators of the first S&P 500 token

If this is the first time you are hearing about us, check out our website or buy one of our tokens, like our Onyx S&P 500 token, and make sure to follow us on twitter and reddit!

What is Onyx? — Onyx is a token provider that provides ETF-like, ERC-20 tokens to the crypto masses in order to invest in, or short, crypto or non-crypto assets such as the S&P 500, Gold, Bitcoin, or Nasdaq 100. We plan on being just like Vanguard, iShares, or ProShares of the crypto world. Onyx is a protocol, not one dapp, and our coins trade on many exchanges.

Why did we create Onyx?- Currently, Defi can trade and hold stable money, borrow and lend that money, gamble it, invest it, have futures, options, and even leveraged trades. But all of that is meaningless if you can’t do it to real world assets and you can only do it to tokens. Our mission is to fill the final missing piece of DeFi, and enable the community to trade and hold real world financial indices and commodities. Finally, you can have your entire financial life completely decentralized on the blockchain. Buy and hold the S&P 500, or short it, or convert it to bonds or stable money, all on the blockchain, completely decentralized. Never have a bank or broker ever hold your wealth ever again.

How does it work?- The goal of Onyx is to keep price of our tokens equal to the price of the asset they represent, nothing else matters. We do this by making sure that the demand/supply ratio of the token is equal to the demand/supply ratio of the asset. Over time, as a token market-cap gets bigger, the demand of a token and its underlying asset will naturally equal each other, so there would need to be barely any supply change. But until then, if the price of the token trading on exchanges is too low, arbitragers can buy the discounted token on an exchange, and sell it to it’s contract for a profit, decreasing the supply and increasing the price. This will continue until the price of the token is equal to the underlying asset. If the price of the token is too high, arbitragers can buy the token from it’s contract using ETH or Onyx USD, and sell it on an exchange for the elevated price for a profit, increasing the supply and decreasing the price. This will bring the price down to the correct level. 

General rules for how to interact with our token contracts for arbitrage.

  1. Onyx USD token contract can receive ETH and will return Onyx USD tokens.
  2. To withdraw, send Onyx USD tokens less than withdrawMAX() per block, back to Onyx USD token contract, and you will receive Onyx USD.
  3. All asset token contracts can receive ETH and Onyx USD tokens and will return asset tokens.
  4. To withdraw, send the asset tokens back to the asset token contract, and you will receive Onyx USD.

If you are a developer, check out our developer page to find out how to make money with price arbitrage opportunities.

So far Onyx asset token arbitrage works 24/7, and the price of the asset when the stock market is closed is just based on the last price while it was open, but soon it will only be available during market hours, and the price of the token will just free float during non market hours. Even though the prices will free float, they will still follow the market quite closely. For example, if the stock market will open in 5 minutes, and the crypto market speculates that the price will start high, then arbitrageurs will buy up the token, raising the price close to what the stock market is speculated to start at, so that they can sell high when it opens. Asset tokens will actually be a very good predictor of what the market is doing off hours and will be a way to get in and out of the market 24/7. Crypto based token arbitrage will obviously work 24/7 since the crypto market is open 24/7.

Onyx is resistant to front-running attacks since arbitragers don’t get paid until after the transaction is completed, it is two separate transactions for giving ETH and receiving tokens, not one. The price of tokens is calculated after the transaction is completed. We currently use a centralized oracle but in the future this will be updated to a decentralized one like chainlink.

All asset tokens are infinitely collateralized by Onyx USD, and Onyx USD is collateralized by ETH(or whatever the Onyx team chooses). All of the ETH given to buy all tokens is shared and held in the Onyx USD contract. Every token also has a Short counterpart. Most of the price increase of a token can be counteracted collaterally by its Short counterpart, so all the Onyx ecosystem has to care for is an uneven ratio of market-cap of asset tokens to its short tokens, and also the ratio of the total portfolio market-cap of all Onyx tokens to its collateral, which can be ETH, compound DAI, or whatever. If the collateral is 100% compound DAI, then Onyx only has to worry about uneven ratio of market-cap of asset tokens to its short tokens. There are several ways to counter balance this, such as fees for arbitragers, which will be discussed later, but this is only if the total market-cap of all Onyx tokens will increase greater than the compound DAI collateral.

All asset tokens can give unlimited Onyx USD as payment, so the only price the Onyx ecosystem has to worry about is of Onyx USD giving ETH as payment. To prevent “run on the bank” situations, there is a withdraw limit to how much Eth you can withdraw from Onyx USD per block that is a function of how much eth there is in the contract. This means that the Onyx USD contract will never have 0 ETH, but, at most, the contract value will exponentially decay. For example, if the total collateral is 1000 ETH, and the withdrawThreshold is 2, then withdrawMAX() is 500 Eth for that block, 250 ETH for the next block, 125 ETH for the block after that, etc, assuming the withdraw limit is maxed out at every block. More realistically, withdrawThreshold will be set to something closer to 100 or a 1000.

WithdrawMAX() was put in place to discourage humans from using the contracts and encourage them to use exchanges, to increase exchange volume, since a human will get tired to withdrawing 100 times in a row, but a bot won’t. The withdraw limit was also put in place to prevent sharp withdraws and panic situations, and will make sure the ratio of collateral to total market cap is what it should naturally be based on supply and demand, not speculation or panic. Lastly, the exponentially decaying contract was put in place to allow a lot of time for price volatility arbitragers to take advantage with OUSD/USDT or some other stable coin. Every time the price hits .99 they buy, and when it hits 1.01, they sell. This will make sure the price of Onyx USD is stable primarily from volatility arbitragers and not contract arbitragers, discouraging the draining of the collateral.

General rules for price arbitrage.

  1. Its cheapest to be a volatility arbitrager (OUSD/USD, OETH/ETH), since you are dealing with everything within an exchange and not having to also deal with token contracts. Because of this, most short term price fluctuations are going to be corrected by volatility arbitragers not contract arbitragers, since it won’t be profitable. Contract arbitragers will only deal with long term average demand/supply ratios. If on average the demand/supply ratio of Onyx USD is constant, than no contract arbitrage will exist. 
  2. Contract arbitragers will hold mostly Onyx USD since converting everything to ETH is more expensive than not converting it. As long as one arbitrager doesn’t convert everything to ETH and hold all value in Onyx USD, he will eat up all the profits, leaving no profits for every other arbitrager. 

If the ratio of collateral to total market-cap of all assets become to low, and the withdrawlimit() is maxed out on blocks very frequently, the team can add a fee for every arbitrage transaction to increase the collateral supply. The team can also loosen the price of assets, so the buy and sell price is 101% and 99% respectively of the underling price, also increasing the collateral supply. 

Soon Onyx will release Eth and Eth Short tokens, giving no reason to withdraw to ETH, other than price stabilization of Onyx USD. 

If a rogue actor tried to collapse the Onyx ecosystem, it would be extremely difficult and expensive. They would need to have a Onyx USD value greater than every volatility arbitrager combined, plus the total collateral. Only then do they have a chance to collapse Onyx by selling all of the Onyx USD they have on exchanges, and have every volatility arbitrager buy it up, and every contract arbitrager by it up, maxing out the withdraw limit for every block indefinitely. If the amount of Onyx USD sold is not greater than every volatility arbitrager combined, plus the total collateral, then the price will eventually pop back up, and make volatility arbitragers a lot of money . All of the collateral necessary to offset the sale would not need to be sold however because the exponentially decreasing collateral allows time for more volatility arbitragers to join to take advantage of the low price and more collateral to be added during token contract interactions. Because of this, even if more than every volatility arbitrager plus collateral is sold, there is still a high chance the price will pop back up.

Again, this is extremely unlikely because an attacker would need to have an extremely large amount of Onyx USD and be willing to lose a lot of money. If only 60% of all of Onyx is collateralized for example, they would need to have an Onyx USD value greater than 60% of the market-cap of all Onyx tokens combined. And run-on-the-bank situations are unlikely because the exponentially decreasing collateral acts similar to circuit breakers on the stock market, dampening the decline, so there would never be a sharp drop.

As a side note, its a misconception that a system needs to be 100% or more collateralized in order to function. Nothing in finance or even life works that way. All that matters is that the demand/supply ratio of the tokens are equal to the demand/supply ratio of the assets they represent. The larger the supply of the tokens becomes, the more correlated the natural demand would be to the assets demand, and there would need to be almost no supply change. This is similar to how the gold/silver ratio changes far less dramatically than their individual prices, or how BTC/ETH changes less dramatically than their individual prices, even though there is nothing changing supplies to link their prices. Its because their prices are correlated. Onyx could still function very well even if it only had 5% collateral theoretically, not that this would ever happen.

Known attacks:

If someone has a large amount of Onyx USD, a lot greater than the total collateral, however unlikely, they can potentially collapse the system by selling all of it on exchanges, as described above. 

Someone can potentially also do a DDOS attack on the oracle or the oracle host could go rogue. This threat will be nulled when we move to chainlink. In the meantime, the oracle site is pretty well protected and only accepts calls from certain IPs, and is distributed among a few hosts. Also there are a few mechanisms in place to make sure prices are accurate and won’t go to extreme values. 

Non-threats:

Frontrunning attacks are impossible because asset prices are updated after an arbitrageur transaction is completed. Eth price is updated traditionally rather frequently, but has an upper and lower bound based on what the previous price was, so there would never be an arbitrage opportunity knowing the updated eth price information early. 

Coins planned on being released soon

  • Total Crypto market
  • Total Crypto market Short
  • Total World market
  • Total World market Short
  • Bitcoin
  • Bitcoin Short
  • Ethereum
  • Ethereum Short
  • Gold
  • Gold Short
  • Silver
  • Silver Short
  • Oil
  • Oil Short
  • Total US market
  • Total US market Short
  • Nasdaq 100
  • Nasdaq 100 Short

What we have planned for the future

Since our oracle interacts with our contract every time an arbitrage transaction is made, it is trivial to send our contract more information. Soon we will have our oracle send our contract the current ETH price information and make it available to the DeFi community to use for free on chain. Finally the community will have accurate ETH price information accessible on the blockchain that is updated every few seconds for free.

Another piece of information is EthGasStation price. Our contract currently needs to be update manually for what a good gas price is, but soon it will obtain this info every time a transaction happens, and we will share with the community for free. You will have Fast, Standard, and Safe Low gas price available on the block chain updated every few seconds for free.

Lastly, we feel in order for this community to grow, there should be no barrier to entry. Which is why soon we will be providing free web hosting and subdomain for anyone in the DeFi community who needs it.