Expand model tag support: add GLM-5.1, simplify Anthropic IDs, scan tags anywhere in message

- Flink update_bars debouncing
- update_bars subscription idempotency bugfix
- Price decimal correction bugfix of previous commit
- Add GLM-5.1 model tag alongside renamed GLM-5
- Use short Anthropic model IDs (sonnet/haiku/opus) instead of full version strings
- Allow @tags anywhere in message content, not just at start
- Return hasOtherContent flag instead of trimmed rest string
- Only trigger greeting stream when tag has no other content
- Update workspace knowledge base references to platform/workspace and platform/shapes
- Hierarchical knowledge base catalog
- 151 Trading Strategies knowledge base articles
- Shapes knowledge base article
- MutateShapes tool instead of workspace patch
This commit is contained in:
2026-04-28 15:05:15 -04:00
parent d41fcd0499
commit 47471b7700
184 changed files with 9044 additions and 170 deletions

View File

@@ -0,0 +1,73 @@
---
description: "Exploit differences in dividend taxation across jurisdictions by selling stock cum-dividend and repurchasing ex-dividend (or loaning stock to a domestic investor) to capture tax credits unavailable to foreign holders."
tags: [tax-arbitrage, equities, cross-border, dividends]
---
# Cross-Border Tax Arbitrage
**Section**: 13.2 | **Asset Class**: Equities (Cross-Border) | **Type**: Tax Arbitrage
## Overview
The U.S. double-taxes corporate income: once at the corporate level and again when dividends are received by shareholders. Some countries (e.g., Australia, Singapore) use imputation systems that relieve this burden by attaching tax credits to dividend payments. Foreign investors in such markets generally do not receive these tax credits, creating an arbitrage opportunity around dividend dates.
## Construction / Mechanics
Under a full dividend imputation system, the tax mechanics per dollar of corporate income `P` are:
```
Corporate tax rate = τ_c
Cash dividend paid = D
Dividend tax credit = C = D × τ_c / (1 - τ_c)
Taxable income = I_t = D + C = D / (1 - τ_c) (496)
Personal tax rate = τ_p
Personal income tax = T = I_t × τ_p
Dividend income after credit = I = D + C - T = D × (1 - τ_p) / (1 - τ_c)
```
When `D = P(1 - τ_c)` and `I = P(1 - τ_p)` there is no double-taxation. The price drop from cum-dividend to ex-dividend, in the presence of tax credits, is expected to be `D(1 + κ)`, where `κ` is the tax credit rate (`1 + κ = 1/(1 + τ_c)`).
A foreign investor who holds the stock is penalized relative to a domestic investor. **Arbitrage strategies:**
1. **Stock sale/repurchase**: Foreign investor sells the stock cum-dividend at `S_0` and buys it back ex-dividend
2. **Stock loan**: Foreign investor loans the stock to a domestic investor cum-dividend and receives the stock back ex-dividend along with a preset portion of the tax credit
## Return Profile
Profits are realized around dividend dates. The P&L from either approach approximates the value of the tax credit that the domestic investor can claim. Returns are event-driven and concentrated at dividend announcements.
## Key Parameters / Signals
- **Tax credit rate** `κ`: defined by the local corporate tax rate; `1 + κ = 1/(1 + τ_c)`
- **Cum-/ex-dividend dates**: the arbitrage window is narrow; execution must occur between these dates
- **Transaction costs**: must be below the value of the tax credit for the strategy to be profitable
- **Jurisdiction restrictions**: some markets restrict cross-border tax arbitrage; legal/regulatory due diligence required
## Variations
### 13.2.1 Cross-Border Tax Arbitrage with Options
In the absence of a tax credit, there is a theoretical upper bound on American put option value:
```
V_put(K, T) ≤ V_call(K, T) - S_0 + K + D (497)
```
With a tax credit, put prices are expected to be higher (reflecting the credit). A foreign investor can:
- Sell the stock cum-dividend at `S_0`
- Write a deep ITM put option
Near expiration, the put value is approximately:
```
V_put(K, T) = K - [S_0 - D(1 + κ)] (498)
```
The P&L once the put is exercised ex-dividend at strike `K`:
```
P&L = S_0 + V_put(K, T) - K = D(1 + κ) (499)
```
This achieves the same economic result as the stock loan/swap approach, monetizing the full dividend plus tax credit.
## Notes
- A swap agreement between foreign and domestic investors can also achieve the same result as the stock loan
- Regulatory risk is significant: many jurisdictions have enacted rules specifically to prevent cross-border dividend tax arbitrage (e.g., anti-avoidance provisions, minimum holding period requirements)
- The options-based variation (13.2.1) requires liquid options markets with deep ITM puts available at reasonable bid-ask spreads
- Legal and tax counsel is essential before implementing; what is permissible varies substantially by jurisdiction pair

View File

@@ -0,0 +1,50 @@
---
description: "Borrow at short-term taxable rates and buy tax-exempt municipal bonds, capturing the after-tax spread where tax deductibility of interest expense creates a net positive return."
tags: [tax-arbitrage, fixed-income, municipal-bonds]
---
# Municipal Bond Tax Arbitrage
**Section**: 13.1 | **Asset Class**: Fixed Income (Municipal Bonds) | **Type**: Tax Arbitrage
## Overview
One of the most common and simple forms of tax arbitrage. The strategy borrows money (short-term loan) and uses the proceeds to buy tax-exempt municipal bonds. It is attractive to companies in jurisdictions where tax rules allow both buying tax-exempt muni bonds and deducting interest expenses from taxable income (the "tax shield"), creating a positive after-tax spread.
## Construction / Mechanics
- **Long**: tax-exempt municipal bonds earning interest rate `r_long`
- **Short (borrowed funding)**: corporate loan at interest rate `r_short`
The strategy return is:
```
R = r_long - r_short × (1 - τ) (495)
```
- `r_long` = interest rate on the purchased municipal bonds
- `r_short` = interest rate on the loan
- `τ` = corporate tax rate
The loan interest is tax-deductible, so the effective borrowing cost is `r_short × (1 - τ)`. For `R > 0` (profitable), we need:
```
r_long > r_short × (1 - τ)
```
## Return Profile
The strategy profits as long as the municipal bond yield exceeds the after-tax borrowing cost. Returns are stable and bond-like in normal markets but exposed to credit events on the muni bonds and to changes in tax law. The tax shield on borrowing is the core structural advantage.
## Key Parameters / Signals
- **Corporate tax rate** `τ`: higher tax rates make the strategy more attractive (lower effective borrowing cost)
- **Muni yield** `r_long`: tax-exempt; higher quality munis yield less
- **Borrowing rate** `r_short`: short-term rates affect the after-tax funding cost
- **Jurisdiction**: only viable where tax rules permit both the tax-exempt income and the interest deduction simultaneously
## Variations
- **Leveraged muni carry**: increase leverage to amplify the spread, at the cost of higher interest rate and credit risk
- **Duration-matched**: match the duration of muni bonds and the borrowing to reduce interest rate risk
## Notes
- Regulatory and tax law risk: changes in tax law can eliminate the tax shield or the tax-exempt status of munis
- Credit risk: municipal bonds can default, though historically at low rates
- Liquidity risk: municipal bonds are less liquid than Treasuries
- Only practically accessible to corporate entities (not individuals) with sufficient tax liability and access to cheap funding