Skip to content

andrewlengly.com/alwaysup-casestudy :: alwaysup case study

# A portfolio viewer that refuses to show a loss. It flips a red chart so the line climbs, and tells you it did.

designed page ......... /alwaysup-casestudy

THE SHORT VERSION

  AlwaysUp is a joke portfolio viewer that mirrors a losing chart about the price you paid,
  so a loss is drawn as a gain of the same size. It is a parody about how a red number can
  ruin a morning, and it says so on every screen. It is built with React, Vite and Framer
  Motion, and it is public on GitHub with 77 unit tests.

the idea .............. Checking a portfolio costs me more in mood than it does in money. So
                        I built an app that won’t show me a loss.
what i did ............ Wrote the flip as one line of math, made it something you can tap,
                        drag and hold, and labeled every screen with what was done to it.
where it stands ....... Live and public on GitHub. It’s a joke, and nobody should invest
                        with it. The live deploy runs on simulated prices.

kind .................. Case study · Build
role .................. Designer and developer
year .................. 2026
tools ................. React, Vite, TypeScript, Framer Motion, Tailwind CSS, Vitest, Claude
                        Code

the brief ............. What if a portfolio app never showed a loss, and admitted it on
                        every screen? A joke, labeled as one.
what it does .......... A joke portfolio viewer that mirrors a losing chart about the price
                        you paid, with one line of math and 77 tests.

WHY I BUILT IT

  # A red number can ruin a whole morning.

  The hardest part of investing, for me, isn’t picking anything. It’s what a red number does
  to the next hour, over a position I wasn’t going to touch anyway.

  The position is the same whether I look or not. I look anyway. So I made an app that shows
  the number going up, every time, and is completely upfront that it’s lying.

WHAT IT DOES

  # Losing charts get flipped so the line climbs.

  # The whole trick
p′ .................... 2a − p, a reflection of every price p about an anchor a
  The anchor is the price you paid, or the opening price when you’re still in profit. The
  shape stays exactly the same and the direction inverts, so a 6.37% slide becomes a 6.37%
  climb.

  # The four cases
  Up today, up overall
    does .............. Nothing. Nothing on screen is a loss.

  Down today, up overall
    does .............. Mirrors the day about the open.

  Down today, down overall
    does .............. Mirrors about what you paid. One flip fixes the day and the position
                        together.

  Up today, down overall
    does .............. Lifts the line clear of what you paid. A mirror would throw away the
                        green day.

  # Three comfort levels
honest ................ No flip. Red is red.
comfort ............... Losses are mirrored and gains are left alone. This is the default.
delulu ................ Every chart climbs. Down moves are folded upward and damped, so the
                        line never loses ground.

KEEPING IT A JOKE

  # It lies on purpose, so it has to say so everywhere.

  AlwaysUp is a parody. It isn’t investment advice, it can’t trade, and it never tells
  anyone what to buy. A chart that looks real and isn’t could still fool someone, so the app
  keeps reminding you what it is.

  # How it keeps reality one tap away
a banner on every screen
                        “A joke app. The charts are flipped on purpose. Don’t invest with
                        it.”
a disclosure first .... Before any number shows, you have to accept a screen that opens with
                        “This app lies to you on purpose.”
a badge that names the trick
                        The header says Mirrored, Lifted or Showing reality, and it can’t be
                        dismissed.
flip it back anytime
                        Tap a chart, drag the mirror track or press and hold to see what
                        really happened.
screen readers get the truth
                        Every chart carries the real price action and the real profit or
                        loss for assistive tech.
fake data is labeled
                        When real prices can’t be fetched, every invented one carries a
                        Simulated tag in every mode.

HOW I BUILT IT

  # I built the flip first, then made it something you can play with.

  # The eight commits on main, in five steps
  01. First build
      The mirror on fictional tickers
      Simulated prices on a seeded walk
  02. Real companies
      Live prices from Yahoo Finance
      Tap, drag and hold to flip
  03. A badge
      The parody stickers came off
      Added: A badge that names the operation in force
  04. What you paid
      The mirror anchored on your cost
      A lift for the case a mirror can’t fix
  05. Demo video
      A 61-second reconstruction
      Simulated prices, labeled as such

  The restyle to match this site came last, along with the banner on every screen, in pull
  request #2.
source ................ Pull request #2

WHAT IT FOUND

  # Flipping was easy. Knowing when a flip is wrong took the work.

  A reflection inverts every direction. On a green day for a position that’s still
  underwater, a mirror would turn the good day red to fix the total. That case gets a lift,
  and the badge says Lifted, not Mirrored.

  # Unit tests by file on main, 77 in all
the flip .............. 38
chart geometry ........ 14
yahoo parsing ......... 11
position math ......... 8
number formats ........ 6
source ................ The flip tests

WHAT’S NEXT

  # Real prices on the live site, and the joke stays loud.

  # Next
real prices live ...... Yahoo Finance only works through the dev server’s proxy. The README
                        names Alpha Vantage as the source that works on a static deploy.
keep the labels ....... Any new screen gets the banner and the badge before it ships.

  # Known limits
simulated live ........ The live deploy has no proxy, so every price there is simulated and
                        tagged.
made-up positions ..... The starting share counts and costs are invented. Settings says so,
                        and you can enter your own.
delulu isn’t real ..... Delulu rebuilds the series, so what it draws never happened.
saved in one browser
                        Holdings and the comfort level live in local storage.

TL;DR

built ................. A joke portfolio viewer that mirrors a losing chart about what you
                        paid, so the line always climbs.
found ................. A mirror can’t rescue one of the four cases, a green day on a
                        position still underwater, so that one gets lifted.
  # by the numbers
  1 ................... Line of math behind the flip
  4 ................... Cases the anchor has to handle
  77 .................. Unit tests
the catch ............. The live deploy can’t reach Yahoo Finance, so every price there is
                        simulated, and each one is labeled.
next .................. Give the live deploy a data source that works without a proxy, so
                        its prices are real.

LINKS

open alwaysup ......... alwaysup-mu.vercel.app
code .................. github.com/AndrewLengLy/AlwaysUp
the flip in code ...... github.com/AndrewLengLy/AlwaysUp/blob/main/src/lib/flip.ts
the design side ....... /machine/designer
the developer side .... /machine/developer

# end of /machine/alwaysup-casestudy. andrew.leng.ly@gmail.com · leave machine mode