VariabL Features — Efficiency and Security

Simon Polrot
VariabL Blog
Published in
6 min readSep 5, 2017

--

Building a decentralized exchange on Ethereum or other blockchains presents a huge technical challenge. Decentralization comes with extremely interesting benefits as well as frustrating limitations, which can significantly hinder the user’s experience. As early explorers of this emergent technology, we worked hard to find the best way to implement a platform that is both secure and user-friendly.

We think we have found the perfect tradeoff between a fully decentralized and a fully centralized infrastructure, allowing for the best of both worlds.

In a nutshell, VariabL relies on centralized infrastructure for efficiency and uses carefully-crafted smart contracts for security.

VariabL vs fully centralized or fully decentralized exchanges

We are onchain; your funds are safe

On the VariabL derivatives trading platform, you always keep control of your funds. Rather than depositing into our accounts, you directly control your Proxy contract, which is used to enter into long or short positions on our market. The positions themselves are also settled onchain (i.e. on the Ethereum blockchain), and the only accounts that can receive funds from those positions are those that have created the contracts! And yes, we secured our init functions.

Let’s go deeper into the smart contract mechanisms behind VariabL. Our system supports three major types of smart contracts:

1. Proxy accounts

The Proxy contracts are created by VariabL at the time of user account. These contracts ensure the security of your funds, as you are the owner of the Proxy smart contract (secured by your private key) and can withdraw your funds at any time. The use of smart contracts also allows for flexibility as those proxies will be implemented as smart-contracts and will, in the future, feature interesting features such as the possibility to recover your account should you lose your private key (in development).

2. Offers contract

Offers are formalized in the form of contracts dispatched to the Ethereum blockchain. They contain the funds you are willing to engage and your conditions. Your ether is secured in the smart-contract and is never handled off-chain. However, implementing the full order book on the blockchain is both expensive and suboptimal; our research team is busy at work implementing a state channel infrastructure for the next version.

3. VariabL Derivative Contract

Once an offer has been matched, a VariabL Derivative Contract is formed between someone with a long position and someone with a short position. The funds of both clients are kept safe in a smart contract, and can only be sent back to one, the other, or both participants, depending on the price of ether at the expiration of the contract.

It is important to mention that although smart contracts can be more secure than using an offchain exchange or relying on a third parties, a flaw in such contracts could lead to significant financial loss. That’s why we have veteran smart contract security specialists both on our team (Vincent Eli) and employed as external consultants, and why we will have our full set of smart contracts reviewed by at least two external auditors (the best in the field — including OpenZeppelin) before deploying anything on the mainnet. In addition, we are contemplating switching our smart contract mechanisms from Solidity to a formally verified language in the future.

So, we provide you with the control of your funds in a secured platform. Does this extra security affect the efficiency of the product? Not at all.

We are offchain; our product is efficient and compliant

In researching the best way to implement our derivatives trading platform, we quickly realized that the current state of development of decentralized technology would not allow us to create a fully decentralized derivatives trading platform. Computation on a blockchain is still slow and costly, and the tools to decentralize this computation efficiently are not ready. We concluded that we had to implement a hybrid model at first to ensure the speed and cost-efficiency of our product. In doing so, we realized that we could find a way to combine most of the benefits from trading onchain with the efficiency of a centralized exchange. In addition, the amount of control we gained with this approach will very likely help us to become the first regulated decentralized exchange on the planet.

Figure 2 How VariabL works

In practice, we will host many parts of our product on our servers, including:

  • User interface: This is mandatory for all dApps for now as, unfortunately, the decentralized storage projects like Swarm or IPFS lack the scalability and reliability required for any critical infrastructure. We will switch to such systems as soon as they are ready.
  • User accounts: We manage the user account creation, together with the deployment of your Proxy smart-contract; you don’t want your personal data onchain, and we want to be able to help you if you lose all access to your private key. We will soon implement accounts in a similar manner to the uPort platform, and we plan to integrate with their platform in the future.
  • Matchmaking transactions: Matchmaking consists of non-critical computational steps that are very expensive to run on the blockchain. The VariabL platform does the matchmaking offchain and verifies it onchain, which is less expensive. We do this by replicating and storing a copy of the orderbook of derivative contracts from the blockchain. Our system constantly monitors the Ethereum blockchain to get the latest state of the orders. The VariabL interface is then capable of generates data for transactions that will be signed and sent to the blockchain by users themselves.
  • Price oracle: Currently, there’s no sufficiently reliable ETHUSD price oracle on the Ethereum blockchain that we know of (if you are providing this service, please reach out to us!). We will implement our own using an average price derived from the price feeds of many other exchanges in a provably fair manner.
  • Monitoring positions & initiating liquidation or settlement: A smart-contract on Ethereum is not self-executory; an action on the blockchain requires a transaction to be sent to the contract. It would not be very user-friendly if our clients need to manually liquidate / settle their positions on VariabL Derivative Contracts, so we do this for them. A custom bot constantly monitors the opened contracts and sends a liquidation / settlement instruction to those which are expired or whose liquidation price has been reached. Of course, we do not have control of those contracts and merely execute them as programmed.
  • Soon: Offchain transactions with state channels — more details coming soon.

In the end, we structured our product to keep the essential pieces of value on the blockchain, allowing for the most balanced approach between both worlds. VariabL’s orders and value transfers are settled onchain, which makes them secure, but certain demanding tasks are centralized on our servers so that we can provide a highly efficient platform.

We hope that this overview helped you understand our product and our vision.

For more information and updates, join us on slack, subscribe to our newsletter or follow us on our social medias (Twitter, Facebook).

--

--