20250713

MEMO: The Trading Game: A Confession

I found Gary on a Japanese YouTube channel where an interview was conducted, and he had promoted his book, which had been translated into Japanese quite recently. It turned out that he himself also had a YouTube channel, where he talked about wealth inequality.

I watched some of his videos and found that he has a very honest personality, which led me to believe that most of the content depicted in his book is accurate. (Though, it is still possible that he is a psychopath and making things up.)

His story is mesmerizing. He comes from a poor background, is gifted with an exception math IQ, has worked very hard, and some luck played a role in his success as a trader at Citibank. However, the book is not about his success, but rather his dilemma between his poor upbringing (friends/family), and the very rick traders whom he himself has become.

He gradually lost his connection with his upbringing just to make a huge amount of money, obsessed with numbers, and eventually he suffered from severe depression. The process of losing humanity and getting depressed is a very heart-touching story, and although I have almost nothing in common with Gary, I could feel his madness and sadness by reading the book.

He is currently working to address wealth inequality. He is British, and I hear that economic disparity is enormous in his country. To be clear, he is only targeting the very, very, very wealthiest people, as they are somehow evading taxes while the working class pays a massive amount of taxes and cannot buy assets.

He argues that the price of assets, such as housees, keep rising, and it sounds legitimate. Now, I’m wondering whether I should buy a home to hedge against the situation, as the top companies are rapidly expanding their assets and increasing the prices.

By the way, he spent his last two years as a Citibank trader in Japan, and it was interesting to see Japanese restaurants or places I know where mentioned in the book.

CSRF (Cross-Site Request Forgery)

CSRF (Cross-Site Request Forgery) is an attack where a malicious site tricks the browser of logged-in user into sending authenticated requests to a target web applications. If the application users cookies to store authentication credentials like JWTs, and proper CSRF protections (like tokens or SameSite settings) are not in place, these requests can perform unauthorized actions like triggering a money transfer.

One mechanism to prevent the attack is to require a random token, known as a CSRF token, to validate requests. First, the backend generates a random CSRF token and embeds it in the HTML form or sets it in Cookies (if Cookies is used, it should not included in request headers automatically by browsers).

Attackers cannot guess the CSRF token because it is random and unique. They also cannot read it from the backend response because browsers enforce the Same-Origin Policy, which blocks cross-origin sites from accessing responses. Even if the CSRF token is included in an HTML or JSON response, the browsers will prevent a malicious site from reading it, unless the server explicitly weakens this protection using permissive CORS headers like Access-Control-Allow-Origin: * with Access-Control-Allow-Credentials: true.

SOP: security mechanism that restricts how a web page can interact with resources from a different origin.

CORS: mechanism that allows servers to relax the restrictions imposed by SOP.

Words: CSRF (Cross-Site Request Forgery), CSRF tokens, SOP (Same Origin Policy), CORS (Cross-Origin Resource Sharing)

Python can run about 1 million basic steps per second

I browsed some web pages and asked ChatGPT but could not find any resources on that. However, all of my mentors use the number to estimate the procesing time, so I will just go for it, I guess.

$ python3 test.py
Elapsed: 0.04726767539978027
$ cat test.py
import time

start = time.time()
x = 0
for _ in range(1_000_000):
    x += 1
print("Elapsed:", time.time() - start)

It seems the number is not far from reality.


TODO:


index 20250712 20250714