Download phiEngine.js from roowoo/crypto-stress-buster-dashboard: direct link, hf CLI and curl.
- Browser
- Download file 959 Bytes
-
https://huggingface.co/spaces/roowoo/crypto-stress-buster-dashboard/resolve/main/phiEngine.js
- Command line
-
hf download hf://spaces/roowoo/crypto-stress-buster-dashboard/phiEngine.js
-
curl -L -o phiEngine.js https://huggingface.co/spaces/roowoo/crypto-stress-buster-dashboard/resolve/main/phiEngine.js
959 Bytes
| // --- Shared PHI Engine --- | |
| window.PHI = { | |
| thresholds: { compression: 30, recovery: 50, expansion: 70 }, | |
| getPhase(score) { | |
| const t = this.thresholds; | |
| if (score < t.compression) return 'Compression'; | |
| if (score < t.recovery) return 'Recovery'; | |
| if (score < t.expansion) return 'Expansion'; | |
| return 'Exhaustion'; | |
| }, | |
| getRegime(score) { | |
| if (score < 30) return 'Risk-off'; | |
| if (score < 50) return 'Neutral'; | |
| if (score < 70) return 'Risk-on'; | |
| return 'Extreme'; | |
| }, | |
| store(data) { | |
| localStorage.setItem('cryptoPulseData', JSON.stringify(data)); | |
| localStorage.setItem('cryptoPulseTimestamp', Date.now()); | |
| }, | |
| read() { | |
| return JSON.parse(localStorage.getItem('cryptoPulseData') || 'null'); | |
| }, | |
| isStale(minutes = 5) { | |
| const ts = parseInt(localStorage.getItem('cryptoPulseTimestamp') || '0'); | |
| return !ts || (Date.now() - ts > minutes * 60000); | |
| } | |
| }; | |
| console.log('PHI engine loaded:', typeof PHI); | |