Smart Contract Upgrade & Revenue Share

Announcing an upgrade to the Nectar Token Smart Contract & Month 2 revenue share (~ 1.3 million USD)

Christopher DeLuca
Ethfinex
4 min readApr 14, 2018

--

Today we are announcing the second distribution of trading rewards and revenue share for the period of March 16th to April 14th, and completion of the planned upgrade to the Nectar token smart contract.

2,580.9 ETH (~ 1.3 million USD), representing 50% of trading revenues during the last 30-days, were contributed to the smart contracts today. This brings the total in the vault contract to 4,557 ETH.

The contribution of the ETH to the smart contract also corresponded to the creation and distribution of 2,567,357 NEC as rewards to the traders who used Ethfinex during the last 30-days.

The rate at which tokens were earned during the previous period was ~0.994 NEC per 1 ETH of trading volume on Ethfinex. During the next 30-days the rate will now decrease to ~0.989. The equation governing this rate was explained in a previous post here.

Nectar Smart Contract Architecture Overview

The fundamental pieces in the architecture of our token design include:
A) The NEC token, otherwise referred to as the main token,
B) The controller contract (including list of users registered to use the token)
C) The vault contract

This modularity allows the more complex logic such as the issuance equation to be upgradeable, and will also make it easy to eventually add decentralised governance functionality to the token without redeploying or modifying the main token in any way.

The below diagram illustrates how the contracts interact to facilitate a transfer between two users.

Diagram showing transfer with authorisation by the controller whitelist

The controller contract acts as a plugin for the main token smart contract. When a NEC token holder seeks to transfer those tokens, it initiates a request to see if that action is permitted by the controller.

Controller Upgrade Process

One of the key functions of the Controller is to issue new tokens to traders to reward them for market making on Ethfinex. The diagram below explains the interaction between the Controller, Vault and Nectar Token which facilitates this. When we initiate a request to distribute tokens, that request begins in the controller contract, which calculates the correct number of tokens based on trading fees earned during that period, and then forwards that request to the main contract.

Diagram showing issuance of new tokens for market makers on receipt of trading fees.

As explained in a previous post here — the issuance rate was adjusted by switching the Controller contract for a new one (version 2.0.0).

This new issuance rate (in proportion to trading fees paid) uses the equation:

rate = 1000 * (2 — currentSupply / initialSupply)²

Graph showing the decreasing rate of issuance in proportion to currentSupply

Upgrading smart contracts once deployed, which are immutable by design, is notoriously challenging. However, because of the modular design of Nectar, this becomes a relatively simple procedure.

The new controller is deployed alongside the original. The original controller is then called to notify the token about the upgrade and delegate control.

The process of upgrading is illustrated in the diagram below, and the two contract calls used to deploy and then upgrade can be viewed on etherscan:

Deployment of Controller 2: https://etherscan.io/tx/0xe8b1fda901476b8e33aede88cb0690903e433147eeb32803f05f5cbedd2f5056

Call to notify Controller 1 and delegate control:
https://etherscan.io/tx/0xe91489b5f9eb78a96892b29dc568b418f930176f6cd13e886cd8470ac0f33b5b

Diagram showing the steps involved in upgrading the Controller.

Decentralised Governance

The upgrade process is the same one which will eventually be used to transfer the Nectar token to full decentralised governance by token holders. Already a proposal and voting dApp has been deployed at https://nectar.community which uses a second smart contract to manage proposals and voting, however eventually the current Controller can be replaced entirely by one which allows decisions to be enforced on chain.

NEC Reward Distribution

Verified tokens holders will see a new batch of NEC tokens in their account — which correspondents to their trading activity. For users who are not yet verified, we will be crediting, retroactively, NEC tokens accrued during the period of pending verification. Traders who became verified over the past month have been credited with NEC tokens for previous trading activity.

Tokens holders have the ability to create proposals affecting the platform and the community. Empowering token holders to become active participants in the community is a key step towards decentralising decision-making on the Ethfinex platform. Please visit https://nectar.community to submit your ideas!

Trading is now live on Ethfinex — try it here.

If you’re a developer, check out the Github repo for the Nectar token community governance.

Join us our Twitter, Telegram and Reddit to stay up to date with announcements.

We’re hiring! Check AngelList, LinkedIn and our Careers section to find the latest opportunities.

--

--