mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-09-04 17:23:25 +00:00
ENH - simulate live crypto markets
Drive market prices from randomized server intervals with per-market momentum, global trend, mean reversion, bounded shocks, and retained history. Stream authoritative market updates into live holdings, portfolio valuations, and real detail charts while invalidating stale quotes.
This commit is contained in:
@@ -51,7 +51,7 @@ describe('VaultX crypto app contracts', () => {
|
||||
})
|
||||
|
||||
it('includes advanced market detail and persistent profile controls', () => {
|
||||
expect(source).toContain('selected.sparkline')
|
||||
expect(source).toContain('selected.priceHistory')
|
||||
expect(source).toContain('const detailChart = computed')
|
||||
expect(source).toContain('CHART_PERIOD_CONFIG[period.value]')
|
||||
expect(source).toContain('class="detail-chart__marker"')
|
||||
@@ -187,6 +187,18 @@ describe('VaultX crypto app contracts', () => {
|
||||
expect(server).toContain('settlement_ledger_queries')
|
||||
})
|
||||
|
||||
it('streams server-driven market movement into live portfolio values', () => {
|
||||
expect(config).toContain('PriceTickMinimumSeconds')
|
||||
expect(config).toContain('MarketsPerTickMaximum')
|
||||
expect(config).toContain('MarketShockChanceBasisPoints')
|
||||
expect(server).toContain('local market_dynamics = {}')
|
||||
expect(server).toContain('global_market_trend')
|
||||
expect(server).toContain('Config.Crypto.MeanReversionBasisPoints')
|
||||
expect(server).toContain('TriggerClientEvent("sky_phone:crypto:changed"')
|
||||
expect(server).toContain('priceHistory = price_history')
|
||||
expect(source).toContain('selected.priceHistory')
|
||||
})
|
||||
|
||||
it('stores cash in price-scale minor units throughout the ledger', () => {
|
||||
expect(server).toContain(
|
||||
'local ledger_amount = amount * Config.Crypto.PriceScale',
|
||||
|
||||
Reference in New Issue
Block a user