November 9, 2021No Comments

Blockchain Explained

Ledgers

Let’s start by understanding the concept of a ledger. Ledgers have been used for thousands of years to keep track of accounts and transactions. Whether it was the production of barley in Mesopotamia or the ownership of property.

A ledger essentially logs transactions along with other details such as amount, the date, and the person who authorized it (a signature). So there were some basic security mechanisms in place. For example, ink cannot be easily replaced, pages and entries were chronological and numbered so new entries couldn’t be faked.

For years ledgers were books kept in trustworthy locations held by a trustworthy person. You essentially trust the owner of the ledger to not cheat or add fake entries or tear out pages. So there are some terms here to keep a good ledger. A signature to verify transactions were real and trust in who keeps the ledger. This is not too different from our current system today. 

Banks

As I tap to pay for groceries, the terminal detects a unique code on my card and sends that information to their bank. The bank uses the VISA network to talk to my bank, CIBC. CIBC checks their ledger to confirm that I have funds to pay. Then my bank sends confirmation back via the VISA network to the store's bank. The terminal finally confirms at the grocery store that everything is all good and I get to leave with my groceries.

Each bank keeps a general ledger for every one of their customers. You see glimpses of this when you get your account statements every month. Your ledger essentially says that you deposited some money to open your account. Then you tap to pay for dinner. So the bank checks your record to confirm you have enough funds, and adds a record saying that you paid that money to the restaurant. Meaning some money moved from your account to theirs. And this gets tracked on the ledger.

Then someone pays you back for covering dinner, so a certain amount of money is moved from their account to yours. Then say you want to buy some dessert so you tap again but this time the bank sees that your balance is not enough so the transaction is denied.

As the owner of the account you are signing these transactions by using your card. Which in this case functions as a password of sorts. The same way your password functions in online banking. We think of this as bills exchanging hands as physical money moving from one account to the other.

In this day and age, there is no physical money involved. There are no bills moving from an account to another. There is just a huge ledger that’s keeping track of everything. Numbers being added and subtracted from accounts. 

Your bank's ledger is what’s called a centralized ledger. They own it, they are the only ones who can make changes to it and it’s their job to maintain it and make sure it is not tampered with or deleted. You essentially trust the bank to keep a good track of that ledger.

However, they have full control of the ledger so there is a remote possibility that the bank could make a mistake or even shut down.

Bitcoin

Bitcoin was conceptualized by an anonymous person who uses Satoshi Nakomoto as a pseudonym. They brought together a bunch of concepts and technologies to write a whitepaper that was published in 2009. This was in the middle of the real estate market crash so it rode a wave of mistrust in the banking system.

This proposed cryptocurrency offered theoretical solutions to many problems in centralized banking. The fees to send money and accept payments, the trust problem with banks and even the central banks ability to print new money based on political decisions.

Bitcoin as a currency that can be used to pay for things is built on top of a blockchain. A blockchain is essentially a ledger, similar to the one a bank keeps.

The Bitcoin ledger doesn’t depend on a single entity or server. It’s not a book, it is distributed. It was designed as a way for multiple computers to work together, each one with a stored copy of the ledger with a creative and super secure system to ensure that none of the transactions could be tampered with.

This ledger isn’t a list of transactions, instead it is divided into blocks. Which is a really smart way Satoshi figured out to allow this thing to work.

Blockchain

Each block contains a batch of transactions. Whenever you send money to someone using the blockchain, what you are essentially doing is adding an entry to the ledger. Saying that a certain value moved from one account to the other. 

In traditional banking, the bank itself is the only entity that can add to the ledger. In the blockchain, anyone can add transactions and therefore is open. The technology uses an incredibly secure system to make sure transactions are real.

So in a blockchain transactions are grouped into blocks. On Bitcoin specifically each block is about 1MB in size, which means it can store about 2400 transactions. Just like your credit card transaction, in order for a transaction to be valid the origin account needs to have enough funds and the record needs to be signed by the owner of the account to verify that it’s real.

As transactions are made between accounts they are broadcasted to all computers in the network. Each one of them begins grouping them into a new block. 

Block Creation

Let’s see how a new block is created. The first thing the computers do is get the code of the last block in the network. That way we know we are linked in between each other, linked to that last block. This gives us a chain. As transactions are seen by computers on the network they begin listing them inside this incomplete block. Once the block is finished they send it to the rest of the network, so instead of pointing to the previous block, they point to this new latest block.

If creating a block was easy different computers could create multiple blocks at the same time, broadcast them and the blockchain would fork. There would be no way to see which fork to follow. By design, creating a new block must be hard. Just like each transaction needs to be verified by the sender of the money. Each block must be verified by the creator. Creating a block needs to be deliberately hard so that only one block is created at a time.

Proof of Work

On Bitcoin, this is done with a system called proof of work. As the incomplete block begins filling up with transactions, the computer creating the block automatically tries to solve a puzzle. This is where cryptography comes in. What the network wants from any computer in the network is to go through a lot of work to create a block. But we don’t want every computer to go through that work to check if a block is valid.

Because of this a cryptography function called SHA256 is used. This is being used all throughout the internet and your browser is likely using it now to read this blog post. Technically, it’s called a hash function. If you took the information in this incomplete block, everything inside it, the number of the block behind it, every transaction and you run it through a SHA256 formula a number will come up. 

This number is extremely unpredictable and looks random. It’s made up of 1s and 0s and is 256 characters long. Changing any value in the block will produce a new number, not just one digit different but all 256 digits are different. Since this number is so unpredictable, changing something would create billions if not trillions of possibilities. Really advanced math, but very easy to calculate for a computer.

In order to create a block and prove it wasn’t easy, the computer creating the block needs to find a way that the result of this operation starts with thirty 0s, that is attaching a number at the end of the date so that the result of the SHA starts with thirty 0s.

Here’s the trick: there is nothing you can do to calculate that number in reverse. We can know the formula of the SHA256, but it cannot be reverse engineered. No one has solved it and it’s likely anyone will anytime soon. 

The only way to find this number is to try one then another and another until one of the results gives you thirty 0s. On average, you will have to test a billion numbers to get a result. This is a lot of work, even for computers. There are so many unpredictable options that getting the number right is almost like winning the lottery. A computer should take a few minutes to solve this puzzle.

Now, why would anyone burn out their computer to log transactions, try random numbers to find a random number to complete this formula? Because when you create a block, you create money for yourself. 

Putting it all together

So a new block has been created. But remember this is a ledger. The ledger records transactions between accounts. It is not a money printer. So if all these accounts are zero. Where do the values that populate the accounts come from? If you create a transaction from an empty account or if you just add money to an account it’ll get rejected. 

Except for one, the creator of a block gets to add a reward for themselves. They get to create new coins in the supply of coins in the network. This reward is the reason why this is called mining. The computer is performing this repetitive task of finding a special number in exchange for this reward.

Once the block is created it gets broadcast to the network. Once half of the computers in the network adopt it and add it to their own copy of the blockchain and start mining the next block, the original block is considered confirmed and unchangeable.

Each block contains the hash of the previous block, if someone tried to change something in a block made days ago it would mean that the hash of this block would change. Which would change the hash of the next block, and the next. All blocks would need to be recalculated. That is the main reason the blockchain is such a trustworthy way to store data.

Future Consideration of Proof of Work

Satoshi predicted that as the network grew a lot more people and advanced computers would join and start calculating this puzzle at the same time. As the network grows bigger, the difficulty needs to grow as well. It is adjusted automatically by changing the number of 0s required on the proof of work. The more 0s, the harder it is to find the number that works.

Another important difference is that the amount of coins that get created is limited. The ledger started with a balance of 0 for everyone. For the first few blocks the reward for solving the puzzle was 50 bitcoin. Every coin in circulation today was created this way. Mined by a miner, then sold to someone else. 

You can actually go and look at the first block of the blockchain here: https://www.blockchain.com/btc/block/0. It has no transactions, it points to the previous block which is block 0 and it had a 50 BTC award for the miner who found it.

The reward for finding a block decreases with time. Right now it’s at 6.25 BTC. This means that by 2140 all bitcoins allowed will be mined and no new ones will be created. Inflation will not be possible. The supply is limited to 21 million coins.

At the very beginning no one would pay anything for a unit of this. Someone decided to put a computer to mine for nothing. Numbers on a screen, or technically numbers in a ledger. 

As people began trusting the system, they began assigning value to the numbers in that ledger. Real world value. Dollar value to having an account number with Bitcoin.

This was cents on the dollar a couple years ago, but now a Bitcoin is worth north of 60 thousand dollars. 

The Future

This post is not about Bitcoin, it’s about blockchain. That is the most important part of this whole mess. Just as a currency Bitcoin was the first to get popular. There are completely different blockchains with a different ledger, their own rules and different algorithms. The fact that people adopted and used Bitcoin opened a whole new world of developers and cryptographers to put their computers to mine or develop applications on top of the blockchain. They’ve also invented new variations of the technology that could be put to other uses. Two fantastic examples are smart contracts and NFTs.

I hope this post has taught you more about how the blockchain works and gets you excited for the future that will come from this.

November 4, 2021No Comments

Canadian Quantitative Trading Companies

The purpose of this post will be to go over a few of the different Canadian companies that feature a quantitative trading element in their business and go slightly deeper into the details regarding it. For lots of these larger financial management companies, they are multifaceted organizations and are not necessarily only focused on quantitative and algorithmic trading, however, for all the companies, they play a large enough role in the industry to be of interest for someone looking to work in the quantitative finance field.

The main target of this article will be more so directed at those looking to break into the industry and will go over the important factors to consider when looking into working for one of these companies. The article will go over the backgrounds of the different companies selected as well as an overview of the different types of quantitative positions they offer and what is required to be a successful candidate for the job.

RBC

About

The first and largest company on the list is the Royal Bank of Canada If you live in Canada, it’s likely you’re no stranger to RBC and may even be a customer of theirs. Founded in 1864, RBC is the largest bank in Canada by market capitalization, given its 17 million clients and 81,000 employees around the world. From personal to corporate banking, RBC offers a very diverse set of financial services for the average consumer, but the main aspect that will be focused on here will be regarding the different funds managed by the quantitative financial team at RBC.

Quantitative Team

The quantitative team at RBC is known as the Quantitative Strategies Group, or in short, QSG. The QSG at RBC manages 14 different funds which are all controlled by the quantitative systems put into place by the team. The differences in the funds mostly revolve around the equities that are being traded, for example, some funds trade with global equities, while others are either Canadian or American only. Additionally, the funds have different levels of estimated volatility based on the aggressiveness of the trading styles and also the portfolio selection. The main goal of all these funds, as is with most quantitative trading, is to deliver consistent and positive returns.

Positions

QSG breaks down their team into three major proponents, this being Research, Development and Trading. Research is what would entail the statistical methodologies, machine learning and analysis of alternative data. Development is the implementation of strategies into production-level code and also the creation of backend systems required for the algorithmic trading functionality. Finally, their trading component is mostly to do with the live execution and monitoring of trades and the analysis of current market conditions to improve and create new strategies.

In terms of actual job positions, most likely, the most relatable position for those reading this article is the Quantitative Strategies Group Summer Analyst. This position would get you a spot on the QSG team as an intern and give you great experience as a part of RBC’s quantitative trading team. This is a competitive position that is stationed in New York which requires you to apply about a year in advance. As an intern here, you are expected to get experience trading a wide range of assets including equities, electronically traded funds, options, futures and more. To be a candidate for this position, you are expected to be in your third year at the time of application while studying Math, Physics, Engineering or Computer Science. In terms of technical skills, they look for experience with Python, R, MATLAB or C++.

While an intern position is what most will be looking for as a student, RBC obviously still offers full-time positions on the QSG team which require a slightly more diverse set of experiences. Being the large company RBC is, working here would offer very high-quality job training, extensive learning opportunities, however, working for huge, structured organizations is not always for everyone.

Connor, Clark & Lunn Financial Group

About

While Connor, Clark, & Lunn Investment Management, also known as CC&L, is not a multinational bank like RBC, it is still a rather large institution with a big presence in quantitative finance. CC&L was founded in 1982 by Larry Lunn and has since grown into one of the largest independent investment management firms in Canada with $55.9 billion under management. CC&L has offices in Toronto and Vancouver and manages money for corporations, governments and First Nations.

Quantitative Team

As an investment management firm, CC&L offers a handful of different investment strategies including fixed income, fundamental equity and most important for the purpose of this article, quantitative equity. Inside of the quantitative equity strategies, CC&L further breaks up their services similar to the way RBC does. CC&L offers quantitative strategies in markets such as Canadian equities, international equities, global equities and emerging market equities.

CC&L has a general performance goal when evaluating its quantitative strategies. For all of their strategies, they strive to outperform the S&P/TSX Composite index by 2% over per annum. CC&L also has a few less quantifiable but important goals. At CC&L, they believe in the strong connection between fundamental research, quantitative theory and empirical evidence in order to attain success in their field. Considering this, they hold large importance on constructing the most optimized portfolio for the quantitative analysis being performed.

Positions

At CC&L, the roles of the employees are slightly different than those at a company as diverse as RBC. When looking at the quantitative team at CC&L, there are three main categories of positions, the first being a Systems Developer. This position, being one of the less quantitative-focused positions, focuses on building the technical infrastructure for the quantitative trading to take place. While the technical analysis of assets is less important in a role like this, an understanding of financial markets is a must in order to understand the transaction processes required to implement the desired systems.

On the more quantitative side, positions such as the Quantitative Researcher and Developer may be of more interest. At CC&L, a Quantitative Researcher spends their time discovering and learning about new analytical and financial opportunities in the quantitative space. They iterate upon what they have implemented in the past and also develop new strategies that they believe will bring the highest rates of return while mitigating risk and staying consistent. The other main position at CC&L is the Quantitative Developer which has a heavy focus on implementing the strategies researched by the Quantitative Researchers. Getting more technology specific, CC&L looks for candidates with strong Python, Java and C# programming skills. While there is no marketed internship program, CC&L offers great opportunities in a full-time environment to apply your skills and learn from the technically advanced people around you.

Healthcare of Ontario Pension Plan

About

Unlike the past two companies, the Healthcare of Ontario Pension Plan, also known as HOOPP, has a more privatized customer base, given it manages only this pension plan for Healthcare Ontario. While this may be the case, this organization still manages $100 billion and over the past year has earned a return of %11.42. The HOOPP does have a diverse set of strategies in place, focusing on fixed income, real estate, public equities, corporate credit and more but also has a strong presence in the quantitative finance space.

Quantitative Team

While the HOOPP features a team of fundamental researchers and analysts, they also have a team made up of their IT division that performs the quantitative trading and analysis for them. Recently, HOOPP has been trying to further develop this aspect of their management team and considered this quantitative and systematic Trading and investment risk management team to be something of growing importance.

While the different markets and equities this HOOPP team works with are not as readily available as those of the companies above, they do mention the different data mining and engineering that they do in order to create and manage proprietary data they use in their interesting quantitative analysis.

Positions

Like just about all the other quantitative trading teams, HOOPP looks for candidates with an education background in Mathematics, Computer Science, Statistics or Engineering. Besides mathematical interest, they also look for a strong interest in finance and capital markets in order to be considered as a potential Quant at HOOPP. Additionally, as the positions get more senior, HOOPP also expects their employees to be Chartered Financial Analysts, CFA or Financial Risk Managers, FRM.

On the more technical side, HOOPP looks for an understanding of systematic investment strategies, portfolio theories, execution and pre/post-trade analytics, market microstructure and of course quantitative techniques. When looking at the programming aspect, HOOPP looks for experience with Java, C, C#, Python and SQL while also having an understanding of software development methodologies.

Another aspect of the application that other companies did not explicitly state was the importance of communication skills and more specifically the ability to communicate with those who are less technically versed.

October 9, 2021No Comments

Introduction to Options

Options:

An option is a contract between two parties for future transaction on an asset at a predetermined Strike price. The buyer of the option has right but is not obliged to engage in this transaction. The seller of the option on the other hand has the obligation to fulfill the transaction. The buyer of options also pays a fee for this right which is called a premium. In options transactions there must always be a buyer and a seller. 

There are many different types of options for different assets. For the purpose of simplicity this introduction will be solely focused on stock options. In general, there are two different kinds of options call options and put options

Call Options:

When purchasing a call option, the buyer has the right but not obligation to buy agreed lots of 100 shares of the stock before the expiration date for a certain price. While the seller has the obligation to sell the stock should the buyer exercise his option.

Put Options:

When purchasing a put option, the buyer has the right but not obligation to sell agreed lots of 100 shares of the stock before the expiration date for a certain price. While the seller has the obligation to buy the stock at the strike price should the buyer exercise his option.

Outlooks:

The table below shows which options you would buy or sell depending on where you believe the stock will move.

 Call OptionPut Option
BuyerBullishBearish
SellerBearishBullish

              The payoffs for each of these scenarios is shown below.

Each Stock Option Contract Contains:

  • Whether holder has right to buy or sell
  • Quantity
  • Strike price, the price where the transaction will occur upon exercise
  • Expiration date
  • Whether writer delivers assets or cash on exercise

Strike Price:

The strike price on options contracts is the price at which an option may be exercised. These prices are fixed into the options contract. For call options it is the price at which the security may be bought up to the expiration date while for puts it is the price the security may be sold at.

Intrinsic and Time Value:
The intrinsic value of an option is its value if it were to be exercised immediately. The calculation is just the difference in stock price versus the price of the option. This means if the underlying securities current price is greater than the options strike price a call has positive intrinsic value while a put has zero value.

Time value refers to the premium that an investor would pay in excess of the current intrinsic value for the right to buy or sell at a future date. This is based on the options potential of increasing in value and arises from the uncertainty of future prices.

In the Money:
Options are considered in the money if the time value and intrinsic value are both positive values. For a call option this occurs when the strike price is below the spot price. For a put option this occurs when spot price is above the strike price.

At the Money:

Options are considered at the money if the time value is positive and the intrinsic value is zero.

Out of the Money:

Options are considered out of the money if they have no intrinsic value. For a call option this occurs when the strike price is above the spot price. For a put option this occurs when the spot price is below the strike price.

American Vs. European Options:

This has nothing to do with the geographical location of where the options are being bought or sold. An American option may be exercised at any time up until and including the options expiration date. European options on the other hand can only be exercised on the contract’s expiration date.

Margin Costs:

Collateral that the holder of a financial instrument needs to put up in order to write the option. This cost can be put up as cash or securities and is deposited in a margin account. decided based on SPAN (Standard portfolio analysis of risk) this set of algorithms was created by the Chicago Mercantile Exchange. The link below details how it is applied.

SPAN link: https://www.cmegroup.com/clearing/risk-management/span-overview.html

Factors Impacting Stock Option Value:

Current value of underlying asset – Options premiums are determined by the underlying value of the asset. As the value of the underlying stock changes so will the premium associated with that option.  

Variance of value in the underlying asset – This refers to the volatility in the stock price. The higher the volatility the more likely the asset will move up and down a lot. This means that there is higher likelihood of your option being in the money at some point before its expiration date. This causes an option to be worth more.

Dividends paid on the underlying asset – Since dividends are only paid out to shareholders options holders do not get to partake. So, dividends paid during the life of the option can reduce the value.

Strike price agreed upon – Strike prices help determine the premium on the price of an option.

Time to maturity/expiration – The longer an option is held the higher the uncertainty of the outcome. So, over a longer time there is a higher possibility of an option being in the money causing the option to be more valuable. The closer the option is to the expiration date the less valuable it becomes.

Risk free interest rates – An increase in Interest rates cause call options to increase in value and puts to decline. A decrease causes calls to decrease in value and puts to increase.

Options Pricing models:

The models used to price and trade options will be covered in the next post along with a case study that applies one of the models to a current option contract. 

© 2021 QUANTT