How to yield farm LINK using Yearn Vaults

A couple of inquiries came up to a reply I made on Twitter about yield farming Chainlink‘s $LINK token, so I wanted to write this up a quick guide for people who are holding LINK and want to increase their holdings.

I was fortunate enough to get in on the ChainLink ICO during what seems like an eternity ago, and I’ve been holding ever since. It’s turned into one of my best performing assets. ChainLink serves as an on/off ramp for Ethereum and other blockchains, functioning as an oracle for real-world data and payment. Any input to any output, as they say on their home page.

$LINK Chart. I recently added to my position after this last pullback.

What is this DeFi stuff?

For those who are unfamiliar or new to DeFi, what we’re doing here is basically lending our LINK to Aave in exchange for a liquidity token, aLINK. Aave lends the LINK out to other borrowers, and lending fees are then distributed back to the pool, and gains are distributed to the lenders. Borrowers are required to over-collateralize their loan, meaning that in order to borrow LINK they will have to provide ETH or other asset worth more than what they are borrowing. If the underlying asset value drops in price due to the price spread between the borrowed asset and the collateral increasing, then the borrower is at risk of being liquidated, which means that they forfeit their collateral. This process is a bit more complicated than that, but it insures that the lent assets are recovered to the pool. There is also what’s called a “flash loan”, where assets are lent and returned to the pool within a single block.

As borrowing fees accumulate in the pool, it increases the value of the liquidity tokens. Liquidity providers (LPs) collect these returns based on their percentage of the pool’s total assets, as well as trading volume. In addition to the yield in the base asset, LPs are sometimes rewarded with governance tokens in the lending protocol or platform, in this case $AAVE. These governance tokens can have their own value, but must be claimed via interacting with a smart contract.

What the Yearn vault does is pools these aLINK tokens. By depositing your aLINK in Yearn’s vault, you receive a yaLINK token. Each time a user interacts with the contract, either via deposit or withdrawal, the gas they provide is used to claim all of the $AAVE tokens that the vault is entitled to and then execute the strategy that it has set. This strategy could be as simple as selling the accumulated $AAVE, buying more $LINK, staking it for aLINK and depositing it back in the vault. Or there may be more complicated leveraging going on. The strategy can change depending on what’s providing the best value, and is automatically executed each time someone enters or exits the vault. If you’re interested in the actual strategy being used, I suggest you head over to the Yearn.Finance documentation and pop into their Discord.

Other strategies may involve leveraging platforms such as Curve, so just keep this in mind before you go risking anything more than you can afford to lose.

Current yaLINK vault yields, three day average (10/14/2020)
Current yaLINK vault yields, one month average (10/14/2020)


What are the risks? Namely, it all comes down to smart contract failure. DeFi has seen a number of rug-pulls lately, not to mention untested, unaudited contracts being deployed and failing spectacularly, but I don’t hold Aave and Yearn in this regard. According to DeFi Pulse, Aave currently has just under $1.25 billion locked, which makes it quite the honeypot. They’ve been around since January of this year, which is ancient history in the DeFi space, and they have a number of audits on their contracts.

Risk is further compounded by an additional layer through yearn. If you’ve ever watched The Big Short, we’re basically talking about a derivative of a derivative at this point. Yearn has around half a billion dollars under lock currently, and only launched in July. Audits for the project are available, but do not prove that the system is secure.

In fact, Yearn developer Andre Cronje is a bit of a controversial figure right now due to his propensity to deploy experiments to the Ethereum mainnet. Thankfully, governance of Yearn has been handed off to the Yearn community.

There’s also the risk that the yield will decrease. If you look at the two pictures above, you’ll see that the growth rate fluctuates quite a bit depending on the timeframe that you’re looking at. I believe that this depends mainly on the underlying asset performance, so your yield is likely to be higher when LINK is performing. One of the main goals of the Yearn Vaults is that you will never wind up with less of your asset than you started with, so if you are planning on hodling, this is probably the place for you.

Tax Ramifications

A quick note for US residents. Lending your LINK, or any other asset in the way we describe is likely considered a taxable event, and I’m treating it as one personally. I’m not a tax accountant, but from what I have read, if you provide custody of an asset to a third party and they lend it out, it is is considered a sale.

ETH fees and position size

Here is where I got tripped up. Interacting with these contracts cost a lot of gas, and you have to keep this in mind when you move in and out of these lending platforms and farms. In fact, one of Yearn’s main use cases was to spread reduce the cost for users to move their funds from whichever platform was offering the best rate, so you’ll pay a lot to move in an out. You’re basically rebalancing the entire vault when you do.

And gas fees were very high a few weeks ago, with some people paying over $100 in ETH to get some of their transactions through. Things are less crazy right now, so you’re looking more along the lines off $15 or so to use Zapper as I describe below.

That said, plan ahead!

If you’ve got less than a thousand dollars to lend or stake, then you may want to reconsider. I also recommend that you plan on leaving your funds in the vault for the long term, weeks, or months. Performance may vary greatly from week, to week, so And make sure you keep enough ETH in your wallet to withdraw your funds when the time comes.

Current LINK lending APR rates (10/14/2020) Source:

Rates can fluctuate quite a bit from day to day, so have strong hands and resist the urge to move funds around to make a higher yield. Unless you’re dealing with five-digit sums (lucky you!) your gains will quickly get eaten up by transaction fees.

How to use Zapper.Fi

Ok, so if you made it this far, you’ll want to head over to Zapper.Fi, click on Invest, and search for LINK vault. In addition to the yaLINK vault, you’ll see other liquidity pools such as those on Uniswap and Balancer. Both of these platforms are automated market makers, (AMM) which are basically decentralized exchanges for the various assets. Simply put you provide multiple assets to a pool, such as LINK and ETH, and the pools allow trades between the two, with the fees going to the LPs. Normally, you would have to provide equal amounts of both assets to stake in these pools, but Zapper takes care of the heavy work and will manually convert the proper amount of one asset into the other, stake both, and provide you with the liquidity tokens.

LINK related pools available throuh Zapper

In the case of the yaLINK vault, it will stake your LINK tokens on Aave, then stake the resulting aLINK tokens in the vault, all in one transaction.

Well, almost one transaction.

You’ll still need two transactions to interact with Zapper, which is still less than going through both Aave and Yearn. The first thing you have to do is approve the Zapper contract the ability to spend your LINK tokens. This is the cheap part. Last night it only cost me $0.75 to approve the first transaction. One thing you will want to look out for at this point, as well as with any interaction with a smart contract, is adjust the approval amount on the transaction. Usually these platforms will default to unlimited approval amounts, meaning that they will theoretically have the ability to spend any all all LINK that you have or will have in your wallet. As a precaution, as as a good habit, I recommend that you edit this amount in Metamask or your wallet to equal the amount that you plan on staking. It may cost you a bit more in gas in the long run, but is a best practice from a security standpoint.

After the approval has been submitted to the blockchain, the next step is the actual confirmation. This is where the gas fees will really hit you and make you do a double take. At this point you’re basically funding a transaction to interact with both Aave and Yearn, so the fees are pretty steep. Last night this was only a reasonable $15 for me, but four weeks ago when gas prices skyrocketed due to the Uniswap governance token airdrop, I remember it being much, much higher.

When you’re ready to pull your funds out, it’s just a matter of hitting withdrawal, selecting your preferred payout asset, and confirming a single transaction. From my testing, it appears to be much less than they entry cost, gas wise.

And another note about Zapper that is worth mentioning. You don’t actually need LINK to participate. You can deposit ETH, USDC, Tether, DAI, or WBTC in addition to LINK. All the conversions are managed automatically.

Zapper is a superb tool for DeFi, and one that I use almost every day to check the value of my wallet assets, and stakes and lending across multiple platforms and wallets. If you’re holdings. They’re great.

And that’s just a quick look at how to get started with Yearn vaults. DeFi is one of the most exciting parts of the crypto space, and I hope you find this article useful. If so, please share it with your network, and feel free to leave a comment or @ me on Twitter if you have any additional questions. As always, this is not financial advice, and don’t risk what you can’t afford to lose.

Bad Omens

I had a dream last night that I set my laptop on fire. Not like the battery got hot and it lit up kind of fire, but I intentionally set it on fire. Okay, maybe the fact that it went up in flames was an accident, but I was definitely doing something I wasn’t supposed to. I was more at a loss for the physical value of the hardware than anything on it, but still, I was relieved when the “I’m dreaming” realization came through.

I found myself thinking about this Tweet this morning, and what type of technical skills are needed to pull something off like that. My brokerage bot is just a simple API call application; I definitely need to figure out how to consume websockets to be able to do real-time stuff like this. Being able to watch order books and place or cancel orders in response to changes will really up my game.

As far as the Ethereum aspect of this goes, I’m not sure if you would have to run your own node or if something like this could be done on an Infura node. Not sure whether he’s watching the mempool or just following transactions on the network.

It’s the first of the month, which means I need to get cracking on some things: moving money from the kids Lending Club accounts over to their BlockFi. I think I’ll make rebalancing my DeFi vaults a quarterly affair, I don’t have enough to warrant the gas fees for smaller amounts. I will be making a withdrawal from my BlockFi and putting it on the exchange. I missed some trades that I wanted to take since I had vaulted my funds earlier.

I really need a dashboard to track my gains. Zapper doesn’t seem to be very accurate, although yEarn does let me see the monthly performance, in fact, every time I check their page they’ve made updates to their UI to provide more information. It’s still a pain that I have two wallet addresses that I’m using on it. Maybe there’s a way to transfer the vault balance? I’m guessing no since I’m staking a token. The balances are probably stored in an array and can’t be transfered.

I’ve obviously got a lot of work to do with Ethereum and smart contracts. I really love this kind of work, learning programming languages and building stuff. Too bad my regular job is all filled up with bullshit like fixing crashing laptops. My boss actually told me “don’t drop your sugar at the door” in response to me offering a technical next-step in response to one of these problems. I literally said that they needed to update the driver package on their Surface laptop. That is not my sugar. Boss has no idea what it I can do. He’s still locked into the stuff we were doing when we started eight years ago and hasn’t grown since. I’ve tried to tell him about the opportunities and he hasn’t popped out of this small business mindset. Sigh.

I feel like Zombie, LLC will be stuck with small-time players who are looking for technical support. We’ve got a few good managed services clients, but we’ve got no sales team, and the fact that Boss is unable to lead us as a team has left me completely disillusioned. Things will not change. I was listening to ILtB and someone said “if you take the best player on a high school team and you let them practice with a college team, they’re going to get better. They’re going to run faster than they thought possible.”

I’ve outgrown this team, and I need to find a better one.