Showing posts with label Econ. Show all posts
Showing posts with label Econ. Show all posts

Wednesday, April 1, 2020

What is DAI Stablecoin Cryptocurrency and Thoughts on Trading DAI


To my surprise, Wikipedia doesn't have an article on the DAI cryptocurrency itself, but just on the organization that oversees it (link). DAI is an Ethereum token that can be stored in a cold storage wallet (link) or holding it via an exchange (link). Moreover, it has a "decentralized finance" application using the Ethereum blockchain -- a way to borrow "money". This post is a brief summary of information I collected on MakerDAO DAI from the point of view of trading it.

Why trade DAI?


Unlike BTC or ETH, there's no question on what a stablecoin's true value should be. It should be 1:1 against whatever asset they are supposed to be pegged against. But despite the name, stablecoin prices do vary. For example, the USD-DAI exchange rate is 1.030 on Bittrex as of March 30 2020.

DAI prices in USD on the Bittrex exchange. April 1, 2020.



Trading BTC or ETH might be preferred if you want large potential upside and can handle the downside. USD-BTC dropped more than $3000 in value over 1 day on March 12. Stablecoins is something to keep in mind if you prefer less risk and is ok to settle for much lower return.


How the DAI system that drives prices works?


To borrow money, you would do so using the DAI system with a wallet (like Metamask). An example:
  • You have 10 ETH worth $1000 and want to borrow money
  • You use your 10 ETH ($1000 worth ) as collateral and borrow 700 DAI ($700 worth) at 10% interest, using the DAI system.
  • You use your 700 DAI to do things (buy things, invest in things, speculate, etc.)
  • When you want your 10 ETH back, you can go back to the DAI system and pay back 700 DAI + interest. So after 1 period, you need 770 DAI to get back your 10 ETH.
By allowing for borrowing of DAI using collateral drives the supply and demand of DAI. This is what help DAI keep its value around 1. If DAI value increase or decrease, you can use the mechanism above to make money. With people doing so, market pressure will bring the price back closer to 1. I will leave the elaboration of how in theory this mechanism drives prices toward $1 in the future.

But why would anyone borrow DAI with an ETH collateral? A couple of reasons:
  • If DAI is treated like money, then this is no different from borrowing money using a collateral -- like using your house to get an equity loan from the bank. Maybe you have a business and need money. You can use your ETH to borrow DAI, (and maybe even convert DAI to USD and withdraw it into the real world), and invest it into something that will give you more money in the future. Then, with more money, you can pay back the loan and interest to get back your ETH collateral.
  • What's the different between using ETH for money vs. the DAI system for money? Imagine you instead sell your 10 ETH ($1000 worth) for USD and use it for investing. If prices of ETH doubles, you've "missed out" in a similar way as the bitcoin pizza folk (link). With DAI, you can get back your 10 ETH (now $2000 worth) by getting 700 DAI plus interest. If the DAI system work, DAI should still be worth around $700 USD.

How to hopefully profit from DAI?


So to potentially profit from DAI price fluctuations, you can arbitrage using the lending/borrowing system above. Alternatively, if you have enough confidence in the DAI system to keep the DAI stable at $1, you can also skip the above and trade DAI on an exchange like Bittrex -- buy when prices is below $1, and sell when it is above $1, while accounting for transaction fees. There are risks invovlves with all stablecoins. While the decentralization of the DAI eliminates some risks that central coins like USDT has, this decentalization also creates other risks. DAI being essentially an ETH application means that it can be hacked. From the DAO Wikipedia page:

In June 2016, users exploited a vulnerability in The DAO code to enable them to siphon off one-third of The DAO's funds to a subsidiary account. On 20 July 2016 01:20:40 PM +UTC at Block 1920000, the Ethereum community decided to hard-fork the Ethereum blockchain to restore virtually all funds to the original contract.[12] This was controversial, and led to a fork in Ethereum, where the original unforked blockchain was maintained as Ethereum Classic, thus breaking Ethereum into two separate active blockchains, each with its own cryptocurrency. (link)


Also, the actions of some folks known as the MKR holders have the potential to either stabilize or destabilize the value and viability of DAI short term during financial shocks and longer term due to inability to adapt to market changes (link).

Conclusion


You can potentially profit from DAI by doing the DAI borrowing arbitrage, or you can just take that coin's ability to be stable as given and trade aroudn the stable vaule. The downside risk of trading stablecoins in general is that something can go wrong with the stablecoin. With USDT, you worry about accounting irregularities of the organization that creates the USDT. With DAI, the decentralization eliminates the accounting irregulaty risk, but it creates risks from hacking. 

If you don't have a crypto exchange account and is interested in starting, consider supporting this blog by using my Bittrex referral (link). If you have other questions, please post to the comments and I might reply or use it as the topic of a new post.

Reference:
https://medium.com/mycrypto/what-is-dai-and-how-does-it-work-742d09ba25d6
https://www.youtube.com/watch?v=J9q8hkyy8oM

Saturday, January 11, 2020

Run Logit Regressions in Python and Beware of Regression vs Forecasting Differences


I don't have access to Stata on all my computer since Stata licenses cost $$. Excel would work for basic OLS but it's a lot more involve to get it to do logit. Python is a workaround and it can do a lot more as well.

However, there's a difference in using "logit" to forecast (typically done via sklearn) versus doing a econometrics logitic regression. For econometrics analysis, sklearn should not be used. For the latter purpose, we generally try to estimate coefficients and interpret causality via hypothesis testing. Forecasting via sklearn often ignores this aspect. Furtherore, the coefficients you get via sklearn are often different from what you would get running it under Stata or any econometrics software.

I have written a Colab/Python notebook on this, and you can find it here (link). But since you will need to sign into a google account to view and run the code, I included the code below for quick reference. Note I had to break up the line "model = logit('diagnosis ~ ...", that should all be one line.

To use sklearn to forecast with logit:

import numpy as np
import pandas as pd

from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression  
from sklearn.metrics import confusion_matrix
data = pd.read_csv("fertility_Diagnosis_mod.txt")
  # You can get the data at 
# https://archive.ics.uci.edu/ml/datasets/Fertility. 
# I added variable labels and recoded the dependent variable (N=0,O=1)

X = data.iloc[:,:-1].values
Y = data.iloc[:,-1].values
y = Y

X_train,X_test,y_train,y_test = train_test_split(X,y, test_size=0.15,
random_state=5)
classifier = LogisticRegression(class_weight='balanced')
classifier.fit(X_train,y_train)

y_pred = classifier.predict(X_test)
classifier.coef_  

To use statsmodel for logit regression:

from statsmodels.formula.api import ols
from statsmodels.formula.api import logit

datadata = pd.read_csv('fertility_Diagnosis_mod.txt')
model = logit('diagnosis ~ season + age + diseases + accident + 
surgery + fever + alcohol_intake + smoking_habit + 
sitting_hours', datadata).fit()
print(model.summary()) 

Tuesday, February 4, 2014

More on Bitcoin


A technologist's view of Bitcoin courtesy of Marc Andreessen, the founder of Netscape (in case you are old enough to know what Netscape is...):
http://dealbook.nytimes.com/2014/01/21/why-bitcoin-matters

Sunday, January 12, 2014

Bitcoin Use at Overstock.com


Ok.

The numbers averages to about $150 per order, and part of the success might be driven by the pent up demand to cash out. Having almost all new customers suggest that the group of people holding Bitcoins are very different from the average Overstock.com consumers. 

Hattip: Overstock's First Day Of Bitcoin: $130,000 Sales, 840 Transactions, CEO "Stunned" [Zero Hedge]

Thursday, January 9, 2014

Income Distribution and Tax Burden





According to this, 86.4% of all Federal taxes are paid by the top 40% of filers by income. And who are these people? From the table below, the fourth quintile has a market income of $87,700, and the top quintile has a market income of $234,400.



As noted in the footnote of Box 1: "Market income is composed of labor income, business income, capital gains, capital income (excluding capital gains),  income received in retirement for past services, and other sources of income. Government transfers are cash payments and  in-kind benefits from social insurance and other government assistance programs. Federal taxes include individual and  corporate income taxes, social insurance (or payroll) taxes, and excise taxes. After-tax income is the sum of market income  and government transfers, minus federal tax liabilities."


Thursday, January 2, 2014

Another Link about Bitcoin, and Why Large Companies are Unlikely to Use It


Some nice economic concepts about what makes Bitcoin money: http://economistsview.typepad.com/economistsview/2013/12/time-for-a-little-bitcoin-discussion.html

Currently, it is not really used by any major retailers, though TechCrunch reported (via http://techcrunch.com/2013/12/21/overstock-com-reportedly-plans-to-accept-bitcoin-in-2014) that Overstock.com plans to offer it as a payment option in 2014. The same TechCrunch article also mentioned other companies that currently accept Bitcoin: OkCupid, Namecheap, and Humble Bundle.

Things will be fine as long as Bitcoin is a novelty and used little. But should it gain traction, a retailer will have to either convert the large amount of Bitcoin it receives to currency or keeps it in reserve. For the former, unless Bitcoin is used widely beyond the retailer itself, the transactions might have a large effect on the exchange rate (i.e., Bitcoin to US dollar for example).  For the latter, a quarterly financial statement where a decent portion of asset can drop more than 60% in a month will add unwanted volatility to the company. At this point, there are no derivatives to hedge this risk.

Does 60% seem large? As mentioned in the December 20th Financial Times article at http://www.ft.com/intl/cms/s/0/d5f2f096-6907-11e3-996a-00144feabdc0.html: "The price of a single Bitcoin has yoyo-ed between $450 and $1,280 in December alone."

Monday, October 28, 2013

Unconventional Monetary Policy in Normal Times


Speech by Governor John Williams on October 18, 2013 expressing his belief that unconventional monetary policy should not be used in normal times:
"Nevertheless, I don’t see LSAPs as being part of the FOMC’s toolkit once we leave the zero bound behind us. We’re still much less certain about their effects than we are about the effects of changes in the federal funds rate."

…

"That said, I expect that the explicit link between future policy actions and specific  numerical thresholds, as in the recent FOMC statements, will not be a regular aspect of forward  guidance, at least when the federal funds rate is not constrained by the zero lower bound."
Reference: Lessons from the Financial Crisis for Unconventional Monetary Policy [Federal Reserve Bank of San Francisco]




Friday, October 25, 2013

To Encourage Wage Growth in Japan


One way to encourage wage growth:
Apparently Abe has had enough. According to TV Tokyo (h/t ISI Group) Abe will begin pressuring business leaders directly to raise wages. The goal is to start with a corporate wage survey. How would a survey help? In Japan if the survey is published with the companies' names shown, the strategy of "naming and shaming" just might work. 
Hattip: Abe gets ready to start "naming and shaming" [SoberLook.com]

Thursday, August 8, 2013

Service as an Export

An article from TechCrunch on Google’s “secret” plan: http://techcrunch.com/2013/07/24/meet-helpouts-googles-secret-plan-to-bring-live-video-commerce-to-local-businesses/. Basically, with internet speed increasing and video conference capabilities spreading – some of the services that are previously not exportable are now exportable. Udacity (https://www.udacity.com/) and Kahn Academy (http://www.khanacademy.org/) are making it possible to export education as a service.

Before Google Helpouts, there was Google Answers: http://answers.google.com/answers/threadview?id=278360. It was a less successful version of Yahoo Answers (http://answers.yahoo.com/) that allows the asker to offer payment for higher quality answers.

Still, haircuts are not exportable yet …. 

Saturday, July 27, 2013

McDonald’s and Budget

Stephen Colbert made fun of the McDonald’s hypothetical employee budget on the July 22, 2007 Colbert Report. The budget referenced is available here: http://www.practicalmoneyskills.com/mcdonalds/. And from the booklet I downloaded:

image

I can only hope the suggested budget is not meant to be a real guide for employees. A couple observations:

  • I think having a second income is a reasonable assumption. It would either come from the other spouse working, or the employee working more elsewhere after maxing out 40 hours at McDonald’s. 
  • Two spouse working 40 hours a week each earning a net wage of $5.94 per hour will get to $2060 – the hypothetical income in the McDonald’s example. From the reference here (http://www.minimum-wage.org/wage-by-state.asp; data possibly unreliable, but seem roughly right), the full minimum wage is about $5.15 in Georgia to $8.95 in Oregon.
  • If the $2060 comes from a 40 hour work week instead, that would imply a net hourly wage of $11.88 ( = 2060*12/52/40). If the $2060 comes from 1 employee working a second part time job – say totals to 60 hours per week – then the net hourly wage falls to $7.92 in net hourly wage.
  • Why isn’t food a separate category? All frugality/budget books I have read start off the budgeting process by focusing on food, insurance, and transportation (F.I.T.). That is because, besides housing, those three items are usually the biggest part of American spending.
  • I hope the suggested budget of $20 for health insurance reflects the cost of insurance premium paid by actual McDonald employees. That seems low.
  • As Stephen Colbert had pointed out – it’s strange to have $50+$90 = $140 for energy needs. But I live in a place with very mild temperature in all seasons.

CNN actually ran an article on actual budgets of employees (link here: http://money.cnn.com/gallery/news/economy/2013/07/17/mcdonalds-worker-budget/index.html). Note that the monthly net income for the employees showcased are: $525, $1000, $415, and $610 – all below the $1105 amount on the McDonald’s example.

It would have been nice if CNN also run an article on actual budgets of employees that *do* make ends meet. It would require reducing consumptions of some times to limit spending, or having two working spouse (or an extra job) to increase earnings. That would make for a more useful news article.

Friday, June 28, 2013

A Timeless Occupation: Earning a Living by Buying and Selling Used Appliances

Article on Lifehacker about someone earning a living by buying and selling used appliances: http://lifehacker.com/how-i-earn-my-living-buying-and-selling-appliances-on-c-555205905.

My uncle did this years ago, in Hong Kong, before such things as the internet and Craigslist exist. My understanding is that he would go door to door and ask if the families would like to sell their used appliances. After a while, I think the family also knows him and would call him if they are interested in selling the appliances. As the article from Lifehacker describes, my uncle also would either fix the appliance and resell, or tear it down and sell the metal.

I remember he would gave us a lot of magnets to play with when I was a kid. Magnets that you would get from tearing out the strip that seals the refrigerator door.

Tuesday, June 25, 2013

Tight Interbank Liquidity Conditions In China and Repos

A post from Sober Look on tight interbank liquidity conditions In China, as explained by someone from JP Morgan: http://soberlook.com/2013/06/good-explanation-for-tight-interbank.html.

To avoid any squeeze from this mismatch upon maturity of the WMP, small banks started to engage in a kind of sale-and-buyback operation of the underlying bonds, consisting of two steps. In step 1, bonds were sold before quarter-end in a “fake” sale to a friendly counterparty, with the aim to obtain cash to pay back the maturing WMP. In a second phase of the trade, the bond was then bought back using cash from new WMP issues. But in May the regulator banned this practice, as part of a general clampdown of the abuses in the WPM market.

From what I understand, smaller banks in China are investing in higher risk and longer maturity bonds to support its wealth management products. When the payout to product holders occurs every quarter, the steps quoted above happen. With the government banning this practice, banks are having a hard time liquidating the bonds temporarily to pay out the wealth management products.

The steps above seem like some form of inform repo for high risk assets. I find this interesting because I am only aware of repo markets for safe assets such as US Treasury securities. I also wonder what the implied borrowing rates are for these pseudo repo transaction carried out by Chinese banks.

Friday, June 7, 2013

Combining Shipping Time and Production Time

Clever: http://gizmodo.com/watch-a-column-emerge-from-a-block-of-marble-during-an-505922029 .

What characteristics must a product have for this to be viable? I suppose the item must be heavy (so transport by shipping is necessary) and the raw material must be from a place that’s far away. It also has to be pretty low in the production chain, and the production time must be comparable to the shipping time.

Wednesday, June 5, 2013

Correlation of Performance vs. Expense Ratio for Mutual Funds

The full infographic is here: (http://moneyning.com/investing/how-do-you-pick-mutual-fund-for-your-portfolio/), which advocate looking for funds with low fees because of the following graph.

image 

The correlation is striking for many other types of funds, but the usual caveat that correlations don’t equal causation applies. The data source appears to be from Lipper, 2013.

Assume for the moment that the relationship is true (or think that we’re just interested in a forecast). The scale of the graphs make the comparison slightly more difficult, but by eyeballing the US government and REIT graphs, I would guess the US government slope is about -1/0.65 = -1.54, and the REIT slope is about -3/1.75 = -1.71 –- if you were to run an OLS regression. Note that the slope of the OLS line would tell you how much extra return you can get if you find an alternative fund in the category with lesser expense. So you lose less return with REIT funds than with US Government funds by going for a fund with higher expense ratio.

This suggests perhaps that skills of the fund managers plays a very smaller role for US Government funds than REIT funds, or that return for skillfully in buying and selling the right asset at the right times yields relatively little return.

imageimage

Hattip: http://lifehacker.com/the-first-number-you-should-look-for-when-choosing-a-mu-511049734

Friday, May 31, 2013

Econ Job Market Survey Results for 2011-2012

If you fill out the Econ Job Market (econjobmarket.org) survey for this year (2012-2013), you get links to the results of the previous 2 years’ surveys. I would be very interested in the results this year once they’re available. My sense is that the market is tougher than 2011-2012.

All the standard caveat of inferring reality from surveys applies. The 2011-2012 result is based on 598 responses (17% response rate). Some facts from the survey:

  • 38% of the respondents applied to more than 100 jobs,
  • recruiter got an average of 242 EJM applications (not sure how they calculate recruiters with multiple job postings),
  • 22% of respondents have 1-5 interviews (the mode), and 24% have 1-2 fly-outs (also the mode), and
  • 21% have no job offers, and 43% has 1-2 offers.

And finally, the two tables I find most interesting:

1. Everyone likes the coasts, and Asia and US South are both rather unappealing.

image

2. 68% of those with jobs earns anywhere from $50,000 – 150,000.

image

Tuesday, May 21, 2013

Bank of Japan’s Economic Outlook

The monetary policy statement is at http://www.boj.or.jp/en/announcements/release_2013/k130522a.pdf. CPI is still negative, but “some indicators suggest a rise in inflatoin expectations.” The outlook:

“Japan’s economy has started picking up.  Exports have stopped decreasing as overseas  economies have been moving out of the deceleration phase that had continued since last year  and are gradually heading toward a pick-up.  Business fixed investment continues to show  resilience in nonmanufacturing and appears to have stopped weakening on the whole.   Public investment has continued to increase, and housing investment has generally been  picking up.  Private consumption has seen increased resilience, assisted by the improvement  in consumer sentiment.  Reflecting these developments in demand both at home and abroad,  industrial production has stopped decreasing and signs of picking up have become  increasingly evident.  Meanwhile, financial conditions are accommodative.  On the price  front, the year-on-year rate of change in the consumer price index (CPI, all items less fresh  food) has been negative, due to the reversal of the previous year’s movements in energy-related and durable consumer goods.  Some indicators suggest a rise in inflation  expectations.

With regard to the outlook, Japan’s economy is expected to return to a moderate recovery  path, mainly against the background that domestic demand remains resilient due to the effects  of monetary easing as well as various economic measures, and that growth rates of overseas  economies gradually pick up.  The year-on-year rate of change in the CPI is expected to  register smaller declines for the time being, and thereafter is likely to gradually turn positive.”

Also of interest:

“Mr. T. Kiuchi proposed that the Bank will aim to achieve the price stability target of 2 percent in the  medium to long term and designate quantitative and qualitative monetary easing as an intensive  measure with a time frame of about two years.  The proposal was defeated by an 8-1 majority vote.   Voting for the proposal: Mr. T. Kiuchi.  Voting against the proposal: Mr. H. Kuroda, Mr. K. Iwata, Mr.  H. Nakaso, Mr. R. Miyao, Mr. Y. Morimoto, Ms. S. Shirai, Mr. K. Ishida, and Mr. T. Sato.”

Friday, April 26, 2013

Japanese Interest Rate since Abe

Since Shinzō Abe took office as the Prime Minister of Japan on December of 2012, the Japanese interest rate has become quite a bit more volatile relative to the period spanning the past year. The graph below shows the day to day change in interest rates calculated from Japanese Government Bonds (data from Ministry of Finance here: http://www.mof.go.jp/english/jgbs/reference/interest_rate/index.htm). The 2-year yield (blue line) in particular has been moving quite a bit, and usually downward. The 10 year yield, while always quite volatile, also has a negative bias since Prime Minister Abe took office.

image

Tuesday, February 5, 2013

What Is Given Can Be Taken Away

The head of Bank of Japan, Masaaki Shirakawa, will be stepping down a few weeks early. From the NY Times Article (link here):

The governor of the Japanese central bank, Masaaki Shirakawa, said Tuesday he had offered to step down on March 19, three weeks before the end of his term, amid intense government pressure on the bank to take bolder steps to resuscitate the deflationary economy.

Prime Minister Shinzo Abe is expected to replace Mr. Shirakawa, who has long preached caution on monetary policy, with a successor who is more open to printing money, stoking inflation and bringing an end to the falling prices that have weighed on Japan.

It would be interesting to see how the government will “cooperate” with the Bank of Japan going forward. The Bank of Japan gain greater independence in 1997 after a revision to the Bank of Japan act (see Wikipedia link here).

Thursday, January 24, 2013

Two Risks from Ultra Easy Monetary Policy

Sober Look talks about two risks of ultra easy monetary policy a few days ago (link here):

What many economists failed to realize - and many continue to do so today - was that the risk of excessive liquidity is not necessarily the overall price inflation.

…

As an example of where this excess liquidity may be ending up today, consider the fact that the average US corporate junk bond yield ended up at an all-time low of 5.93 last week (chart below). Of course market participants have dozens of ways of rationalizing this trend - just as they did with other markets many times before.

As stated in the article, inflation is a risk of ultra easy policy. However, because the Federal Reserve can now pay interest rate on reserves, this risk can be controlled somewhat. The other risk – that of asset bubble – is not as easily tweak-able. Blindly chasing yield while ignoring risk is bad, but price inflation of assets such as MBS and corporate bonds is a channel of monetary policy to encourage economic growth. From Chairman Bernanke’s speech back on August 27, 2010 (link here), with emphasis added by me:

The channels through which the Fed's purchases affect longer-term interest rates and financial conditions more generally have been subject to debate. I see the evidence as most favorable to the view that such purchases work primarily through the so-called portfolio balance channel, which holds that once short-term interest rates have reached zero, the Federal Reserve's purchases of longer-term securities affect financial conditions by changing the quantity and mix of financial assets held by the public. Specifically, the Fed's strategy relies on the presumption that different financial assets are not perfect substitutes in investors' portfolios, so that changes in the net supply of an asset available to investors affect its yield and those of broadly similar assets. Thus, our purchases of Treasury, agency debt, and agency MBS likely both reduced the yields on those securities and also pushed investors into holding other assets with similar characteristics, such as credit risk and duration. For example, some investors who sold MBS to the Fed may have replaced them in their portfolios with longer-term, high-quality corporate bonds, depressing the yields on those assets as well.

The Federal Reserve hopes that investors would buy more high-quality corporate bonds, but Sober Look finding indication that perhaps investors are buying quite a bit of low-quality corporate bonds also.

Wednesday, January 16, 2013

Interest Pay on Reserves as Monetary Policy Tool

The idea of a platinum coin has been ruled out (example of news here), but the thought exercise on what might follow if it were to happened brings up some interesting discussions on possible monetary policy going forward.

Tim Duy gave his thoughts here, quoting from posts of Paul Krugman and Steve Randy Waldman.

I do think interest pay on reserves would be an important tool when the Federal Reserve decides to unwind QE and lowers its reserve balance – particularly if the Federal Reserve decides to unwind slowly. But the following point about interest on reserves is particularly interesting (and I have not though of):

As Krugman correctly notes, in this world the Treasury, not the Fed, is effectively paying the interest on reserves.  Thus, we really shouldn't consider the excess reserves as monetary base (with the connotation that these reserves are simply cash ready to be lent out), but as psuedo-government debt (and I thank Gavyn Davies for pointing this out to me, so I hope I got his meaning correct).