Spamming the PRIA airdrop list for fun and profit

I spent most of the day working on $PRIA related things today, mostly trying to figure out how to read data from the smart contract using Alchemy. I learned a lot.

I bought a few more tokens this morning to try and get back on the airdrop list, but I miscalculated the threshold and messed up. So I’ve decided to codify the calculations to figure out whether initiating a transfer will work as a way to cheaply accumulate the tokens. A transfer costs more gas than a standard Ethereum transfer call because of the airdrop code called by the function.

By checking the balance of the airdrop address each time it changes, one can estimate the airdrop amount. It’s roughly 1/200th of the total amount, and changes depending on the ratio of the airdrop wallet balance and the total market cap.

The next step involves estimating the gas needed for a transfer. I haven’t gotten this far, but it’s part of the web3 framework. I could also run a test transaction myself. Most of the transactions happening right now are interacting with the uniswap router, so it’s not accurate. Right now the floor seems to be about 400,000 wei, or about $3.51 in Eth.

In fact, as I write this, with the cost of PRIA just over two dollars, I could transfer the amount to myself, and potentially get back $0.50 worth of PRIA as a reward.

Of course, the tokenomics come into play here. I’d lose some PRIA on each transfer, increasing the burn amount with each transaction. Then I’d have to wait for another two hundred transactions to come through before I get my reward, before I can sell it. Then there’s also the question of selling.

I was able to put something together in a spreadsheet to figure things out. With the current burn rate, one can self-transfer the minimum amount of PRIA needed to qualify for the airdrop and spam one’s address to the payout list, taking up all 200 spots. A the current cycle, with the burn rate at 2.6% and about 600 PRIA in the airdrop pool, it will cost you less than six PRIA and drain the airdrop balance by roughly half. At this point one sits and waits for the next two hundred transactions, which which will payback at least 155 PRIA. This number is calculated on an additional 200 minimum qualifying transactions, which will continue to drain the airdrop balance.

The big problem though, is the gas fees. Spamming two hundred transactions will cost a lot. I calculated it as about two times as much Ether than the expected payout.

Of course, this is a dynamic system. Prices change, and everytime the system cycles through the airdrop list the burn rate changes. So, I’m in the process of building a script that can pull this data in real time and do the computations. Here’s the basic outline:

Monitor airdrop address for balance changes. This can be done with Alchemy's notify webhooks. 
Get the burn rate from contract
Get current current gas cost
Get PRIA price, either from Uniswap directly or via CoinGecko API
Calculate the wash trade costs (in PRIA) and expected payout
Estimate gas usage for transfer function
Compare gas fees to expected minimum payout. 
If profitable, execute 200 self-transfers
Wait for payout, then execute Uniswap exchange

There are several risks here.

First off, the calculation for the self-transfer needs to be perfect. If it’s too low, the payment won’t qualify for the airdrop list. If it’s too high, you’ll lose more than needed to the burn function.

Next, the gas calculations are tricky. PRIA transfers require much more gas than standard ERC20 token transfers, due to the airdrop system itself. Additionally there are rate adjust functions that are triggered on turn one of the airdrop cycle. And there’s additional functions that are called at the end of each turn when PRIA hits a floor or ceiling and swaps from burn to mint. I might be able to more accurately predict the fees. I could pull the gas costs from previous airdrop payout transactions, but I’m not sure if I could, filter out all the Uniswap interactions from those. More likely, I’ll need to deploy PRIA on an internal testnet, and spam the list for a couple cycles to take an average.

Then, there’s the risk that the price dumps before the next cycle completes. One could mitigate this risk by cycling the airdrop list for two whole cycles. It would increase the gas prices by double, plus an additional percentage that I haven’t calculated yet. Theoretically though, there is a point where the price of PRIA can get high enough, and gas prices low enough, that one could pay for such a double airdrop spam cycle, cover the cost by selling, then sit back and wait for the next two hundred transactions to trigger airdrop rewards at a profit.

That said, I have no idea how to do any of this. I’m trying to learn Javascript and web3 at the same time right now. I could use the Python library, but having a basic knowledge of how JS promises and async functions work is something I need to know. I’ve been able to pull data from the blockchain and have done some quick models in a spreadsheet, but there’s so much I have to figure out from there. I have a lot more questions that I have to figure out from a design standpoint, not to mention all the testing and data modeling that I can do from here.

And who’s to say even if I build it that we’ll even reach the point where this will work. PRIA’s less than a week old at this point, but I’m not sure if it’s ever going to reach the point where it’ll work, or whether it’ll peter off and die. All the work that I’m doing will be useful though, as the skills I’m using will make me a better engineer.

What if I could build something that could watch the blockchain, and when the moment’s right, fire off four hundred self transfers, take the resulting income and Uniswap it in one block. Wouldn’t that be glorious?

It might just work. Unless it gets frontrun.

PRIA: Ethereum game theory tokenomics

An interesting token experiment, called $PRIA, popped in my feed today. It was launched two days ago by an anon dev called Dr. Mantis operating under an operation called DeFi LABS. It’s described thus:

PRIA is a fully automated and decentralized digital asset that implements and manages a perpetual ultra-deflationary monetary policy favourable to inflation arbitrage by market participants.

Source: PRIA.network

Now that’s mouthful, what does it mean? I spent most of today going through the smart contract code to figure out exactly what’s going on, and also to make sure there’s nothing going on that isn’t supposed to be there. Here’s a rundown.

Tokenomics

PRIA’s supply is controlled by it’s smart contract. It starts at a ceiling of 100,000 tokens, and a percent is burned as part of each transfer. Eventually, the supply will reach a floor of 10,000, at which point a turn will have completed, and the process will reverse. The floor and ceilings will decrease each turn, until they bottom out at 12 and 1.25 PRIA tokens. This will complete the macro contraction, at which case it goes into an expansion phase, and back and forth ad infinitum.

Source: http://pria.eth.link/

The burn and mint percentages are adjusted for every transactions. The contract source code is below. (I’ve added some comments.)

def _rateadj() -> bool:
# Adjust each tx
    if self.isBurning == True:
        self.burn_pct += self.burn_pct / 10
        self.mint_pct += self.mint_pct / 10
        self.airdrop_pct += self.airdrop_pct / 10
        self.treasury_pct += self.treasury_pct / 10
    else:
        self.burn_pct -= self.burn_pct / 10
        self.mint_pct += self.mint_pct / 10
        self.airdrop_pct -= self.airdrop_pct / 10
        self.treasury_pct -= self.treasury_pct / 10

# Circuit breakers for individual rates 
    if self.burn_pct > self.onepct * 6:
        self.burn_pct -= self.onepct * 2

    if self.mint_pct > self.onepct * 6:
        self.mint_pct -= self.onepct * 2

    if self.airdrop_pct > self.onepct * 3:
        self.airdrop_pct -= self.onepct
    
    if self.treasury_pct > self.onepct * 3: 
        self.treasury_pct -= self.onepct

# Across the board reset if rates get too low. 
    if self.burn_pct < self.onepct or self.mint_pct < self.onepct or self.airdrop_pct < self.onepct/2:
        deciCalc: decimal = convert(10 ** self.decimals, decimal)
        self.mint_pct = convert(0.0125 * deciCalc, uint256)
        self.burn_pct = convert(0.0125 * deciCalc, uint256)
        self.airdrop_pct = convert(0.0085 * deciCalc, uint256)
        self.treasury_pct = convert(0.0050 * deciCalc, uint256)
    return True

Rewards

There’s another piece to this token, the airdrop. You’ll notice in the code above that there’s an airdrop rate. The contract’s transfer function contains code which subtracts or adds the burn/mint amount, minus the treasury and airdrop fees. Then airdropProcess is called.

@internal
def airdropProcess(_amount: uint256, _txorigin: address, _sender: address, _receiver: address) -> bool:
    self.minimum_for_airdrop = self._pctCalc_minusScale(self.balanceOf[self.airdrop_address], self.airdrop_threshold)
    if _amount >= self.minimum_for_airdrop:
        #checking if the sender is a contract address
        if _txorigin.is_contract == False:
            self.airdrop_address_toList = _txorigin
        else:
            if _sender.is_contract == True:
                self.airdrop_address_toList = _receiver
            else:
                self.airdrop_address_toList = _sender

        if self.firstrun == True:
            if self.airdropAddressCount < 199:
                self.airdropQualifiedAddresses[self.airdropAddressCount] = self.airdrop_address_toList
                self.airdropAddressCount += 1
            elif self.airdropAddressCount == 199:
                self.firstrun = False
                self.airdropQualifiedAddresses[self.airdropAddressCount] = self.airdrop_address_toList
                self.airdropAddressCount = 0
                self._airdrop()
                self.airdropAddressCount += 1
        else:
            if self.airdropAddressCount < 199:
                self._airdrop()
                self.airdropQualifiedAddresses[self.airdropAddressCount] = self.airdrop_address_toList
                self.airdropAddressCount += 1
            elif self.airdropAddressCount == 199:
                self._airdrop()
                self.airdropQualifiedAddresses[self.airdropAddressCount] = self.airdrop_address_toList
                self.airdropAddressCount = 0
    return True

What’s happening here first is a check whether the transaction amount meets the threshold, which is a percentage of the airdrop account balance. If true, sender’s, or receiver’s in the case of a contract interaction, address gets added to a list of two hundred approved addresses. Once this list is filled, the air drop process starts, and the first account on the list is rewarded with the actual airdrop.

In this implementation, the airdropAddressCount cycles to 199 and is reset to 0. Apparently Vyper doesn’t support queues.

@internal
def _airdrop() -> bool:
    onepct_supply: uint256 = self._pctCalc_minusScale(self.total_supply, self.onepct)
    split: uint256 = 0
    if self.balanceOf[self.airdrop_address] <= onepct_supply:
        split = self.balanceOf[self.airdrop_address] / 250
    elif self.balanceOf[self.airdrop_address] > onepct_supply*2:
        split = self.balanceOf[self.airdrop_address] / 180
    else:
        split = self.balanceOf[self.airdrop_address] / 220
    
    if self.balanceOf[self.airdrop_address] - split > 0:
        self.balanceOf[self.airdrop_address] -= split
        self.balanceOf[self.airdropQualifiedAddresses[self.airdropAddressCount]] += split
        self.lastTXtime[self.airdrop_address] = block.timestamp
        self.lastLT_TXtime[self.airdrop_address] = block.timestamp
        self.lastST_TXtime[self.airdrop_address] = block.timestamp
        log Transfer(self.airdrop_address, self.airdropQualifiedAddresses[self.airdropAddressCount], split)
    return True

What’s of note here is that the airdrop reward, the split, fluctuates, depending on the airdrop account balance as a percentage of total supply. The split is:

One percent or less: 1/250 the airdrop balance
One to two percent: 1/220
Two or higher: 1/180

Note that this is independent of the actual airdrop_pct that is subtracted from each transaction.

Assessment

It’s an interesting project from a game theory perspective. I’m not usually interested in stuff like this, but I saw it being shilled and wanted to take a look and see if I could tell what’s going on. This is not a full security audit by any means, but I couldn’t make heads or tails of the project description and needed to delve into the contract to fully understand it.

A couple notes:

The contract is written in Vyper, which is an updated Ethereum VM language. It’s considered safer than Solidity, and focuses on code readability. There’s a lot of safety checks.

It’s also important to note that PRIA is an iteration on a previous project from Dr. Mantis, called Galore. I’m not keen on the details, but apparently there was an exploit within that code. Galore holders (258 total) were granted 75% of all PRIA tokens at launch. The rest went into the PRIA-ETH Uniswap pool, although it only holds some 16,000 tokens.

There are also a number of manager functions written in to the code. A few of these relate to the Galore passlist, and there are some others that set the Uniswap router and factory addresses. The last two functions consist of a burn function, which allows the owner to decrease the total supply by an arbitrary amount, and a manager_killswitch, which removes all of the manager functionality. This last function is locked until this Saturday, midnight GMT, at which point anyone can call it.

It is extremely critical because PRIA has a built in penalty for inactive accounts, a burn system. If an account hasn’t made a transaction within 35 days, then someone can call this burn function and wipe 25% of the balance on the account. After sixty days, the entire balance can be burned. There are burn similar rules for contracts as well. According to the smart contract, the Uniswap addresses are exempt from this calculation. Also, the airdrop address can be burned after a week, but the project would likely be dead before this happens.


So there’s a breakdown of my look at the smart contract code. Again, I’m not a professional code auditor, so take this as it may. It looks solid, although I’m not a hundred percent on the Uniswap aspects of it. There’s a small community of people on Twitter that are interested in this project, but I’m not sure how much interest it will garner. It’s an interesting concept, for sure.

The rules are complex, and may appeal to some with an interest in game theory, and I have no idea what will happen once the we get near the supply floor and things get tight. The burn penalty may move things along a bit, but still, it could be a very long time for one of PRIA’s ultra cycles to complete.

Will we see interest from the rest of CT FOMOing into this at some point and driving the token up in the $100 range? Possibly, although I’m not ready to make any long-term predictions. This may be an interesting pocket change game, and I did pick up a few PRIA myself, just to see what happens. (Beware gas Uniswap gas fees…)

One thing I can say for sure is that there are probably a lot of early players who are doing statistical modeling as we speak to figure out how this will all play out, and it could be that the only winner from this game will be Dr. Mantis.

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)

Risks

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: Loanscan.io

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.

I can feel it.

I’m a bit overcome with the feeling that I haven’t been doing enough.

And it’s just silly.

I’m raising two kids, working a job on top of everything else. I’ve got a wife and a mortgage and got seventy thousand in student loan debt coming due next year. So what if I didn’t write a substack last month?

I do feel a bit guilty about it. More guilty that I spent most of my time today consuming content on Twitter and various news feeds than I do making my own. I spend more time learning than I do on acting on that knowledge. At what point will the pieces come together, I wonder, and will I be happy and relax for a day? When the kids are grown and I got FU money.

Saw a quote today: “invest your time, don’t spend it”. Well I definitely spent a lot of time this past week on stuff I didn’t need to.

I am so ready for a career change, but can’t imagine really getting the job I want, one that will give me the extra income I want and still allow me the time I need to keep the kids home and take care of them. Cause as hard as this is right now, I can’t imagine going back to the way it was. Younger is such a joy to behold, and Elder, she’s much more of a challenge, but she needs my help, and I still find it hard to imagine that we shipped them off to daycare for eight hours a day so that I could work.

I just can’t imagine going back to that.

So I’ll just have to create the job I want, and just keep learning everything I can. I just need to remember to find time to create. And I just need to keep honing the knife. I really believe that the next four years are going to be incredibly successful for crypto, and right now I’m trying to get everything as tight as can be for what’s about to happen.

Is this bull season?

I’m not living right.

I’ve been in a bit of a rut lately, and haven’t been very disciplined sticking to my habits. A month ago I was doing over a hundred pushups a day, wasn’t drinking on weeknights and was going to bed at 10PM every night to get lots of rest. Then I got a couple of neck and shoulder injuries, went on vacation and drank myself silly. Now I’m staying up till 12:30 at night, drinking and playing video games. It’s far time to get back in the swing of things.

I think selling the car has put me in a bit of a celebratory mood, or rather has put my finances in a bit of disequilibrium. I’m still waiting for the funds to go through, but it’s caused a bit of a cascade in the way I allocate my funds. My bank has a feature where I can set aside funds for various savings goals, bills and so forth, and so the way I’ve been operating has been to keep various buckets for my credit cards bills, mortgage payment and so forth. Before COVID it was a juggling act to fill the buckets before the bills were due.

Since pulling the kids out of daycare I’ve actually been able to get ahead of the game, and have been able to fill those buckets and start saving some money up. I forgot to schedule a credit card payment last week, so I decided I’d just start paying the bills as soon as the statements periods are over. I think it’s better this way, instead of trying to float the payments till the due date. It’s not like I’m gaining anything from the float.

Instead, I am going to try to seek as much yield with some of the funds spare funds sitting in cash. I’ve got to keep funds in stable coins as much as possible, given that we’re talking about money that I’ll need short term. It can either go in BlockFi, or I can try vaults or more riskier farming rewards. I’m not sold on earning governance tokens though, long term, I think a lot of them will drop.

And my indecision is being made worse by the market performance the last couple days. Things are on fire. My IRA has has three days in a row of four or five percent gains, mainly due to bitcoin’s performance over the weekend. Things were crazy today, and it’s even more exciting cause it feels like it’s just the beginning of things. I’m tempted to FOMO into BTC, and partially wondering if holding anything else is even a good idea right now.

Ultimately, I think I’m exposed enough. I put in a stink bid in case there’s a dip before I can move my fiat to DAI, but other than that I’m going to stick to my current plans. The only change I’m making is that I’m going to resume my dollar cost averaging into BTC. This is in addition to the amount that I’ve been buying every week for the girls.

I spent some time last night trying to clean up my yield farming sheet. I’m going to have to take a look at how some of these Yearn projects work so that I can copy their calculations. I need a way to track earmarked contributions into a common farm, tracking the percentage of contribution to the pool. If I have x + y USDC and wind up with z after three months, I need to know what the balance sheet looks like if I want to add more later on. I’ve got contributions in three or four different places right now, and getting data out is a bit difficult right now.

For example, if I pull GUSD out of BlockFi and push it into the Yearn BUSD vault, how can I track whether I was better off moving the funds or not? And tracking the value of BTC, wrapped and deposited to ycrvBTC is worth it?

Seems like there’s a lot of work to do. I think I almost know enough to cobble together some code to check the balance from a vault, but who knows how I go about with the conversions. We’ll see.

There’s work to be done.

Rainy Saturday

Today is a rainy day, my wife is out of town and I just dropped the girls off at their grandmother’s for a few hours, so I’ve got a bit of time to write.

Bitcoin has had a nice little pump over the last three days. The latest happened late last night. I was in the TD trollbox and everyone was really excited.

People think we’re at the start of a new bull run. I’m starting to feel a bit of FOMO myself, as if I wasn’t all-in already. I spent a good deal of time yesterday talking about bitcoin with a couple of friends, trying to explain what’s going on with QE and why bitcoin is going to succeed. I think I’m just drunk on my gains the last couple days. My IRA was up around four percent on Thursday and Friday thanks to $GBTC, $ETHE, $GDLC and some of the mining companies that I’m holding, like $RIOT. I also picked up a Canadian crypto broker called Voyager had a nice bounce as well.

It’s all thanks to Square picking up $50 million in BTC for their treasury. Now it’s all but certain that others are going to be following right behind them. Gradually, then all of a sudden, as they say.

I’m still managing to get some development time in. Trying to figure out how to use Truffle and working through the Ethernauts challenges. I’ve figured out how to exploit the contracts on my local Garanche node using a Javascript file, but now I have to figure out how to do that on Ropsten testnet. I can’t use the same scripts, since I have to hard code Ethernaut’s Ropsten addresses directly into the scripts.

I may still be able to use Metamask as my provider, but they’re going to stop injecting Web3 into the browser come early November, so now is probably a good time to learn how to use one of the other libraries via Infura orAlchemy.

There are a couple relevant developer conferences going on this month that I’m checking out. The first is ETHOnline’s hackathon. There are hours of talks to go through and catch up on. The other is the Substrate Developer conference, starting next week. Substrate is a blockchain development framework that has some integration with PolkaDot, which I’m very interested in. I’m also hoping to take a look at Solana at some point as well, but baby steps.

Other than that I’ve just been enjoying myself, playing video games. I’m still working through Detroit: Become Human, and have started playing through the original Baldur’s Gate. I also put Path of Exile back on my machine and have been playing through that.

And I keep continuing to learn Clair de Lune. I think I’m about a month into it right now, and have memorized the first intro section and have started working my way through a more challenging part. It’s beyond my playing ability, so I just keep drilling the parts through, hand separate, over and over and over. It’s crowding out the other songs I’ve learned in my brain. I tried to play through the repository of Bach pieces that I learned, and several parts just escaped my brain, just after a few days. I’m really having to drill them into my head.

I think it’ll pay off though, I know if I just keep practicing, I’ll be able to have it down in several month. I’ve only been playing seriously for about a year now, and this piece is really for someone with several years of playing under their hat. So I’m in no rush to get it done.

Trading notes

Today was a pretty good day for crypto markets.

Jack Dorsey, CEO of Twitter and Square, announced that Square bought $50 million of bitcoin, about one percent of Square’s treasury. Markets pumped, and my portfolio did pretty good, up 4.52%.

That puts me up 50% in $GLDC after a week! $ETHE is above water finally, after a month. I spent a good deal of time trying to refine my new trade plan calculator, to figure out how to protect my position. I need to protect my capital, but I don’t have a rule yet on how to do that. The TD Sequential was supposed to be my indicator for stepping my stops, but I’m beginning to wonder whether my strategy is sound.

My recent strategy has been a bit of knife catching, trying to open a position when it marks a ‘nine’ down on the TDSeq. I set my far enough below support lines that I don’t get taken out by some whale hunting stops, and then wait. Here’s the most perfect example of what I’m talking about.

The hypothesis is that seller exhaustion will spawn a turn around on the nine mark, and the price will move up. I got lucky here.

The question now is what to do. From a capital preservation standpoint, I should raise my stop above my entry point to make sure that I don’t lose money. This will also open up my capital for another trade, since I’ve already got six percent of my capital at risk. I could tighten the stop to just under my entry, which would have a lesser protective effect.

Or I could take profit. I’m not going to do this, however, as I’ve started noticing another trend off of these TD Sequential signals. I’ve noticed that breaking above a green sell signal can mark the start of a parabolic run. In the GDLC chart above, you’ll see the green dotted line coming from the left. We have a daily close above it, and then two days later… POW! Seven to thirty-six dollars in three days. GDLC is a bit of a bad one to use as an example though, as the pump lagged a similar movement in BTC by three days.

While I figure out my strategy, I’ve been working on my trading spreadsheet, incorporating some new tips I’ve learned with regard to some formulas. Hopefully it will make my planning process more coherent in the future.

I really feel that things are really close to popping off. The fundamentals of bitcoin are strong, and despite all the bad news that has been going on lately, the market has been holding strong. I’m trying to prepare for some crazy times coming up. We’re less than a month away from the election, and who knows how things could go at this point. The fact that BTC hasn’t taken a tumble these last few weeks is very, very bullish, and I can’t wait to see what happens next.

Evening page.

Today was pretty chill.

I had a couple task to do today for work, nothing that took too much of my time. I spent most of the day in front of my computer reading and doing research. I managed to spend some time poking around with the Alchemy.IO API, trying to explore contract events in anticipation of building some kind of monitoring or arbitrage bots.

Right now I’m mainly focused on trying to get some transparency with my own holdings. Zapper and the other DeFi dashboards don’t really support a lot of the meme-farms, so trying to keep an eye on things is a bit difficult.

I’m waiting on some large fiat deposits to come through the onramp so I can stake some USD stablecoins. Fulcrum has actually been near the top of the list; I’ve never dealt with them before. I’m actually considering converting to Dai, even with the slippage, just for the extra points. Harvest is actually getting about twice as much, although I don’t trust them as much. I have a small test stake on there right now, so I may put a larger stake on there. I’ve got multiple deposits coming through, so I’ll probably spread them out depending on what’s highest that day. We’ll see.

I had a productive session last night working on Ethernauts. It seems Ethereum development relies a lot on Javascript, so I’m delving into that for the first time in a while. I’m using a script to run my exploits, and involves manipulating the Web3 library. JS has a bit of a strange syntax with the callbacks and the way that things chain together, but I’m getting it without too much Googling. They’re more alike than they are different. At least on the surface anyways.

I made a good discovery today. Coingecko has an excellent API that I can now use to get my mining calculator back up and running. It’s a Google Sheet, and relied on the Cryptofinance module and a bunch of custom API functions that I had written for various exchanges, but the CryptoFinance module stopped working because of its reliance on CoinMarketCap. I’ve been unable to use the sheet for several weeks, but I was able to get it back up and running in about an hour today. Now I just need to get payments from my mining pool, but they only go back thirty days, so that’s another challenge. I have a hack for it using my minimum payout and the numbers of payments, which I can get off the API, so that’ll work as a crutch.

The Vice Presidential debates are tonight. I don’t know if I can stand to watch them, but I’m already drinking, so it’s either that or video games tonight. I’m not sure.

I can’t believe tomorrow is Thursday already. The days are flying by.

Life goes on

Sometimes it feels like my life is a never-ending battle against clutter. I’m sure anyone with kids can understand this. Trying to get them to pick up after themselves is a constant battle, all the more so since COVID. I often joke about the Tasmanian Devil, that whoever came up with it must have had kids.

Decluttering and minimizing seems to help. There’s always a relief that comes when we take a bag of donations to the local store, but somehow the kids keep accumulating things. Birthdays and Christmas, gifts from aunts and grandmothers. Most of my detritus is digital, but I still accumulate books, papers, and notebooks. Printouts of musical scores.

Any trying to maintain the house, ah, the joys of home-ownership. Our “dream house” has needed a new roof, new HVAC. The time the upstairs shower leaked and ruined the beautiful decorative dining room ceiling below it. The deck project is coming along but is less than halfway complete. That damn hot tub! We have a moisture problem in the crawlspace that will likely cost us several thousand to repair, and already Missus is dreaming about new windows and fixtures. And all the little things. Just yesterday someone closed the garage door on Younger’s new scooter, and it popped the bolt holding the door opener clean off! Just another card for the backlog.

It’s like playing one of those mostly unwinnable strategy turn based games where everything is falling apart around you, and you can only do so much each turn, watching as your spaceship slowly takes on more and more damage, and you lose one crew member, then another, and another, and before you know it you’ve got just one person left, damage all over the ship, and you know there’s no way for you to get through the next turn. Well, maybe it’s not as bad as that.

In fact, earlier today, I got a text from our quaranteam dad down the street that Elder had brought a bunch of stuff down from our house and was making some sort of mixture: glue, bug spray, fabric freshener, air freshener. I told Missus and she started freaking out, apparently she thought Elder was going to stumble across some sort of chlorine gas or something. I was more mad that she had just taken a bunch of our stuff over there without any regard for what belonged to her and what didn’t. I had to go down and call her back home, and there was a huge row, tantrum and everything.

I actually didn’t get much done today because of work. I configured a router for a client and actually drove out to install it. Four hours of honest work, plus a little more for some admin stuff. That’s comfortable. An hour and a half of it was commuting to the site and waiting on a tech over the phone. But that’s what I got my podcasts for.

I finished listening to one with Robert Breedlove, author of Masters and Slaves of Money. It’s along the lines of The Bitcoin Standard, full of libertarian ideals and Austrian economics. This guy isn’t insufferable like Safedian Ammous, he merely worships Jordan Peterson instead of Nouriel Roubini. (We really need more leftists in the space.)

I also started listening to an Unchained episode about Solana and Project Serum, which is a high throughput layer one blockchain and the DEX built on top of it. It’s a very interesting engineering project, they’re hoping to provide a decentralized platform that can scale and eventually supplant Visa. I wish them luck. They’re designing the system for hardware two years out, and I’ve looked at the requirements for validator nodes. It’s pretty steep, you’re talking hundreds of dollars a month for an AWS instance. (They need GPUs.) And the staking requirements for a validator is in the millions of dollars. They aren’t building for consumers, but for enterprise. Well see how it goes.

For now, I’m going to curl up on the couch and watch Last Week Tonight, then go spend some time on Ethernauts. I spent most of last night messing with my environment. The contracts are for Solidity 0.5.0, and one of the challenges relies on vulnerabilities that were supplanted in Solidity 0.6.0. So I’ve got that working now, as well as Metamask tied into my Truffle/Ganache setup. Now hopefully I can figure out how to test my exploits on my local node, then switch over to Ropsten and deploy it again. Previously I was doing testing in my VM and then trying to deploy code via Remix, which was not a good flow.

At some point I’ll start working through these two Medium articles and figure out how to start querying and interacting with DeFi contracts directly.

Web3 development

Yesterday we had a party for Elder, since we were out of town for her birthday. Our quranteam came over, so all the kids were running around the backyard while we ate pizza and wings, and drank the latest batch of my homebrew. Missus even got me to break out my guitar and I spent a good hour playing and singing at the top of my lungs. It was good times.

I keep partying after the kids went to bed, and played video games until well after midnight. I paid for it this morning. There wasn’t much cleanup left to do from the party, but I wasn’t productive in the AM. I didn’t get much work done for Zombie, I pretty much just checked in with Boss and spent the rest of the morning looking at markets and reading.

I wound up buying an IXL subscription for Younger, and we spent some time working through some of that.

I decided to take a look at Flutter, and worked through the entire tutorial. It’s a very interesting project, like React, that allows you to create one project that will render on IOS, Android and the web. It’s pretty neat. I’m not sure how I feel about Dart yet, but I’ll probably dive into more later. The whole ecosystem is pretty interesting; Material probably deserves a closer look at some point also.

I’ve got to be careful though, cause I feel like my backlog is gonna quickly get swamped up at the rate I’m going. I also ran across Alchemy, which is a development platform for Ethereum, and I feel like I’m going to be spending a lot of time with that very soon.

It seems like there’s a whole lot of things to be built in the DeFi ecosystem, so having a good understanding of how to interact with smart contracts is going to be instrumental, as is being able to build dashboards like what Zapper and others are doing. I’m really going to have to have my work cut out for me. I love Python, but I’m going to have to work with some of these other languages if I want to be a world-class developer.

Tonight I think I’m going to spend some time working on Ethernauts. I need to make some adjustments to my Solidity workflow to make things work a little better, and it should give a better understanding how to interact with Ethereum programmatically.