ERC20 Token Migration & Staking App v2

Jonny Huxtable
LinkPool
Published in
10 min readMar 26, 2021

It’s been a long time since we gave an update to the LinkPool staking platform since its launch in late 2018. That’s not to say we stopped working on it, rather the opposite. We re-developed it twice over the past two years to work with contract updates and to improve the UX. Although since we’ve seen the DeFi boom in 2020, the importance of composability became dramatically apparent. That’s why we’ve since rebuilt the token and platform from the ground up to provide a staking ecosystem that’s not just for us but the entire Chainlink node ecosystem across multiple blockchain networks in a fully composable manner.

I’m delighted to share what the team has been working on so tirelessly for the past year; it’s a culmination of past experiences, new expertise, and matured ideas.

Staking v2 URL: https://app.linkpool.io

Some Background

You can still find the code for our now deprecated owners’ token here and here. It launched in 2018 and saw two further contract updates to optimise gas costs and add new support for features like our old DEX, although since the token had the distribution mechanism directly built-in, it couldn’t conform to the ERC20 standard. Due to that, it made our platform very inward-looking with a significant barrier to entry (forced 0.04 increments) while the liquidity to exchange the token was extremely low.

The old token model did have some benefits for holders, like automatically airdropping rewards (over 200,000 LINK distributed in total) into the users’ wallets, offering a thoroughly hands-off approach. Still, it became very apparent very quickly, especially with the gas rises, that this model was inefficient and unscalable.

ERC20 Migration

This leads us on to the design of our new token, a model that’s taken influence from the DeFi ecosystem while keeping our same core premise of priority access to staking on the LinkPool node and proportionate reward distribution. To avoid confusion with Liquidity Provider tokens, we’ve also given our new token a slightly different name than the old one.

Notably, the new LPL token actually meets the ERC-677 standard, which for our purposes allows for approval, transfer and distribution of rewards within a single transaction.

Migration Process

To migrate from the old LP token to the new LPL, simply browse to our staking app, connect to a wallet that holds the LP token, and click “Migrate to LPL” to send the transaction.

If you’re one of the original 186 who participated in the crowd sale, make sure you migrate using your original contributing address as you’ll receive an NFT celebrating your longstanding support.

Once completed, you’ll see some celebratory fanfare and your balance will update to reflect the new total supply.

To earn rewards, you are required to stake your LPL within the owners’ pool. The new owners’ pool is different from the old, as rewards are distributed proportionately to all the current stakers as they’re sent to the contract. So if you’re not staked, you’ll miss any rewards, and the claimable LINK:LPL ratio will increase for the current stakers.

There is no time limit to migration, but it’s important to migrate as soon as possible to ensure you still earn rewards.

Rewards Distribution

As mentioned, the old token model had the benefit of holders not needing to pay any gas to receive their airdropped LINK. We’ve stayed as true to that as possible in the new model, as users will receive their rewards directly in their wallet in the form of a 1:1 LINK derivative with the ticker lpoLINK. Your lpoLINK balance will automatically increment in your wallet as your LINK rewards accrue. A user only needs to pay gas once to swap their lpoLINK for their earned LINK, and there’s no deadline or timeout on when a user has to perform the swap.

To give an example:

  • LPL holder stakes all their tokens within the owners pool
  • Over 18 months, 100 lpoLINK is accrued in rewards
  • User swaps all of their lpoLINK for LINK

You can forever leave your earned rewards within the owners pool, while your reward balance will automatically update when rewards are transferred in. The rewards that currently accrue originate from fees from the LinkPool Chainlink node, the Market and other services we offer.

The End of Bi-Weekly Distributions

In the old world, fees would be airdropped every two weeks to all LP token holders. These fees would be collected manually via a script from over 100 different smart contracts. That is no longer the case, as we’ve created a new contract-based mechanism that automatically transfers rewards based on a minimum LINK threshold.

The new world is leveraging Chainlink and Keep3r, in a contract we call the “KeeperSweeper”. Once rewards are over a certain threshold, currently 500 LINK, nodes will be incentivised to call a function on this contract that sweeps all of the rewards from all Chainlink feeds and transfers them to the owners pool. The beauty of this is that the process is now fully automated on-chain with incentives, dogfooding to show what can be done with Keep3r and its Chainlink integration.

With the new LINK rewards derivative token and automatic rewards distributions, holders can simply track how many rewards they’re earning within any wallet and watch it update on a semi-frequent basis. At current rates of LINK earned, that would be around once every 12 hours.

DEX Deprecation

Due to the migration to ERC20, we will no longer need the DEX to allow people to exchange the token. The UI will still be available at the same URL for people to close any open orders so they can migrate, but post-migration we anticipate seeing pairings created on AMM’s with liquidity for people to instantly swap LPL. A much improved aspect.

Staking Allowances

Like before, the new LPL token will still be required to gain a staking allowance on the LinkPool node. Although it works completely differently. Now, when you stake into the owners pool, in return you will receive what we call “allowance tokens” or LPLA. When you stake your LPL, you’ll receive an equal amount of LPLA. To begin with, that will be the linkLPLA variant and once staking is released, you will stake your linkLPLA alongside LINK to gain access to the pool. The more assets we support in staking that requires an allowance, the more allowance token variants we’ll mint.

An interesting aspect of this is that the LPLA tokens are ERC20, and you don’t need both LPL and LPLA to stake. If you have a balance of LPLA, then you can use that to stake in the LinkPool node without first having a balance within the owners pool. Although it’s very important to note that to withdraw LPL from the owners pool, you need to provide all of your allowance tokens to unwind the LPL.

This creates a scenario where there may be both liquidity in the LPL and LPLA tokens, where one may opt to simply swap assets into LPLA to gain a staking allowance, with LPL holders needing to buy back any sold allowance to withdraw LPL out of the pool.

The core reason for gating access to each pool with an allowance token is the ability to respond to demand for collateral while preventing dilution of yield for those already staking in the pool. After the launch of staking, the more work our Chainlink node gets, the more collateral it demands, the more LINK can be put to work, and the larger the LINK:LPLA ratio can grow, meaning the more each staker can stake.

Allowance Lending

After many thoughtful suggestions from our community, we’re happy to say that our new model will also support the borrowing and lending of any given allowance token. This will allow individuals with more staking allowance than stakeable tokens (e.g., more linkLPLA than LINK) to lend out their allowance to individuals with more of a given token than allowance. As a reward to allowance lenders, allowance borrowers will pay a variable share of their earned rewards to lenders. In this way, both parties earn yield on their holdings, increasing capital efficiency. Allowance lending isn’t yet live but will launch alongside staking.

The interest rates charged by the allowance lending pool will be determined by a bonding curve that we’ve created to balance between liquid LPLA available to be borrowed and its overall utilisation. Every LPLA holder will be able to stake their unused LPLA within the lending pool, allowing non-LPL holders to stake their LINK and for the lender to earn yield on their unused allowance. Allowance lending is the sole mechanism by which non-LPL holders will gain access to staking on the LinkPool node.

Over time the un-circulating supply of LPLA from the company’s LPL will be released into the lending pool to allow non-LPL holders to stake their LINK. The vesting schedule of that LPLA into the lending pool is not yet decided, but it will be based on how much LINK the LPL holders have compared to the collateral needed.

Staking v2

As already briefly shown, we couldn’t provide a new token model without redesigning our Staking app and its contracts from scratch to go alongside it. We’ve taken our experience from building the first iteration of the Staking app, the Chainlink Market, and all other Chainlink applications to provide a sleek and simple new user experience that will power LinkPool for years to come.

New Contracts

In our complete redevelopment of our staking contracts, we’ve taken significant inspiration from DeFi’s Cambrian Explosion with an eye on enabling composability for the LINK staking ecosystem. We’ll achieve this with our claim-based reward system, derivative tokens, strategies, and governance.

We aim to be the preeminent liquidity pool within the Chainlink ecosystem. Not just liquidity within our own staking pool, but for all Chainlink staking pools and DeFi ecosystems. As we talked about in this old article, we want to provide an open platform that isn’t just built for our own interests but every node operator. We want to empower every node operator, large or small, to use LinkPool’s tooling and platform to create their own pools and easily access liquidity for their collateral needs, thereby enabling greater capital utilisation.

Third-party node operators will be able to use the LinkPool platform to tokenise their nodes’ revenue as we’ve done with the LPL token; use a flat fee structure or even create their own model and get it listed as a pool. New pools with custom models will be required to pass a governance vote by LPL holders, after which their pool can be listed as part of the LinkPool platform.

Strategies

One of the areas we’ve focused on when building the new pooling contracts is strategies within the pools. Similar to other DeFi projects, each pool will be able to deploy capital to one or more strategies. In the case of the LINK staking pools, there will be a strategy that stakes LINK into a node, then potentially other strategies that will deploy any unused liquidity into other platforms to optimise the yield of the pool, making sure no tokens are idle.

What makes the management of LinkPool strategies unique is that there’s governance on how much of the pool’s funds are routed into each strategy. Each staker within the pools will be able to vote to give a percentage split of where they want their tokens routed. For example, if there were strategies A, B, and C, a staker could vote to balance those tokens 70%, 30%, and 0%, respectively. Once voting is complete, then the average splits are calculated and tokens re-balanced. An important point to note is that minimum staking requirements are always adhered to, meaning staking LINK onto Chainlink nodes will always be the number one priority. So, if the LINK staking strategy requires 3 million LINK for collateral, then the pool will only allocate excess tokens to strategies once the node’s minimum limit has been met. This way, the pools are always balancing tokens between strategies that best optimise yields for stakers, rather than leaving a large amount of LINK sitting idle.

Take for example, a scenario in which a Chainlink node takes on new jobs that require additional collateral. In this case, the staking strategy’s minimum collateral requirement will increase. The pool will automatically recognise that, rebalancing tokens from the other strategies to be staked into the node, ensuring the node’s minimum collateral requirements are met. Like discussed with rewards distribution, this will also work by dogfooding Chainlink’s Keep3r integration, meaning that when a node’s minimum collateral requirement is increased a Keeper node will instantly send a transaction to the pooling contracts, rebalancing the funds, and ensuring that the node’s staking strategy is never undercollateralized.

Strategy Partner Program

Since our pools and their strategies are wholly generic, supporting any ERC20 based token, we’ll be formalising a new strategy partner program. If you have an idea on how LINK tokens can be best utilised within the DeFi ecosystem on any network, you can work with us to build it and get it deployed as a strategy within the LinkPool ecosystem, forever receiving a percentage of the rewards generated.

If you’re interested and want to discuss any early ideas, reach out to us at: contact@linkpool.io

To conclude, this has been a long time in the making and as a team we thank everyone who’s been following and supporting LinkPool over time. I personally can’t believe it’s been over three years since our first article announcing the project, but it’s still so early and as a company we’re still growing extensively.

If this is the first time you’re reading about LinkPool, make sure to follow us on our social channels, and join us at our new Discourse forum to continue the discussion on our new token, platform, and features.

--

--