Attributing My First Token Millionaire Address (0x5cda) as a Nansen Scout

Background: I’ve enrolled into the Nansen Scout program, which is a really interesting program where you can attribute addresses in exchange for rewards. In this post, I’ll be detailing my journey into attributing a ’token millionaire’ address 0x5cdaf83e077dbac2692b5864ca18b61d67453be8. First steps First, I entered the address into Sanbase historical balance to get a sense of asset distribution. We observe that the wallet holds $6.1M USDT, and $3.8M in ZKS. Digging further, we find that: ...

December 22, 2021 · 6 min · Lei

More Advanced MatPlotLib Styling

So, going more into depth with MatPlotLib is all about learning how to style your graphs according to how you’d like them. I’ll document some more techniques that I’ve learned here. Creating a secondary axis Sometimes, you need to overlay graphs. In my specific case, I needed a graph that showed both Value and Amount. My left y-axis would be the Value, whilst my right y-axis would be Amount. It looks like this ...

December 20, 2021 · 2 min · Lei

MatPlotLib Basics

Basics of Matplotlib In this tutorial, I’ll be going through the basics of using MatPlotLib. We’ll learn some of the building blocks of MPL: Figures, Artists, Axes, Axis. Importing 1 2 3 import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np Figures The main primitive of MPL is a figure. A figure is an object class that contains a lot of methods that we can use to plot figures. In the words of MPL, a figure is a ’top level Artist’ that holds all plot elements. What is an artist?? I hear you say. ...

December 20, 2021 · 8 min · Lei

On the URL Method of Vanilla JS

So recently I’ve discovered a weird construct in Vanilla JS that I haven’t seen before: the URL method. It looks like something like this: 1 2 3 4 5 const url = new URL(`${covalentAPI}${APIEndpoint}/`); url.search = new URLSearchParams({ key: APIKEY, tickers: tickers }) So after googling a little bit, I figured out what it does. URL method The URL method creates a new URL object. You can think of an URL object as a more convenient way of extracting and using different parts of URLs. The URL object has the following attributes: ...

December 13, 2021 · 2 min · Lei

Thoughts on Promises

I’ve always found promises rather confusing. After recapping it for the nth time this morning, I would like to detail here my main takeaways so that I can finally commit them to memory. Recap on Promises Firstly, to understand promises, you first have to understand threading. Javascript is single-threaded, meaning that all code execute line by line, one after another. When you create a promise, you’re essentially creating another thread that is added to the event queue and importantly, executed after your main code block. ...

December 7, 2021 · 5 min · Lei

Short but Power Query for Finding Any Transaction on Ethereum

1 2 3 select sum(value)/10^18 as royalties, 0.7*sum(value)/10^18 as dao_royalties, 0.3*sum(value)/10^18 as artist_royalties from ethereum."transactions" tx where tx.from = '\x0b7a434782792b539623fd72a428838ea4173b22' and tx.to = '\x557068A9b7d66F97A61b97C80541eb17672E1e6f'

November 6, 2021 · 1 min · Lei

Connecting to Ethereum

These are the main concepts regarding programmatic connections to Ethereum. You use Infura to access Ethereum node via API. Step 1: Sign up on Infura and get the API endpoint. ‘https://mainnet.infura.io/v3/397e0ef1xxx' Step 2: Connect to Web3 1 2 3 4 from web3 import Web3 infura_url='https://mainnet.infura.io/v3/397e0ef1b1dd4f6e85b10c3936724da3' w3 = Web3(Web3.HTTPProvider(infura_url)) w3.isConnected() That’s it! You’re connected to an Ethereum node.

November 2, 2021 · 1 min · Lei

Getting Jupyter Notebook to Work With Web3

I was trying to set up my python environment for accessing web3 data, and there was an issue when I tried to import web3 from within Jupyter notebook. It keeps telling me web3 module not found. Apparently, I should only access web3 from a virtual environment. A virtual environment, it turns out, is a separate environment that you can create that simulates the NPM style of isolated project environments. It allows you to create self-contained dependencies. This is a great article explaining it. ...

November 2, 2021 · 1 min · Lei

Notes on Implementing Login Page

OKay I’ll just need to make some quick notes with regards to login features of a website, and this is a rather new and elegant way of doing it. Step 1: Decide on where in the component chain you’re going to implement login requirements. In my case, it’s App.js, because everything else within the app is supposed to be ‘private’ and an individual’s views of their own portfolio. Step 2: Create a login page. I’ve used the stock one from material UI, which looks great. First, create a login.js component. Paste the content from this template into the component. ...

October 13, 2021 · 8 min · Lei

Steps for Implementing Redux Into a Project

Step 1: Install Redux & react-redux, and redux-thunk npm install redux npm install react-redux npm install redux-thunk Step 2: Think about what states you want your store to have For my case, it was: 1 2 3 4 5 { streams: [{},{}] trades: [{},{}] globalNominalDenom: 'SGD' } Step 3: Taking stock of ways Database data and store data is interacted with There are three broad functions you’re trying to achieve, what I call, the right hand, left hand, and the reducers. Right hand is in charge of getting state from database. Left hand is in charge of ‘pushing’ state to store via dispatch. With the help of redux-thunk, you essentially combine these two functions together into the definition of action creators. ...

September 24, 2021 · 6 min · Lei