Ligang Yan
Software engineer based in Halifax, Canada, focused on applying AI/ML to finance and quantitative investing. This blog is where I write about life and what I learn along the way.
- Finishing Campus2Market Discover: What Seven Weeks of Entrepreneurship Training Taught MeI completed Dal Innovates' seven-week Campus2Market Discover program. Four lessons: fall in love with the problem, how to run customer interviews, the constraints hiding in a business model, and why pitching forces clarity. Plus SweetValueLab, which I refined along the way.

- First Place at RBC HubHacks 2026: An AI Fish-Counting Workspace for a Conservation Charity, Built in Five DaysOur team, The Coastal Coders, won first place on the Coastal Action problem at RBC HubHacks 2026. What the brief was, what Tideflow does, how we went from a single detection model to a full platform in five days, and what we learned from the pitch and the judges.

Finished “量化交易从入门到精通:如何构建你的算法交易系统”[加]欧内斯特·陈- Can You Store It, Show It, Sell It? What the Terms of 29 Market Data Sources AllowI read the terms pages of 29 US market data sources. Ten let you store, show and commercially use their data, and every one of those is public-domain data. None of the nine price APIs lets you show prices to your users on a self-serve plan.

- US vs Canada government benefits compared (2026)One table covering the main government benefits in the US and Canada: retirement, health care, unemployment, children, food, home buying, student aid and more across 17 categories, with amounts as of October 2026.
- LU Decomposition by Hand: Splitting a 3×3 Matrix into L·ULU decomposition is Gaussian elimination with the work saved: U is what elimination leaves behind, L records how many times each row was subtracted. Working one 3×3 matrix all the way through, then using it to solve equations and get a determinant, why row swaps are needed (PA = LU), and what it's actually good for.
- SVD by Hand: Splitting a 2×3 Matrix into UΣVᵀSingular value decomposition breaks any matrix into a rotation, a stretch and another rotation. Working one 2×3 matrix all the way through: eigenvalues of AAᵀ, square roots for the singular values, U and V column by column, and a check that multiplies it all back. Along the way, why the square root and why signs can go wrong.
- A Vibe Coding Guide: Mistakes I Made and a Self-Check List for Your AIWhat I learned from 787 commits written with Claude and some forty mistakes along the way. Every item comes with a self-check prompt: paste the whole post into your AI and it can go through your project item by item.
- Gradient Descent, Line by Line: Twelve Lines of Python and the Calculus Behind ThemA twelve-line function fits the best straight line through a cloud of points: it starts flat at zero and 900 times over asks which way is less wrong. Taking it apart one line at a time — what a gradient actually is, where the formulas come from, why the minus sign, and what alpha does.
- Rebuilding my personal site on Astro and Cloudflare WorkersThe first post on the new site, on why I picked this stack and how the site is meant to grow.
- 2025 关税冲击全纪录七周 −18.9%,一天 +9.52%,十一周后创新高——全程由政策而非基本面驱动。按真实日线还原完整时间线,附 VIX 路径与四条复盘。历史复盘
- 基础材料板块手册从挖矿到卖螺丝,五个子板块、五种生意、五套估值锚。周期股为什么低市盈率反而是卖出信号,以及周期每个阶段该盯什么。不含任何当前行情。板块手册
- 六个月后回看2026 年 3 月写的六份个股报告,每份都设了止损、加仓和止盈价位。用真实日线逐条对账:哪些触发了,哪些没有,以及一份把止损和加仓画进同一个 13 美元区间的计划。研报对账
- 八篇财报快报,五个月后四月两天里写的八篇 Q1 财报快报,同一套模板、同一个宏观变量。五个月后六只金融股等权 +8.8%,XLF 是 +8.4%——六份深度分析换来 0.4 个百分点,还没扣成本。整批对账
- ◆ This site went live
- Costco, two enginesOne membership card, two engines that depend on each other: merchandise makes no money so members renew, and the fees are the profit. Placing 45× earnings inside Costco's own twelve-year history to work out which year, and what growth, the market is paying for.Two-engine breakdown + reverse-engineered pricing
- SpaceX, taken apartOne company, three completely different businesses. Space, Connectivity and AI are valued separately against their own peers and added back together, to see which assumptions a buyer at $151 is paying for.Sum-of-the-parts valuation
- Does Canada really have no estate tax? The real gap between the two countries' death taxesCanada has no estate tax but it has deemed disposition: every unrealised gain is taxed at once on the final return, and an RRSP is included at 100%. The US has step-up in basis and a $15 million exemption. Four household scenarios with the bill worked out, plus a trap few people know about: a Canadian holding more than $60,000 of US stocks has a US estate-tax filing obligation.
- One causal chain for US equities in H2 2026From the Iran war to the QQQ drawdown in eight steps: imported inflation, a Fed debating hikes, a higher discount rate, and why long duration got hit first. Three scenarios, then two places on the chain to act: EOG as the hedge, Alphabet as the offence.Macro · eight steps · two stocks
Finished “金钱心理学 (全新增订版)”[美]摩根·豪泽尔“14条通往财务独立之旅的建议”
Finished “专业投机原理(典藏版)”维克托·斯波朗迪“书名叫”投机原理”,实际读下来更像一本关于决策纪律和自我认知的书。书中融入了大量心理学、经济学、政治学的内容,不是单纯的技术图表”- Hong Kong participating insurance, taken apart: structure, commissions, sales scripts, and how it compares to just investingThe guaranteed part is about 1%; the illustrated 6 to 7% only approaches after twenty or thirty years, and break-even usually takes 15 to 20. First-year commissions once reached 100% of first-year premium. It does not escape CRS reporting and is not a compliant way to move mainland renminbi offshore. All of that laid out, then compared with term life and an index fund.

Finished 2 books《跨境物流及海外仓:市场、运营与科技》, 《跨境电商:亚马逊从零到年销千万实战手册》- Importing from China to Canada, end to end: 22 steps, 9 parties, one cost checklistUsing my first small shipment of EV charging accessories from a factory in Guangdong to my home in Halifax as the example: Incoterms, what a freight forwarder actually does, CARM registration, HS codes, cUL certification, bills of lading and telex release, customs and taxes, and the trap of clearing under someone else's name.
- The Coca-Cola "Dividend Arbitrage" Is an IllusionBuy before the ex-dividend date, sell after, and pocket the dividend for free? The price drops by the dividend amount on the ex-date. The people claiming they made a thousand dollars in a few days made it on the share price — and the post is usually an ad for tokenized stock.
- Solar From First Principles: From Car-Roof Panels to Intermittent Compute as Buyer of Last ResortSolar already beats farming per square metre, and cells are already cheap. What actually stops us covering the world is deployment cost and the fact that electricity can't be boxed up and shipped like tomatoes. Breaking the cost down per square metre, then looking at one path out.
Finished “聪明的投资者(第4版,注疏点评版)”[美]本杰明·格雷厄姆 [美]贾森·兹威格 著- CurioSeed V4: stack choices and how a small team works with AIThe key decisions behind CurioSeed V4, laid out with their costs: Supabase or Neon, React SPA or Next.js, client-side fetching or SSR, when to split into a monorepo, and a working method of people plus AI plus rule guardrails. Every choice comes with the pitfalls we hit.
- Visited HangzhouZhejiang · 5 photos



- Visited YantaiShandong · 2 photos


- A Claude-centric software architectureFor thirty years, software has meant humans translating changing requirements into fixed code. Once a runtime like Claude Code is strong enough, the more efficient approach is to separate the two: settle deterministic logic into a data layer, a function layer and Skill methodology, and hand the uncertain requirements to the runtime to understand and render in real time. With quant-researcher as a worked example.
Finished “一本书读懂财报”肖星
Finished “巴菲特致股东的信:投资者和公司高管教程(原书第4版)”沃伦E.巴菲特 劳伦斯A.坎宁安
Finished “彼得·林奇的成功投资(典藏版)”[美]彼得·林奇 [美]约翰·罗瑟查尔德- Three things every AI agent engineer should know: agent architecture, prompt engineering, and MCPA platform-agnostic guide: the agentic loop and multi-agent orchestration, context passing and error propagation, few-shot and structured output, controlling false positives, and the structure, message format and a minimal server implementation of the Model Context Protocol.
Finished “巴菲特的护城河”[美]帕特·多尔西- Real-time updates from NestJS to Next.js with Server-Sent EventsA step-by-step tutorial: expose an SSE endpoint from NestJS with an RxJS Subject, consume it in Next.js with a small useSse hook, and push events from any service in your backend. Simpler than WebSockets when the data only flows one way.
- Visited Los AngelesCalifornia · 4 photos




- What is dollar-cost averaging, and how do you do it?Why DCA works in volatile markets and trails a lump sum in rising ones, how value averaging and enhanced DCA work, and what actually matters over thirty years.Explainer
- Valuing a stock by discounting: is the price reasonable?What goes into a discount rate, why a perpetual bond is worth D/r, the constant and growing dividend models, free-cash-flow discounting, and why one company can come out ten times apart depending on the model.Explainer
- NuScale Power: the holy grail of AI-era energy, or a capital bubble?The only small modular reactor design with full US NRC certification, the AI data-centre power gap, the failed Utah project, the cash runway, and who is catching up. A dated view from November 2025.Research note
- Goodbye Photoshop? Ten everyday image edits done with Gemini Nano-Banana promptsForget layers and tool palettes. Ten common image-editing jobs, from cutting out a background to style transfer and outpainting, each with the traditional Photoshop workflow and the single Nano-Banana prompt that replaces it.

- Google's official prompting guide for Nano-Banana, annotatedWhat Gemini 2.5 Flash Image (Nano-Banana) can do, the one principle behind good prompts (describe the scene, don't list keywords), and Google's example prompts for photorealistic scenes, stickers, logos, product shots, editing, inpainting, style transfer and multi-image composition.
- Visited OrlandoFlorida · 4 photos




- How to Design a PDF Text-to-Speech Service Like SpeechifyText-to-speech (TTS) services have become a popular tool for making content more accessible, providing convenience for users who prefer listening to their text rather than reading it. One of the most well-known TTS platforms is Speechify, which converts digital text, including PDFs, into high-quality audio. When I embarked on building a PDF text-to-speech service similar to Speechify, I faced several challenges and opportunities. In this article, I’ll take you through the steps of how I system-designed this service, from understanding user needs to choosing the right technology stack and scaling the solution.

- How I Passed AWS Certified Developer Associate ExamI recently passed the AWS Certified Developer Associate exam. Here are some tips and resources that helped me prepare for the exam.

- What story does Black Myth: Wukong tell?Black Myth: Wukong is a video game developed by Chinese indie developer Game Science. The game is based on the classic Chinese novel Journey to the West and tells the story of Sun Wukong, the Monkey King. In this article, we will explore the story of Black Myth: Wukong and how it relates to the original novel.
- How to add bilingual subtitles to a YouTube videoA workflow that actually runs: downloading the original captions, the sentence-boundary problem when machine-translating them, adding soft subtitles with a Chrome extension or burning hard subtitles with ffmpeg, and the trade-offs I made building Suinfy.

- How I prepare for the final-round interviewIn North America the last round is usually with the hiring manager: short, unpredictable, and decisive. My method is to write out every likely question and its answer in advance. Here are the questions I prepared, the frameworks I used, and a few real stories.
- How to Design Uber Eats: A System Design Mock InterviewThis blog post summarizes a mock interview discussion on designing a system like Uber Eats. It explores the technical considerations involved in building a large-scale food delivery platform.
- How to design Amazon Prime Video: A System Design Mock InterviewThis blog post summarizes a mock interview discussion on designing a minimalist version (MVP) of Amazon Prime Video. It explores the core functionalities and considerations for building a large-scale video streaming platform.
- How to Design a Shopping Cart Page: A System Design Mock InterviewA shopping cart page is a crucial component of any e-commerce website, allowing users to review and modify their selections before making a purchase. Designing an effective shopping cart page requires careful consideration of both functional and non-functional requirements. This blog post summarizes a mock interview discussion on designing a shopping cart page, exploring the core functionalities and considerations for building a scalable e-commerce platform.
- How to Deploy Ollama Server on Amazon EC2 with GPU in 10 MinutesThis guide is ideal for individuals or small teams building their own open source local large language model (LLM) AI capabilities in the cloud, ensuring data privacy, customizability, regulatory compliance, and cost-effective AI solutions.

- A React Native client for NodeBB: swapping a Firebase login for an API tokenNodeBB is an open-source Node.js forum whose mobile experience is mediocre. I built a React Native client for it, and the two problems worth writing down are third-party sign-in and automatically exchanging that sign-in for a NodeBB API verifyToken.
- Six React ref challenges. How many can you get?When to use a ref and when to use state, why a module-level variable gets shared across components, how to drive a video and a scroll position with refs, and how forwardRef works. Six problems, each with the broken code and the fix.
- November 2023: a look at Halifax real estateAfter landing in Halifax I spent a few weekends touring houses. Neighbourhood by neighbourhood (Bedford, Clayton Park, Beechville, West End, Long Lake, Downtown), a dozen listings, the rent-to-price ratio and gross yield worked out, and where I thought prices were heading.
Finished “动物庄园(英文版)”乔治·奥威尔
Finished “深入浅出Pandas:利用Python进行数据处理与分析”李庆辉
Finished 2 books《垃圾回收的算法与实现》, 《Python深度学习》
Finished “Python神经网络编程”塔里克·拉希德
Finished “编码:隐匿在计算机软硬件背后的语言”查尔斯.佩措尔德
Finished “一生的旅程:迪士尼CEO自述”罗伯特·艾格 乔尔·洛弗尔
Finished “未来简史:从智人到智神”尤瓦尔·赫拉利
Finished “被讨厌的勇气:“自我启发之父”阿德勒的哲学课”[日]岸见一郎 [日]古贺史健
Finished “合伙创业:合作机制+股份分配+风险规避”曹海涛
Finished “新零售:低价高效的数据赋能之路”刘润
Finished 2 books《私域流量》, 《亚马逊跨境电商运营宝典》
Finished “算法图解”巴尔加瓦
Finished “显微镜下的大明”马伯庸
Finished “流浪地球”刘慈欣
Finished “自卑与超越”阿尔弗雷德·阿德勒
Finished “中央帝国的财政密码”郭建龙
Finished “基因传”悉达多·穆克吉
Finished “自私的基因(20世纪经典著作)”理查德·道金斯
Finished “邓小平时代”傅高义
Finished “明朝那些事儿(全集)”当年明月
Finished “干法”稻盛和夫
Finished “创京东(刘强东亲述创业之路)”李志刚
Finished “从0到1:开启商业与未来的秘密”彼得·蒂尔 布莱克·马斯特斯
Finished “黑客与画家(10万册纪念版)”保罗·格雷厄姆
Finished “腾讯是怎么长大的”吴晓波
Finished “一分钟经理人(新版)”肯·布兰佳 斯宾塞·约翰逊
Finished “零售的哲学”铃木敏文“唯一不变的就是用户不断变化的需求
”
Finished 2 books《上市公司财报分析实战》, 《重新定义公司 谷歌是如何运营的(奇点系列)》
Finished “增长黑客:创业公司的用户与收入增长秘籍”范冰
Finished “上瘾:让用户养成使用习惯的四大产品逻辑”尼尔·埃亚尔 瑞安·胡佛
Finished “区块链:定义未来金融与经济新格局”火币网 张健
Finished “战胜华尔街Beating the Street(修订版)”彼得·林奇 约翰·罗瑟查尔德
Finished “指数基金投资指南(雪球「岛」系列)”银行螺丝钉
Finished “投资中最简单的事”邱国鹭“知易行难
”
Finished “白夜行”东野圭吾“深夜看完了全书,被深深吸引。好久没这种感觉
”
Finished “人类简史:从动物到上帝”尤瓦尔·赫拉利- ◆ Joined WeChat Reading
- ◆ First day as a programmer