Uniswap Day

Heaven forbid you actually needed to use Ethereum yesterday

I was all ready to take the plunge yesterday and had moved a large portion of my BTC to wBTC. I just needed a bit more ETH to pay the gas fees for the zap into the vault. I set up a tx between my test wallet and my main wallet, with an average gas cost around 119 gwei. Metamask estimated a two minute transaction time, but after five went by I started looking at the gas costs. “Slow” was now 140 gwei. So I resubmitted the transaction. Five more minutes, then gas was up to 175. What the hell was going on?

Things kept escalating over the next hour, reaching 400-500 gwei. Something was happening. Etherscan’s gas tracker showed Uniswap’s router taking about a quarter of the available gas on the network. That wasn’t too unusual, it’d been up there for some time. So I decided to go on Twitter to see what was going on.

It didn’t take long to figure out what was going on. Uniswap had airdropped their governance token, UNI, into the hands of everyone that had used their service. At least four hundred UNI tokens were available to be claimed by everyone who had ever used Uniswap to make a trade, more, I’m sure, went out to LPs. Ethereum was clogged up with people trying to claim the tokens. Binance had already added UNI to their exchange.

Those tokens were worth twelve to fifteen hundred dollars last night, and are currently trading at about a grand. Unfortunately, the cost to claim and swap them is exorbitantly high right now, as gas pices are still well over 600 gwei.

It’s apparent that this trend will continue with Ethereum for the near future, as gas prices continue to rise, forcing small player out of the market. After all, what’s the use of trying to move around <$1000 amounts of ETH or other tokens if you’re paying $100 in gas for the privilege. That said, it will be likely that Ethereum will wind up being the chain for large financial operations, with other, smaller projects being forced off to side chains or competing projects.

With that in mind, I spent some time earlier today doing some research into Polkadot, looking at toward running a validator node, or even doing some smart contract coding on it as well. It’s an interesting project, but the cost of running a validator node and learning Rust will have to go on the backlog for now.

For today, I’m just watching equities markets get crushed and considering whether to buy some more ETHE. It’s holding steady today while everything else tanks, and I don’t have enough that I need to worry about setting stops on my position yet. The premium is sitting at this level, so I may

Crypto markets are mostly green. Haven is back up today, so I’m swapping out to xUSD a bit at a time. I’m still watching CELO, although I don’t have any capital free right now to grab any.

So for now, I’m stuck with transactions in mempool, so I’ll just wait a couple days, and hopefully things will calm down enough for me to get my funds moved into Yearn.

At the top of the diving board

DeFi is completely insane and massively complex.

I’m about to load up the yEarn valut with some wrapped BTC, and am planning on staking about twenty percent of assets under management. This is almost insanely risky, but I believe that of all the projects in DeFi, the one I’m picking carries the least amount of risk.

We’re putting our faith in several assumptions.

  • The wBTC protocol is secure, and that the BTC that we put in there will be safe when we decide to withdraw.
  • The Curve protocol is secure, and that the smart contracts are safe. Of course, there’s a ton of assumptions nested here as well, including the other tokens in the pool, renBTC and sBTC.
  • That the Yearn valut is secure, and that they know what the hell they’re doing.

Anyways, I must be insane.

I’ve got two out of three withdrawals out of BlockFi. I decided to use exchange funds instead of paying their thirty dollar fee to make another withdrawal. (I burned my freebie on a test tx.) I put in an order to convert BTC to wBTC, and that took all night to trade at an even price. After that completed I put in a text tx to my Etherum address, and then sent a max withdrawal after that cleared.

Now that those funds are sitting safely in my wallet, I have to choose whether to go ahead and proceed with loading the vault, or if I want to convert the rest of my BTC first. I think that’s wise. I feel like quibbling over the gas fee is probably stupid considering the size of the position here, but every bit will count in the long run.

If this works out, assuming that everything is safe and that my deposit grows at the respectable forty percent that I think it will, this could be one of the most significant, life changing decisions that I’ve made since getting involved with crypto.

We’ll give it three months and see.

Evening notes

Trade plan programming

I’ve been working on my trade planning Python module the last couple days, and already the project is becoming rather complex. I say it’s a trade plan module, but really it’s a capital preservation ‘brake’, if you will.

The basic idea behind the module is like this:

  • Get balance list and filter empty ones.
  • Get last symbol/BTC market price.
  • Calculate total BTC value of all holdings.
  • Get open orders for each market. For each, look for limit orders, and calculate the covered/uncovered amount in BTC.
  • Make sure that no uncovered position accounts for more than two percent of total portfolio value, and that no more than six percent of the portfolio value is uncovered. If they are, do not allow any additional buys.

The last couple days I’ve been slowly working through everything, following a strict TDD methodology to make sure the code is covered, monkeypatching and mocking calls and creating fixtures for the exchange data. Now I’m getting to the point where I don’t know how to proceed, and I’m getting frustrated.

I don’t know where the problem arises in times like these, but I have a feeling it comes from lack of proper planning. I start out with a few procedural calls, then I get to a certain point of complexity where I have to start refactoring classes. Or I don’t know what to do next, and so I cobble come code together without writing a unit test first, and start breaking my flow.

All I can do at times like this is take a break.

Binance token mooning

Binance token has been on a bit of a tear the last few days. Apparently they’ve launched their own EVM compatible Binance Smart Chain, and are hoping to go after the DeFi space. Good luck to them.

I took a look at the validator instructions earlier to price out the cost of being one. It costs 10,000 BNB tokens, or about 300 BTC ($3 million), and about $244/month in AWS costs. That’s still a magnitude cheaper than running a $30 million Serum DEX node, but shows the type of centralization that we’re going to be seeing with these projects. I’ll keep running my puny IDEX node, and work toward my 32 ETH so I can run a Ethereum 2.0 node.

I’ve actually been holding my BNB tokens for two years, and they just actually touched my cost basis after spending so much time underwater. Since I’m actually trying to follow my capital preservation rules, I’ve had to put a tight stop on this latest run. I’ll have to figure out how to account for entry cost in my trade plan program, as now I’m just looking at the percentage of total. This may not work well when things start mooning and I have to recalculate on the run-up.

Jumping into the DeFi deep-end

I’ve decided that the opportunity cost for keeping my funds in BlockFi is just too great, and I’ve initiated some withdrawals. I’ll be putting the entirety of the funds set aside for my kids into the sBTC vault later this week, for a modest 40% APY. I must have stared at the withdrawal screen for five minutes before I could push the submit button. I must have read the wallet address over and over three or four times to make sure they were right.

It’s stressful, being your own bank.

Anyways, I’ve still made no decision on my cold storage funds. I’m risking way more than two percent on this vault, and any more would be irresponsible.

Famous last words.

Getting ideas

I spent some time coding Friday night, trying to update my trade plan script. It’s been a long time since I used it, and it doesn’t work anymore since it relied on the CoinmarketCap API to do lookups. So I’m starting from scratch.

Using the CCXT Python module to get my estimated balances off the exchanges is a bit more difficult than I had imagined. I can get the balances themselves, and then have to do some conversions using the last trade price in BTC. That’s a far as I got earlier. The next step is to do map limit orders against the positions to determine capital at risk, then I can start working on the trade plans themselves. I want the module to refuse to purchase if more than six percent of funds are at risk.

I’ve also decided to start moving funds from BlockFi over to Yearn’s sBTC vault. I did a test transaction last week, and I think it’s trustworthy enough to start moving things over. I still want to take a look at the contract code and see if I can make any sense of it, and there’s one other thing I need to figure out first.

I’ve allocated funds to my kids, and are holding some funds for my family members. I want to pool all these funds together, since moving funds in and out of the vaults takes a good amount of gas, and I want to minimize this as much as possible. Basically I’ll be farming USDC and BTC via the yCRV and sBTC vauts on yEarn, respectively, I just need to figure out how to track the amounts of assets from each individual.

I haven’t thought too much about this yet, but my preliminary idea is that I can use some sort of token to track contributions. Tokens will be minted or burned depending on how much someone contributes to the pool. But how to send those pooled funds to where they need to go?

I’m assuming that the yEarn vaults themselves use some sort of strategy contract to control what happens each time someone contributes. But in this case, I want to be able to control the funds myself. It seems, though, that funds would come in, I deploy them, and voila! But no. It’s going to be more complicated than that.

If I’m managing funds for four or five individuals, I’ll still have to manage wallets for each of them. I don’t think that this can be done with a simple spreadsheet, it’ll have to be tracked in a database of some type. Maybe I could build my own local contract to track it. We’ll see.

I’ll be looking over the Zapper and yEarn docs to see how I can interact with their contracts directly. I don’t necessarily want my contract to be on mainnet right now cause of gas transactions, this is why off-chain and side-chain projects were created in the first place, yes? Maybe I’m overthinking this.

I would need pools for each type of asset, so it could be a one-for-one token exchange. Tracking the value of the vault is where I’m stuck. I’m not sure how Zapper does it, so I have some more research to do.

While I think about all this, I’m also busy getting my Haven node spun back up. The vault is implemented, so it looks like I can move out of XHV into USD without involving an exchange. This will allow me some bit of trade leverage without having to deal with Bittrex for now. It just looks like it’s going to take a week for my node to sync up.

Week end report.

Today was a quiet day.

There wasn’t a lot of activity today. The markets were relatively flat, and I didn’t do much besides my day job. Most interesting part of that was doing some more work on setting up the environment for the Texas Instruments DSP compiler, which is part of my CI/CD pipeline project. I’ve still got a lot of work to do there, but professionally speaking, I’m not certain how much effort I want to spend on that given developments in fintech.

I finished recovering my Monero wallets and moved my funds to a light wallet, then it was on to repeating the process with Haven, which has been mooning the past few days. Unfortunately, the precompiled Linux executable won’t run on Ubuntu 18 because of GNU Library incompatibilities, and the Docker build failed also. I’m not sure how much time I want to devote to getting that together right now, given that I have to KYC with Bittrex to trade any of it.

My mining tracker needs some serious rework, since half of the pricing APIs are broken so I have to manually update everything. I should work on it tonight but I’d rather play video games. Priorities. Seriously though I may have to work on something tonight. I’ve got lots of work I want to do with the CCXT library and trade plans, so I might as well just bite the bullet and get started with it.

No trades or other on-chain activity. I’m leaning wrapping some BTC and sending it into the Yearn vault, but I’ll probably give it a few more days first while I work on other things.

Patience.

DeFi notes

I did quite a bit of reading today, I’ll share a few things I picked up relating to crypto and DeFi. I’m still trying to wrap my mind around it enough to the point where I can write a couple thousand words on it for my Substack, but for right now I still feel like I’m in the research phase.

DeFi is crypto’s latest craze, and it may soon challenge traditional banks – A good primer about DeFi and what’s going on in the traditional monetary systems.

Bitcoin of DeFi – about Yearn.Finance, covers the various sections of it as well as some of the background on it. Andre Cronje started it for his family and friends and codified it and released it to the public. Brilliant.

The Revolution You’ve Been Awaiting: Fintech + DeFi – Alternate title: “Software Robots and Automated Workflows”. Interesting read.

Guy Makes $250,000 a Day Yield Farming on Ethereum – Yes, but he started with $8.1 million ETH. I did take a look at the portfolio on Debank. $8m in Sushi swap, $4m in Swerve, and less in Compound and Balancer. Might pick up some SWRV just in case. Apparently I’m inadvertently staking there through Harvest USDC pool.

3 Rules for Healthy Pseudonymous Hygiene with Ethereum – With all this activity going on I’ve caught myself slipping a bit with my activities. I inadvertently shared a ETH tx with someone yesterday while I was depositing into Yearn yesterday, and now I consider that address burned, so to speak. I’ve got to be careful not to cross streams, so to speak, if I’m going to keep things clean.

And speaking of privacy…

The IRS is Offering $625,000 to Crack Monero – You bet they are. I’ve dealt with Cryptonote quite a bit, and it’s built on some solid math. Privacy tokens are the real thing, and Monero’s probably the oldest and most popular. I don’t see this happening anytime soon.

Getting serious about crypto yields

I’m a degen now.

I finally took the plunge, after a couple of test runs with Yearn, Sushi, and Harvest, and finally dumped a significant amount of capital into yield farming. Bankless published an excellent guide that I read this morning, and since the yETH pool is still closed, I decided to dump my stash of USDC tokens into Curve’s sBTC pool, and then staked it on Yearn where it’s now gaining upwards of forty percent ROI. We shall see.

The entire process was relatively painless considering the stress I went through with my previous forays. Zapper made the process even more so. It did most of the heavy lifting to get my Curve tokens, then I just had to stake them on Yearn, which was another step. And the gas used was only about half of what I was expecting, so yay.

Time will tell how long this DeFi madness can go on. I’ll probably take a breather for a bit and watch what happens. This feels like a pretty big step but I don’t want to go crazy right off the bat. I’m still reading through Mastering Ethereum, and it’s obvious that I’ve got a long ways to go toward understanding how all this stuff works, so I’ll just take it easy and get into it the same way I did with crypto: slowly.

There’s a first mover/early bird advantage to these markets, but I shouldn’t expect to keep getting lucky. Capital preservation is the name of the game. I’ve been so focused on it lately, and have been very aggressive with my equities positions. In addition to Overstock last week, I also had Tesla and NVidia stop out on me this week, so I’ve got a lot of cash available in my retirement account that I can deploy on more speculative bets. (Like I haven’t dumped enough on mining companies already…)

I’m continuing my value average program, but have also put stops on some of the ones that are running hot. Take profits. Hopefully that won’t come back to bite me if we actually get inflation. I’m just waiting for a broader pullback.

I’m keeping an eye on the ETHE premium. I’ve opened a small position, set some stink bids, and will scale in as I can while protecting my capital. The last week or has seen some crazy runs, I swear I must have gone up thirty percent and down fifteen in the last month. It’s insane.

If I’m going to make a living out of this then I need to keep calm and remember how to protect my positions. My equities trades are tax-exempt, but my crypto gains are going to be taxed like hell if I make any big moves. So far I’ve avoided liability, since my trades have been at a loss, and I haven’t opened any positions that have required stops yet. We’ll just wait for the market, buy low and ride it high.

Blood in the streets

Markets continued to tank today. So, we learn.

Seems like everything was in the red today. I didn’t take a lot of time looking at the markets today, but it seems that everything was down significantly. $BTC broke below $10K, and took everything with it, it seems.

The losses that got stopped out in the last week or two, like $BAT and $CVC, were actually good in that they preserved some capital. And since I only deployed two percent on the other orders I placed, I’ve managed to avoid taking losses on $ZEN and $SOL. I’m still waiting for my COSMOS/$ATOM order to hit, and if Aave’s $LEND token has another flat day I may pick up some of that as well when it hits a nine on the TD Sequential.

I’m also keeping an eye on the IDEX-ETH price. If it spikes I may trade some; I’m still open to the possibility of providing liquidity on Uniswap. We’ll see.

I read a lot of Mastering Ethereum. The cryptography chapter managed to put me back to sleep this morning, but I’m actually getting to the smart contract part and am looking forward to trying my hand at Ethernaut right after I get done with this. I’m really looking forward to writing some programs to watch what happens with these liquidity pools.

Should be fun.

Liquidity

Spent some time today delving into Uniswap. Here’s a couple of posts that have some good information:

Understanding Uniswap Returns

An Introduction to Automated Market Makers

I had a bit of a flash this morning that I should probably start exiting my IDEX position into ETH, specifically the yETH pool, but it turns out that Yearn has halted deposits on the pool. I’m glad i got my little test deposits in when I did.

Still, I was looking at the best way to exchange my tokens. On IDEX, obviously, but I have never actually used them since they implemented accounts, so I can’t trade there as of now. Binance has trade pairs to BTC, but that would involve another trade. Then of course, there’s Uniswap, so I took a look and found an IDEX-ETH trading pool.

The liquidity here is not very impressive. And I saw an opportunity for me to provide some, although I still don’t understand how the assets in the pool are being staked together. I would assume that the pool would need to be 1:1 in value between the pairs, but it actually looks to be about 1:2, as far as the USD value of IDEX-ETH. And I’m not going to put any more capital at risk until I understand what this “divergence loss” is and how I can keep from being affected by it.

I also spent some time looking for arbitrage opportunities. There was a bit of a price divergence between the IDEX exchange price and the Uniswap price, but the liquidity is so low that trying to take a large order would eat the price divergence back to par, and dealing with low amounts would have caused any profits to have been eaten up by gas fees.

So for now, I’ll take no action while I wait for a bit of a price recovery on IDEX and explore other opportunities. I’ve given up trying to get the Monero blockchain running locally, and have it syncing in a cloud server. What was taking over a week with my SATA stripe array looks like it’ll take a few hours on cloud.

Other than that, I’ll be working through Mastering Ethereum, trying to understand these smart contracts, and hopefully figure out how these smart contracts work, how to design my own, and how to build programs to interact with them.

Black Thursday

Today was a good day, unless you count what happened in the markets.

This morning actually started out pretty good. My four-year old slept in her bed for the first time ever, and both my wife and I had the best night’s sleep in a long time. Everything was pretty calm around here and I managed to get a lot done.

Bitcoin took a huge dump today, but so did most of my equities positions as well. I was actually pretty calm about it, as I had some stops trigger over the last couple days, so I’ve got my bigger positions protected. I even picked up some more Grayscale Ethereum Trust, $ETHE, as the premium held, and DeFi isn’t going away anytime soon. I was actually pretty calm about it. Staircase up, elevator down.

I had a couple stops set on $ICX and $LISK from last week, it looks like both of them triggered, but neither of my recent buys hit my stops, so that’s good. I picked up some $ALGO today as well, and Cosmos, $ATOM, just hit a nine on the TD Sequential, so I’m probably going to market buy some of that as soon as I get done writing.

I did spend some time fretting about my USDC holdings which are currently just sitting in my wallet. I’m half tempted to dump them in Yearn, but with the gas costs I’m probably just better off dumping it back in BlockFi. I am however, at total risk of becoming a degen and dumping my entire ETH holdings in the new yETH vault, with it’s shiny 99% APR. Thankfully I missed the withdrawal window to get my funds out of BlockFi until Tuesday at the earliest. Waiting is probably a good thing right now, so I’ll do nothing.

I spent some time reading over the Ethereum yellow paper today, and I plan on spending the rest of the evening Mastering Ethereum as it were. I want to be able to read these contracts and understand exactly what they’re doing before I go and do anything stupid.

And I’m really feeling the urge to do something stupid. I got a notification from my student loan issuer yesterday. The debt forgiveness has been extended until January 2021, so I don’t have any debt or interest to worry about till then. But I have an extra $600 a month that will be coming due then, and that is going to be a real big problem for me unless I take another job — or choose one of the other payment plans. The possibility of raking in some of that sweet, sweet, yield farming money is looking really, really good right now. If I was willing to dump all of my BTC into ETH and stake it, I could pretty much retire right now.

I know it won’t last for long, and I would rue the day I was born if I did something like that and lost everything to something like a contract failure or exit scam. I’m taking it real easy right now, and trying not to get caught up in some stupidity.

At least for now.