Tuesday, February 24, 2026

Some little learning

I like watching Michelle interviewing Stevie. Not so much Rico Hizon or Richard Heydarian (they both inject too much of themselves into the interviews).

I watched this stevienomics video today and wondered about the details of some things Stevie was talking about but didn't describe in detail. There's no transcript (that might happen later, but there's none as I watched it). 

There is a gemini AI I can ask things but it wouldn't look outside the video to explain things. Instead, it would only talk about what the people in the video said. I can work with that though. So I asked it to give me a long and detailed discussion of the video. I took that response and pasted it into other AI browser window. I did tell it which parts of the discussion I wanted more information about. So, a long paste (what I asked chatgpt):
see this summary of a video: 
"The video features Stephen CuUnjieng, a former global investment banker and independent director at the Maharlika Investment Corp., discussing the challenges faced by the Philippine stock market, particularly its lack of liquidity, and offering solutions based on systems used in other markets.
CuUnjieng expresses frustration with the Philippine stock market, noting that its index and share prices are at the same level as 12 to 13 years ago, effectively having moved backwards (9:51 - 10:28). He attributes this underperformance partly to the setup of the country's capital markets for equities and partly to structural issues within the country (10:06 - 10:11). He points out that globally, the most popular industries that grew last year were tech and manufacturing, whereas the Philippines tends to focus on "boring" sectors like real estate, malls, and infrastructure (10:30 - 10:44). Without locally owned tech or significant manufacturing outside of food, the Philippine market struggles to perform in line with regional peers (10:47 - 11:03). 
A core issue, according to CuUnjieng, is the lack of liquidity in the Philippine market (11:22 - 11:31). He states that small cap stocks become "even smaller" because there is no liquidity (11:25 - 11:31). He suggests that fixing this is "easy" by looking at other markets (11:35 - 11:37). 
He then details the specialist system used in the New York Stock Exchange: 
Role of a Specialist: A specialist takes inventory of the stock they specialize in. When a company lists on the NYSE, specialists must be approved and bid for (11:46 - 12:19). Ensuring Liquidity: The primary function of a specialist is to ensure there is always an offer to buy and an offer to sell (12:23 - 12:27). This creates perpetual liquidity, meaning that a trade can always occur, even if the price, spread, or volume might not be ideal for the transacting parties (12:27 - 12:41). 
Capital Provision: The specialist provides capital by continuously maintaining an inventory of the stock (15:52 - 15:54). Proportional Liquidity: While a 100 million market cap company won't have 100 million worth of liquidity, there is proportional liquidity for listed stocks (12:54 - 13:09). 
Obligation for Listed Companies: The speaker suggests making it an obligation for listed companies to follow a system akin to the NYSE, to avoid "phantom stocks" that are listed but not traded (13:29 - 13:41). 
CuUnjieng contrasts this with the Philippine market, where once you go beyond the top 10 or 20 stocks, everything "trades by appointment," meaning one has to find out if there's stock for sale or if someone will buy it, indicating a lack of liquidity (17:46 - 17:51). He highlights the problematic situation of stocks being suspended from trading for years, preventing them from being truly on or off the market (18:05 - 18:18). 
He also briefly mentions market makers in the NASDAQ system, noting that while NASDAQ doesn't have specialists, most major and even mid-sized NASDAQ stocks have appointed market makers to provide a level of organized trading. This system is not as formal as a specialist system, but it serves a similar purpose (17:03 - 17:18). 
The speaker concludes that the poor liquidity in the Philippine stock market is a significant problem, with less than 40% of trading being by Philippine retail investors, unlike other frontier markets like Vietnam, Thailand, and Malaysia where the majority of trading is done by local institutions and individuals (14:14 - 14:39). This poor liquidity discourages investment because even in small stocks, investors need to know they can sell if they change their minds (14:47 - 14:53). He insists that solutions, like adopting a specialist or market maker system, are available and already in use elsewhere (16:24 - 16:26)." 
[and I added this, what I actually want to know] discuss how the specialists or market makers actually work at the NYSE and Nasdaq in his examples. how does that actually work in the real world? esp when there is too much demand and the specialist's inventory runs down, or when sentiment goes very bad and the specialist's inventory goes very high and the price goes very low? does the specialist keep buying when demand is too low? in the normal case, that can easily work. but how does it work at the edges? very high prices might be very risky since it might be sentiment and sentiment might reverse quickly. very low prices are also risky since it might never recover. how does the specialist stay afloat?
I learned from the answer. There may be bits that are wrong. I'm sure there are bits that I misunderstand, but this is a good thing to learn from.  I may come back and change those lists into actual lists.  I'll leave them as-is for now.

===>

Stephen CuUnjieng is basically referring to two related but structurally different systems:

* The **Designated Market Maker (DMM)** model at the New York Stock Exchange
* The **market maker / dealer** model at NASDAQ

They both aim to ensure continuous two-sided markets (a visible bid and offer), but how they actually manage risk—especially at the extremes—is where the real mechanics matter.

---

# 1. How It Works at the NYSE (Designated Market Makers)

The old “specialist” system evolved into today’s **Designated Market Maker (DMM)** model.

## Core Mechanics

Each listed stock has:

* One assigned DMM firm
* Obligations to maintain a **fair and orderly market**
* Capital committed to that name

In normal conditions:

* The DMM posts both bids and offers.
* They earn the **bid-ask spread**.
* They step in when natural buyers/sellers temporarily disappear.
* They dampen short-term volatility by absorbing imbalances.

Most trading today is electronic and competitive. The DMM is not the only liquidity provider—but they have special obligations during stress.

---

## What Happens When Demand Is Extremely High?

Example: sudden surge of buyers, few sellers.

What happens:

1. The DMM’s inventory is sold down.
2. The price rises.
3. The DMM widens spreads.
4. The DMM raises the offer price to attract sellers.
5. If volatility becomes extreme → trading pauses (LULD halts).

Crucially:

> The DMM is not required to sell infinite inventory.

They manage risk dynamically:

* Adjust prices upward.
* Reduce quoted size.
* Hedge exposure (e.g., with ETFs, index futures, options).
* Use volatility pauses to restore order.

In extreme cases (e.g., IPOs or big news), the DMM may conduct an **auction opening**, gathering supply and demand before setting a clearing price.

They are liquidity providers—not price defenders.

---

## What Happens When Sentiment Collapses?

Example: heavy selling, no buyers.

The DMM may:

* Step in and buy shares into inventory.
* Provide stabilizing bids.
* Slow down the decline by narrowing price gaps.

But again:

> They are not obligated to catch a falling knife indefinitely.

As selling continues:

* They lower bids.
* Widen spreads.
* Reduce size.
* Hedge exposure.
* Let price find a lower equilibrium.

If the stock becomes structurally impaired (fraud, bankruptcy risk), they do not keep buying endlessly.

---

## How Do They Avoid Blowing Up?

They survive because:

### 1. Capital Requirements

DMM firms are large broker-dealers with substantial capital.

### 2. Diversification

They manage hundreds of stocks—not just one.

### 3. Hedging

If long inventory:

* Short index futures
* Use options
* Pair trade similar stocks

### 4. Spread Economics

In volatile markets, spreads widen → they earn more per trade.

### 5. They Adjust Prices Aggressively

Liquidity is always available—but at a price.

There is no promise of “cheap liquidity.”

---

# 2. How NASDAQ Market Makers Work

At NASDAQ, there is no single assigned specialist.

Instead:

* Multiple competing market makers per stock
* All quote continuous two-sided prices
* Fully electronic dealer market

Each market maker:

* Holds inventory
* Earns spreads
* Adjusts quotes based on risk

Because there are many market makers, liquidity comes from competition rather than a single obligated party.

---

## At the Edges on NASDAQ

### When Demand Surges:

* Market makers sell inventory.
* Raise offers quickly.
* Reduce size.
* Hedge.

If volatility is extreme:

* Quotes may widen dramatically.
* Liquidity thins.
* Trading halts can occur.

### When Selling Is Heavy:

* Market makers buy selectively.
* Lower bids as risk increases.
* Eventually step away if risk becomes unmanageable.

Again, they are not required to go bankrupt supporting a stock.

---

# The Key Insight: Liquidity Is Price-Dependent

CuUnjieng is correct that the system creates “perpetual liquidity.”

But what that really means is:

> There is always a price at which someone will trade.

At the edges:

* Liquidity becomes expensive.
* Spreads widen.
* Prices move fast.
* Inventory risk is managed dynamically.

Liquidity is not price support.

---

# What Happens in True Crises?

Look at:

* The 2008 financial crisis
* The March 2020 COVID crash

Even on the New York Stock Exchange and NASDAQ:

* Spreads widened massively.
* Circuit breakers triggered.
* Some liquidity providers pulled back.
* Prices gapped violently.

Market makers survived by:

* Rapid repricing.
* Hedging.
* Cutting inventory.
* Letting prices clear lower.

The system bends—but doesn’t promise stability.

---

# So Does the Specialist Keep Buying When Demand Is Too Low?

Only temporarily and only at rational prices.

They:

* Provide transitional liquidity.
* Slow disorderly markets.
* Help discovery.

They do NOT:

* Defend specific prices.
* Guarantee recovery.
* Absorb infinite supply.

If a stock is fundamentally impaired, it can still collapse.

---

# Why This Still Helps vs Illiquid Markets

In very illiquid markets (like the one CuUnjieng criticizes):

* There may be **no bid at all**.
* Trades happen “by appointment.”
* Price discovery is unreliable.
* Investors demand a liquidity discount.

Even imperfect liquidity provision:

* Reduces fear of being trapped.
* Narrows spreads.
* Increases participation.
* Lowers cost of capital.

That’s the real benefit.

---

# Final Reality

Specialists and market makers survive because:

* They dynamically adjust prices.
* They hedge.
* They diversify.
* They are well-capitalized.
* They are not required to defend prices.

Liquidity is continuous—but not free.

At the edges, the market clears at painful prices.

That’s how they stay afloat.

Thursday, February 01, 2024

Speeding up VirtualBox Windows clients -- disable nested virtualisation

I previously used Hyper-V to run Windows clients on a Windows host. That worked well until a networking setup that I needed stopped working. After a lot of trying to get Hyper-V to work as I needed it to, I finally gave up and tried to use VirtualBox (without the extensions). The networking setup I needed was straightforward but the Windows client was painfully slow. After many hours of trying many things, it turns out all I needed to do was disable Nested virtualization. Now that that's not enabled (I don't need virtual machines to run inside the Windows client), VirtualBox is about as fast as Hyper-V was. Much more usable now and I think maybe even less memory hungry than Hyper-V used to be. But I maybe wrong about the memory. I gave Hyper-V up to (through dynamic memory allocation) 6GB of RAM and it was fine. I don't see how to get the VirtualBox VM to use memory dynamically so I've given it 2GB of RAM. It's running my automated tests very well. I'm going to have to try giving it fewer CPUs (maybe just 2 or 3) and then run two or three VMs :-). The things we do for fun :-).

Monday, December 19, 2022

Saturday, May 29, 2021

Have running ssh sessions (and new sessions) keep working even with openvpn changing default route

 I installed openvpn on a remote server and had my ssh sessions break because the default route had been changed and so, packets sent to me (at client) were going out through the VPN and, presumably, either not landing at my computer or being rejected due to incorrect source address.

I paste below a solution which I COMPLETELY don't understand.  They do work though.  I just pasted them into /etc/rc.local

ip rule add from $(ip route get 1 | grep -Po '(?<=src )(\S+)') table 128
ip route add table 128 to $(ip route get 1 | grep -Po '(?<=src )(\S+)')/32 dev $(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)')
ip route add table 128 default via $(ip -4 route ls | grep default | grep -Po '(?<=via )(\S+)')

https://serverfault.com/a/918441

Friday, April 30, 2021

cssh font size

The default clusterssh font size on my big monitors was too small.  

To fix this:

On Ubuntu 18.04

  1. just edit ~/.clusterssh/config

  2. change terminal_font=[whatever] with 12x24.  This increases the font size but the window dimensions then become too big.  

  3. Also change the terminal_size.  That was 80x24 originally.  Changing that to 70x40 allows me to (along with terminal_font=12x24) have two cssh terminals on one landscape 1920x1080 monitor.  Since I usually have 4 terminals, that's perfect for 4 terminals on two landscape monitors with some extra space for the cssh dialog for typing into all the terminals at once.


I really should learn tmux though.  tmux is supposed to have reasonable cssh like functionality.  But I'm so used to screen commands I'm not looking forward to learning new keystrokes.

Wednesday, February 17, 2021

some jmeter conveniences

In jmeter I recently had reason to set these (can be in jmeter.properties or user.properties).

 

CookieManager.save.cookies=true
view.results.tree.max_results=0

 

The first is to have cookies be available as variables and the second is because (to save RAM, probably) jmeter GUI doesn't show everything when you load a jtl file. The second makes it show all results.

Friday, January 01, 2021

Apparmor and empty man pages on old kernels

 On my odroid HC4, the kernel is the stock 4.9.x from hardkernel.  I haven't gotten around to switching to mainline since I do like petitboot and don't want to have the little box connected to a monitor while figuring things out.  It does work as-is, just with some small issues.

For instance, man doesn't render man pages. 

https://bugs.launchpad.net/ubuntu/+source/man-db/+bug/1778684

The workaround is to disable apparmor for /usr/bin/man.  I should just upgrade the kernel, really.  But for now:

apt install apparmor-utils
aa-disable /usr/bin/man