How the mood engine works
Most "dynamic" NFTs are a server updating a JSON file. Yours is a pure function of the market, evaluated the moment anyone looks at it.
The baseline
When your pet is minted (or fed, or transferred), the contract stores the live Chainlink price
of its bonded stock as the baseline. That number is your pet's anchor: mood is
never about where the stock is, only about where it is relative to the last time you cared.
The read
Every call to tokenURI() fetches the current Chainlink price, computes the move
versus your baseline in basis points, and picks a mood:
$.$EUPHORIC, above +10%^.^HAPPY, +2% to +10%o.oNEUTRAL, between -2% and +2%T.TSAD, -10% to -2%x.xREKT, below -10%
The ASCII art, the colors, the glow, the metadata JSON: all of it is regenerated on-chain from that single number. Nobody updates anything. There is nothing to update.
The crab exception
CRABs are happy when the market goes nowhere. In the NEUTRAL band, a CRAB renders HAPPY. Fourteen percent of the collection is emotionally invested in your stock doing absolutely nothing.
When the feed sleeps
Stock feeds follow market hours and pause during corporate actions. When the feed is stale, your
pet does not break and tokenURI() does not revert: it falls back to NEUTRAL and waits
for Monday like the rest of us.