CODEX - Community Owned DEX on the YAS blockchain

Published by eosnetworkxx 29 Jan 2020

CODEX - Community Owned DEX on the YAS blockchain

CODEX is a community-owned decentralized exchange that will be launched soon on the YAS blockchain. It will be a simplified set of automated market makers where anyone can trade one token to another and where anyone can become an oracle or a getaway to teleport tokens cross-chain. CODEX will become another DeFi hub on EOSIO.

On January 19th was launched YAS network which is another iteration of the EOSIO software with features quite similar to the EOS chain. On this network will rise CODEX with its first 3 tokens and 6 trading pairs. All major cryptocurrencies like BTC, ETH, EOS, etc. will have their corresponding VBTC, VETH, VEOS, etc. as a market pegged asset all tradeable among each other. It will be also possible to add other stablecoins representing any chain or currency (VUSD) or anything priced outside like VGAS (gasoline prices) or VGOLD (grams of gold). Each additional market pegged asset will put 6 trading pairs involving 3 tokens.

The main tokens for YAS will be VEOS, ANTIEOS, and OREOS. These 3 tokens will create an EOS pegged asset that will reflect the EOS price on YAS.

VEOS (Virtual EOS) will be like the EOS token ported to the YAS chain. It will have the features of a stablecoin and it will be pegged to EOS. VEOS can be purchased with YAS through OREOS or with OREOS.

ANTIEOS is a token that will be purchased in the same way and it will be the token used to short VEOS. If you think VEOS is priced high, you buy ANTIEOS or go short VEOS and if you think that VEOS is too low then you sell ANTIEOS or go long VEOS. In this scenario, VEOS and ANTIEOS become the Schelling point of EOS.

OREOS (Oracle EOS) will be oracle tokens. They are purchasable with YAS and they can be used to short or long VBTC, VETH, VEOS, etc. Oracle EOS will be a link between YAS and VEOS or ANTIEOS. OREOS are needed to mint new VEOS or ANTIEOS. If VEOS is minted, its price increases and the price of ANTIEOS decreases and vice versa. These two tokens can be also destroyed and the effect will be the opposite of minting them. To mint, OREOS tokens are spent while the user will get OREOS to destroy them.

All YAS holders will be able to become oracles by trading YAS with oracle tokens and using the oracle tokens to take long or short positions on YAS vs EOS. OREOS are created continuously and in perpetuity. A fixed amount of OREOS is created each second and 95% are instantly put on the market with YAS. 5% goes to a loyalty pool. Every time someone mints VEOS or ANTIEOS he gets a reward from the loyalty pool, however, it’s still unclear how the rewards in the pool will be distributed since it needs to be tested first. The oracles will look at YAS/VEOS rice and check if it matches the outside world. If it's not the same, they’ll react as quickly as possible to make the correction.

There is a market pair with YAS and OREOS. New OREOS will get minted and put on that market every second. This causes the price of OREOS dropping until someone finds it cheap enough and buys. It's like a continuous Dutch auction. The YAS that people send to get OREOS will stay on that market. If someone sells OREOS back, the YAS gets sent back. If we think about the YAS/OREOS pair, that pair is a market maker contract. If YAS is sent to it, OREOS will be given in change and vice versa. Trading with this pair contributes to the price change. There will be an oracle token for each market pegged asset. Each oracle token will need YAS and this will create great utility for YAS. All VEOS and all ANTIEOS that exist will be backed up by an amount of OREOS in a contract. You can add OREOS into the contract to mint either VEOS or ANTIEOS. You can also get OREOS from the contract by burning either VEOS or ANTIEOS.

OREOS inside the contract = all VEOS + all ANTIEOS that exists.

If someone will try to manipulate VEOS by pumping its price, anyone will have the possibility to take the opposite side by buying ANTIEOS. If you think one token is overpriced and will go down, you buy the opposing token. It's like a battle of the bear and the bull where you get loyalty rewards if you act as an oracle. The oracle network, will remove arbitrage possibility on-chain and give traders the best possible deals.

“If the price of VEOS is low compared to EOS, as an oracle you buy it and profit. Since we depend on the bandwagon effect and self-fulfilling prophecies. If VEOS is down everyone will think that everyone will buy it, so it becomes a self-fulfilling prophecy. With oracles we have now a way to bring EOS price inside the chain without the need of external price feed” said Aiden Pearce, the creator of YAS.

Since blockchains are closed systems which mean that they don’t receive any information about the external world, this information needs to be brought from outside with the help of oracles. Using the 3 token design for each asset existing outside the chain, we now have the means to bring it on-chain in a decentralized manner without relying on the external price feed.

Anyone who brings the information from outside to inside is an oracle earning on the position taken and the loyalty rewards from the pool.

There 6 trading pairs on YAS will be:

OREOS/YAS market




There will be also 2 indirect markets based on cascading contracts



When CODEX will be launched on EOS it will use the same technology on the EOS chain to make EIDOS tradeable with VYAS, ANTIYAS, and ORYAS. Teleporting across chains will involve another stablecoin.

Each base token like EOS, BTC, ETH, etc. will have 3 tokens. If there are VEOS and VBTC, oracles on both will also bring in EOS/BTC price outside on-chain. If someone wants to buy VBTC, he can use YAS, EOS or any other token since they are all linked, sometimes directly, sometimes through cascaded trades. It will be possible to buy Virtual BTC (VBTC) without holding the underlying BTC asset just like it’s possible to buy DAI without holding fiat USD. Bitcoin backing is not necessary since the pegged asset is backed by other tokens. “Think about it like BitMEX perpetual contracts but you can take out the tokens and send them, without the leverage. It's like a tokenized long and short positions but without leverage” said Aiden Pearce. For more virtual base tokens like EOS, BTC, ETH, GOLD, USD, etc. to exist, they will need to be backed by more OREOS. This, in turn, will be backed by YAS. This means that there will be always less YAS in circulation making it very scarce. There will never be more than 100 M YAS in circulation.

CODEX will also have getaways that will be used to teleport tokens. They will be the link between market pegged assets and real assets they are pegged at. Anyone can become a gateway by trading EOS and VEOS. Pearce said that his team will become a getaway to show everyone how it should work. They will have some EOS and VEOS and anyone will be able to convert these two tokens for a fixed fee. Gateways will compete for the gateway fees. But since VEOS is algorithmic in issuance, nobody is compelled to support it. It will be voluntary and each one will have a business case to run gateways. Pearce’s gateway will buy all VEOS with EOS and they will also buy EOS with VEOS for a fixed transaction fee. Becoming a gateway is permissionless and open to anyone just like anyone can trade Dai with USDT.

Tokens teleporting mechanism will depend on one gateway to another but basically, a user will need to send tokens to an address owned by a gateway and put in a memo the address where to receive on the other chain. Once irreversible, the gateway will issue the other token on another chain. The finality on EOSIO chains is currently 3 minutes that’s why the teleport becomes centralized for the duration of this finality. The only EOSIO chain that managed to achieve 3 seconds las irreversible block (LIB) is BOSCore.

EIDOS will be the backbone of the whole CODEX on the EOS chain and it will use liquidity shares. Liquidity shares will be for markets that involve tokens that are not stablecoins.

In CODEX, you either trade and pay fees for your favorite pair, or you can be a liquidity provider and take the fees, or you can be both to support your favorite trading pair. Pearce said that codex and other future blockchain projects that they will launch to connect with the YAS chain will drive value to the EIDOS token. They will most likely launch a parachain based on Polkadot's substrate and/or eth2 type chain. He also said that EIDOS will be the last mining type of distribution that he will use.