gov.ts 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. import {cachedFetchJSON} from './cache';
  2. const renderTarget = document.querySelector('#gov')!;
  3. const planetInput = document.querySelector('#planet') as HTMLInputElement;
  4. const popSelect = document.querySelector('#pop') as HTMLSelectElement;
  5. function serializeToHash(planet: string, pop: Pop): void {
  6. const params = new URLSearchParams({'planet': planet, 'pop': pop});
  7. document.location.hash = params.toString();
  8. }
  9. function deserializeFromHash(): {planet: string, pop: Pop} | null {
  10. const params = new URLSearchParams(document.location.hash.substring(1));
  11. const planet = params.get('planet');
  12. const pop = params.get('pop');
  13. if (planet && pop && ['pio', 'set', 'tec', 'eng', 'sci'].includes(pop)) {
  14. planetInput.value = planet;
  15. popSelect.value = pop;
  16. return {planet, pop: pop as Pop};
  17. } else
  18. return null;
  19. }
  20. document.querySelector('form')!.addEventListener('submit', async (event) => {
  21. event.preventDefault();
  22. const planet = planetInput.value;
  23. const pop = popSelect.value as Pop;
  24. if (planet && pop) {
  25. await render(planet, pop);
  26. serializeToHash(planet, pop);
  27. }
  28. });
  29. {
  30. const deserialized = deserializeFromHash();
  31. if (deserialized)
  32. void render(deserialized.planet, deserialized.pop);
  33. }
  34. async function render(planetName: string, pop: Pop) {
  35. const loader = document.querySelector('#loader') as HTMLElement;
  36. loader.style.display = 'block';
  37. renderTarget.innerHTML = '';
  38. try {
  39. await _render(planetName, pop);
  40. } catch (e) {
  41. renderTarget.textContent = (e as Error).message;
  42. }
  43. loader.style.display = 'none';
  44. }
  45. async function _render(planetName: string, pop: Pop) {
  46. const encodedPlanetName = encodeURIComponent(planetName);
  47. const [planet, siteCounts, infras, allPrices]: [Planet, SiteCount[], Infrastructure[], Price[]] = await Promise.all([
  48. cachedFetchJSON(`https://api.fnar.net/planet/${encodedPlanetName}?include_population_reports=true`),
  49. cachedFetchJSON(`https://api.fnar.net/planet/sitecount?planet=${encodedPlanetName}`),
  50. cachedFetchJSON(`https://api.fnar.net/infrastructure?infrastructure=${encodedPlanetName}&include_upkeeps=true`),
  51. cachedFetchJSON('https://api.prunplanner.org/data/exchanges'),
  52. ]);
  53. let lastPOPR = null;
  54. for (const report of planet.PopulationReports) {
  55. if (!lastPOPR || report.SimulationPeriod > lastPOPR.SimulationPeriod)
  56. lastPOPR = report;
  57. }
  58. if (lastPOPR === null) {
  59. renderTarget.textContent = `no POPR for ${planetName}`;
  60. return;
  61. }
  62. const lastPOPRts = Math.floor(new Date(lastPOPR.ReportTimestamp).getTime() / 1000);
  63. const nextPOPRts = lastPOPRts + 7 * 24 * 60 * 60;
  64. let currentPop = 0;
  65. if (pop == 'pio') currentPop = lastPOPR.NextPopulationPioneer;
  66. else if (pop == 'set') currentPop = lastPOPR.NextPopulationSettler;
  67. else if (pop == 'tec') currentPop = lastPOPR.NextPopulationTechnician;
  68. else if (pop == 'eng') currentPop = lastPOPR.NextPopulationEngineer;
  69. else if (pop == 'sci') currentPop = lastPOPR.NextPopulationScientist;
  70. const siteCount = siteCounts[0].Count;
  71. const totalNeeds: Record<Need, number> = {
  72. 'safety': calcTotalNeeds(lastPOPR, 'safety'),
  73. 'health': calcTotalNeeds(lastPOPR, 'health'),
  74. 'comfort': calcTotalNeeds(lastPOPR, 'comfort'),
  75. 'culture': calcTotalNeeds(lastPOPR, 'culture'),
  76. 'education': calcTotalNeeds(lastPOPR, 'education'),
  77. };
  78. const currentPOPIFilled: POPIFill = new Map();
  79. for (const infra of infras) {
  80. const filled = calcPOPIFilled(infra);
  81. if (filled !== null)
  82. currentPOPIFilled.set(infra.Type, {tier: infra.CurrentLevel, numMats: filled});
  83. }
  84. const prices: Map<string, number> = new Map();
  85. for (const price of allPrices)
  86. if (price.exchange_code === 'IC1')
  87. prices.set(price.ticker, price.vwap_30d || price.ask);
  88. else if (price.exchange_code === 'UNIVERSE' && prices.get(price.ticker) === 0) // UNIVERSE always comes after IC1
  89. prices.set(price.ticker, price.vwap_30d);
  90. renderTarget.innerHTML = `last POPR: ${lastPOPR.ReportTimestamp} (${lastPOPRts})
  91. <br>next POPR: ${new Date(nextPOPRts * 1000).toISOString()} (${nextPOPRts})
  92. <table>
  93. <tr>
  94. <th></th>
  95. <th>pio</th>
  96. <th>set</th>
  97. <th>tec</th>
  98. <th>eng</th>
  99. <th>sci</th>
  100. </tr>
  101. <tr>
  102. <th>population</th>
  103. <td>${lastPOPR.NextPopulationPioneer}<br>${formatDelta(lastPOPR.PopulationDifferencePioneer)}</td>
  104. <td>${lastPOPR.NextPopulationSettler}<br>${formatDelta(lastPOPR.PopulationDifferenceSettler)}</td>
  105. <td>${lastPOPR.NextPopulationTechnician}<br>${formatDelta(lastPOPR.PopulationDifferenceTechnician)}</td>
  106. <td>${lastPOPR.NextPopulationEngineer}<br>${formatDelta(lastPOPR.PopulationDifferenceEngineer)}</td>
  107. <td>${lastPOPR.NextPopulationScientist}<br>${formatDelta(lastPOPR.PopulationDifferenceScientist)}</td>
  108. </tr>
  109. <tr>
  110. <th>unemployed</th>
  111. <td>${unemployed(lastPOPR.NextPopulationPioneer, lastPOPR.PopulationDifferencePioneer, lastPOPR.OpenJobsPioneer, lastPOPR.UnemploymentRatePioneer)}</td>
  112. <td>${unemployed(lastPOPR.NextPopulationSettler, lastPOPR.PopulationDifferenceSettler, lastPOPR.OpenJobsSettler, lastPOPR.UnemploymentRateSettler)}</td>
  113. <td>${unemployed(lastPOPR.NextPopulationTechnician, lastPOPR.PopulationDifferenceTechnician, lastPOPR.OpenJobsTechnician, lastPOPR.UnemploymentRateTechnician)}</td>
  114. <td>${unemployed(lastPOPR.NextPopulationEngineer, lastPOPR.PopulationDifferenceEngineer, lastPOPR.OpenJobsEngineer, lastPOPR.UnemploymentRateEngineer)}</td>
  115. <td>${unemployed(lastPOPR.NextPopulationScientist, lastPOPR.PopulationDifferenceScientist, lastPOPR.OpenJobsScientist, lastPOPR.UnemploymentRateScientist)}</td>
  116. </tr>
  117. </table>
  118. <h2>needs</h2>
  119. ${siteCount} bases
  120. <table>
  121. <tr>
  122. <th></th>
  123. <th>safety</th>
  124. <th>health</th>
  125. <th>comfort</th>
  126. <th>culture</th>
  127. <th>education</th>
  128. </tr>
  129. <tr>
  130. <td>last POPR</td>
  131. <td>${formatPct(lastPOPR.NeedFulfillmentSafety)}</td>
  132. <td>${formatPct(lastPOPR.NeedFulfillmentHealth)}</td>
  133. <td>${formatPct(lastPOPR.NeedFulfillmentComfort)}</td>
  134. <td>${formatPct(lastPOPR.NeedFulfillmentCulture)}</td>
  135. <td>${formatPct(lastPOPR.NeedFulfillmentEducation)}</td>
  136. </tr>
  137. <tr>
  138. <td>total needed</td>
  139. <td>${formatNum(totalNeeds['safety'])}</td>
  140. <td>${formatNum(totalNeeds['health'])}</td>
  141. <td>${formatNum(totalNeeds['comfort'])}</td>
  142. <td>${formatNum(totalNeeds['culture'])}</td>
  143. <td>${formatNum(totalNeeds['education'])}</td>
  144. </tr>
  145. </table>
  146. <h2>current POPI</h2>
  147. <table>
  148. <tr>
  149. ${infras.map((infra) => {
  150. if (infra.CurrentLevel === 0)
  151. return '';
  152. const fill = currentPOPIFilled.get(infra.Type)!;
  153. return `<tr>
  154. <td>${infra.Type} T${infra.CurrentLevel}</td>
  155. <td>${fill.numMats}/${infra.Upkeeps.length}</td>
  156. </tr>`;
  157. }).join('')}
  158. </tr>
  159. </table>
  160. current projected ${pop.toUpperCase()} happiness:
  161. ${formatPct(projectedHappiness(pop, totalNeeds, siteCount, currentPOPIFilled))}
  162. <h2>options</h2>
  163. <table class="options">
  164. <tr>
  165. <th>config</th>
  166. <th>projected happiness</th>
  167. <th>projected migration</th>
  168. <th>cost/day</th>
  169. <th>unit cost</th>
  170. </tr>
  171. ${paretoFront(pop, totalNeeds, siteCount, currentPOPIFilled, currentPop, prices).map((result) => {
  172. let unitCost = '';
  173. if (result.cost > 0)
  174. unitCost = formatNum(result.cost / result.migration);
  175. return `<tr>
  176. <td>${[...result.config.entries()].map(([building, fill]) => `${building}: ${fill.numMats}`).join(', ')}</td>
  177. <td>${formatPct(result.happiness)}</td>
  178. <td>${formatDelta(result.migration)}</td>
  179. <td>${formatNum(result.cost)}</td>
  180. <td>${unitCost}</td>
  181. </tr>`;
  182. }).join('')}
  183. </table>
  184. `;
  185. }
  186. const formatNum = new Intl.NumberFormat(undefined, {maximumFractionDigits: 2}).format;
  187. const formatPct = new Intl.NumberFormat(undefined, {style: 'percent', maximumFractionDigits: 2}).format;
  188. function formatDelta(n: number, withPlus: boolean = true): string {
  189. if (n > 0)
  190. return `<span class="positive">${withPlus ? '+' : ''}${formatNum(n)}</span>`;
  191. else if (n < 0)
  192. return `<span class="negative">${formatNum(n)}</span>`;
  193. else
  194. return n.toString();
  195. }
  196. function unemployed(people: number, change: number, openJobs: number, unemploymentRate: number): string {
  197. let nextUnemployed;
  198. if (openJobs <= people + change) {
  199. let prevUnemploymentRate = unemploymentRate;
  200. if (openJobs > 0)
  201. if (people - change > 0)
  202. prevUnemploymentRate = -openJobs / (people - change);
  203. else
  204. prevUnemploymentRate = -1
  205. const prevUnemployed = prevUnemploymentRate * (people - change);
  206. nextUnemployed = prevUnemployed + change;
  207. } else
  208. nextUnemployed = -openJobs + change;
  209. return formatDelta(Math.round(nextUnemployed), false);
  210. }
  211. function calcTotalNeeds(popReport: POPR, need: Need): number {
  212. return popReport.NextPopulationPioneer * NEEDS.pio[need]
  213. + popReport.NextPopulationSettler * NEEDS.set[need]
  214. + popReport.NextPopulationTechnician * NEEDS.tec[need]
  215. + popReport.NextPopulationEngineer * NEEDS.eng[need]
  216. + popReport.NextPopulationScientist * NEEDS.sci[need];
  217. }
  218. function calcPOPIFilled(infra: Infrastructure): number | null {
  219. if (infra.CurrentLevel === 0)
  220. return null;
  221. let filled = 0;
  222. for (const upkeep of infra.Upkeeps) {
  223. const nextConsumptionAmount = upkeep.StoreCapacity / 30 * upkeep.Duration; // # capacity is always 30 days
  224. if (upkeep.Stored >= nextConsumptionAmount)
  225. filled++;
  226. }
  227. return filled;
  228. }
  229. function paretoFront(pop: Pop, totalNeeds: Record<Need, number>, siteCount: number, currentPOPIFilled: POPIFill,
  230. currentPop: number, prices: Map<string, number>): {config: POPIFill, happiness: number, migration: number, cost: number}[] {
  231. const results: {config: POPIFill, happiness: number, migration: number, cost: number}[] = [];
  232. for (const config of popiFillCombinations(currentPOPIFilled)) {
  233. const happiness = projectedHappiness(pop, totalNeeds, siteCount, config);
  234. let migration = 0;
  235. if (happiness > 0.7)
  236. migration = currentPop * (happiness - 0.7);
  237. else if (happiness < 0.5)
  238. migration = 0.8 * currentPop * (happiness - 0.5);
  239. // TODO: education
  240. let cost = calcCost(config, prices);
  241. // is any result better than this one?
  242. if (results.some((result) => (result.migration >= migration && result.cost < cost) ||
  243. (result.migration > migration && result.cost <= cost)))
  244. continue;
  245. // are any results worse than this one?
  246. for (let i = results.length - 1; i >= 0; i--)
  247. if ((results[i].migration <= migration && results[i].cost > cost) ||
  248. (results[i].migration < migration && results[i].cost >= cost))
  249. results.splice(i, 1);
  250. results.push({config, happiness, migration, cost});
  251. }
  252. return results;
  253. }
  254. function* popiFillCombinations(currentPOPIFilled: POPIFill): Generator<POPIFill> {
  255. const entries = [...currentPOPIFilled.keys()];
  256. function* helper(index: number, current: POPIFill): Generator<POPIFill> {
  257. if (index === entries.length) {
  258. yield new Map(current);
  259. return;
  260. }
  261. const building = entries[index];
  262. const tier = currentPOPIFilled.get(building)!.tier;
  263. const maxBuildingMats = Object.keys(POPI[building].mats).length;
  264. for (let i = 0; i <= maxBuildingMats; i++) {
  265. current.set(building, {tier, numMats: i});
  266. yield* helper(index + 1, current);
  267. }
  268. }
  269. yield* helper(0, new Map());
  270. }
  271. function projectedHappiness(pop: Pop, totalNeeds: Record<Need, number>, siteCount: number, popiFilled: POPIFill): number {
  272. let totalProvided: Record<Need, number> = {'safety': 50 * siteCount, 'health': 50 * siteCount,
  273. 'comfort': 0, 'culture': 0, 'education': 0};
  274. for (const [building, fill] of popiFilled.entries()) {
  275. const {needs} = POPI[building];
  276. const maxBuildingMats = Object.keys(POPI[building].mats).length;
  277. for (const {need, supplied} of needs) {
  278. const provided = fill.numMats / maxBuildingMats * fill.tier * supplied;
  279. totalProvided[need] += provided;
  280. }
  281. }
  282. const satisfaction: Map<Need, number> = new Map(); // percentage of needs fulfilled
  283. for (const _need in totalProvided) {
  284. const need = _need as Need;
  285. satisfaction.set(need, Math.min(totalProvided[need] / totalNeeds[need], 1));
  286. }
  287. const safetyHealthCap = Math.min(satisfaction.get('safety')!, satisfaction.get('health')!);
  288. if (satisfaction.get('comfort')! > safetyHealthCap)
  289. satisfaction.set('comfort', safetyHealthCap);
  290. if (satisfaction.get('culture')! > safetyHealthCap)
  291. satisfaction.set('culture', safetyHealthCap);
  292. const comfortCultureCap = Math.min(satisfaction.get('comfort')!, satisfaction.get('culture')!);
  293. if (satisfaction.get('education')! > comfortCultureCap)
  294. satisfaction.set('education', comfortCultureCap);
  295. const weights = NEEDS[pop];
  296. let happiness = 1 - Object.values(weights).reduce((sum, weight) => sum + weight, 0); // assume 100% life support
  297. for (const [need, s] of satisfaction.entries())
  298. happiness += weights[need] * s;
  299. return happiness;
  300. }
  301. function calcCost(config: POPIFill, prices: Map<string, number>): number {
  302. let cost = 0;
  303. for (const [building, fill] of config.entries()) {
  304. const {mats} = POPI[building];
  305. const matPrices: {ticker: string, costPerDay: number}[] = [];
  306. for (const [mat, amount] of Object.entries(mats)) {
  307. const matCost = prices.get(mat)!;
  308. if (!matCost)
  309. throw new Error('no price for ' + mat);
  310. matPrices.push({ticker: mat, costPerDay: matCost * amount});
  311. }
  312. matPrices.sort((a, b) => a.costPerDay - b.costPerDay);
  313. for (let i = 0; i < fill.numMats; i++)
  314. cost += matPrices[i].costPerDay * fill.tier;
  315. }
  316. return cost;
  317. }
  318. const NEEDS: Record<Pop, Record<Need, number>> = {
  319. 'pio': {'safety': 0.25, 'health': 0.15, 'comfort': 0.03, 'culture': 0.02, 'education': 0.01},
  320. 'set': {'safety': 0.30, 'health': 0.20, 'comfort': 0.03, 'culture': 0.03, 'education': 0.03},
  321. 'tec': {'safety': 0.20, 'health': 0.30, 'comfort': 0.20, 'culture': 0.10, 'education': 0.05},
  322. 'eng': {'safety': 0.10, 'health': 0.15, 'comfort': 0.35, 'culture': 0.20, 'education': 0.10},
  323. 'sci': {'safety': 0.10, 'health': 0.10, 'comfort': 0.20, 'culture': 0.25, 'education': 0.30},
  324. }
  325. const POPI: Record<POPIBuilding, {needs: {need: Need, supplied: number}[], mats: Record<string, number>}> = {
  326. 'SAFETY_STATION': {
  327. needs: [{need: 'safety', supplied: 2500}],
  328. mats: {'DW': 10, 'OFF': 10, 'SUN': 2},
  329. },
  330. 'SECURITY_DRONE_POST': {
  331. needs: [{need: 'safety', supplied: 5000}],
  332. mats: {'POW': 1, 'RAD': 0.47, 'CCD': 0.07, 'SUD': 0.07},
  333. },
  334. 'EMERGENCY_CENTER': {
  335. needs: [{need: 'safety', supplied: 1000}, {need: 'health', supplied: 1000}],
  336. mats: {'PK': 2, 'POW': 0.4, 'BND': 4, 'RED': 0.07, 'BSC': 0.07},
  337. },
  338. 'INFIRMARY': {
  339. needs: [{need: 'health', supplied: 2500}],
  340. mats: {'OFF': 10, 'TUB': 6.67, 'STR': 0.67},
  341. },
  342. 'HOSPITAL': {
  343. needs: [{need: 'health', supplied: 5000}],
  344. mats: {'PK': 2, 'SEQ': 0.4, 'BND': 4, 'SDR': 0.07, 'RED': 0.07, 'BSC': 0.13},
  345. },
  346. 'WELLNESS_CENTER': {
  347. needs: [{need: 'health', supplied: 1000}, {need: 'comfort', supplied: 1000}],
  348. mats: {'KOM': 4, 'OLF': 2, 'DW': 6, 'DEC': 0.67, 'PFE': 2.67, 'SOI': 6.67},
  349. },
  350. 'WILDLIFE_PARK': {
  351. needs: [{need: 'comfort', supplied: 2500}],
  352. mats: {'DW': 10, 'FOD': 6, 'PFE': 2, 'SOI': 3.33, 'DEC': 0.33},
  353. },
  354. 'ARCADES': {
  355. needs: [{need: 'comfort', supplied: 5000}],
  356. mats: {'POW': 2, 'MHP': 2, 'OLF': 4, 'BID': 0.2, 'HOG': 0.2, 'EDC': 0.2},
  357. },
  358. 'ART_CAFE': {
  359. needs: [{need: 'comfort', supplied: 1000}, {need: 'culture', supplied: 1000}],
  360. mats: {'MHP': 1, 'HOG': 1, 'UTS': 0.67, 'DEC': 0.67},
  361. },
  362. 'ART_GALLERY': {
  363. needs: [{need: 'culture', supplied: 2500}],
  364. mats: {'MHP': 1, 'HOG': 1, 'UTS': 0.67, 'DEC': 0.67},
  365. },
  366. 'THEATER': {
  367. needs: [{need: 'culture', supplied: 5000}],
  368. mats: {'POW': 1.4, 'MHP': 2, 'HOG': 1.4, 'OLF': 4, 'BID': 0.33, 'DEC': 0.67},
  369. },
  370. 'PLANETARY_BROADCASTING_HUB': {
  371. needs: [{need: 'culture', supplied: 1000}, {need: 'education', supplied: 1000}],
  372. mats: {'OFF': 10, 'MHP': 1, 'SP': 1.33, 'AAR': 0.67, 'EDC': 0.27, 'IDC': 0.13},
  373. },
  374. 'LIBRARY': {
  375. needs: [{need: 'education', supplied: 2500}],
  376. mats: {'MHP': 1, 'HOG': 1, 'CD': 0.33, 'DIS': 0.33, 'BID': 0.2},
  377. },
  378. 'UNIVERSITY': {
  379. needs: [{need: 'education', supplied: 5000}],
  380. mats: {'COF': 10, 'REA': 10, 'TUB': 10, 'BID': 0.33, 'HD': 0.67, 'IDC': 0.2},
  381. },
  382. };
  383. type Pop = 'pio' | 'set' | 'tec' | 'eng' | 'sci';
  384. type Need = 'safety' | 'health' | 'comfort' | 'culture' | 'education';
  385. type POPIBuilding = 'SAFETY_STATION' | 'SECURITY_DRONE_POST' | 'EMERGENCY_CENTER' | 'INFIRMARY' | 'HOSPITAL' |
  386. 'WELLNESS_CENTER' | 'WILDLIFE_PARK' | 'ARCADES' | 'ART_CAFE' | 'ART_GALLERY' | 'THEATER' |
  387. 'PLANETARY_BROADCASTING_HUB' | 'LIBRARY' | 'UNIVERSITY';
  388. type POPIFill = Map<POPIBuilding, {tier: number, numMats: number}>;
  389. interface Planet {
  390. PopulationReports: POPR[]
  391. }
  392. interface POPR {
  393. SimulationPeriod: number;
  394. ReportTimestamp: string;
  395. NeedFulfillmentSafety: number;
  396. NeedFulfillmentHealth: number;
  397. NeedFulfillmentComfort: number;
  398. NeedFulfillmentCulture: number;
  399. NeedFulfillmentEducation: number;
  400. NextPopulationPioneer: number;
  401. NextPopulationSettler: number;
  402. NextPopulationTechnician: number;
  403. NextPopulationEngineer: number;
  404. NextPopulationScientist: number;
  405. PopulationDifferencePioneer: number;
  406. PopulationDifferenceSettler: number;
  407. PopulationDifferenceTechnician: number;
  408. PopulationDifferenceEngineer: number;
  409. PopulationDifferenceScientist: number;
  410. OpenJobsPioneer: number;
  411. OpenJobsSettler: number;
  412. OpenJobsTechnician: number;
  413. OpenJobsEngineer: number;
  414. OpenJobsScientist: number;
  415. UnemploymentRatePioneer: number;
  416. UnemploymentRateSettler: number;
  417. UnemploymentRateTechnician: number;
  418. UnemploymentRateEngineer: number;
  419. UnemploymentRateScientist: number;
  420. }
  421. interface SiteCount {
  422. Count: number;
  423. }
  424. interface Infrastructure {
  425. Type: POPIBuilding;
  426. CurrentLevel: number;
  427. Upkeeps: {Stored: number, StoreCapacity: number, 'Duration': number}[];
  428. }
  429. interface Price {
  430. ticker: string
  431. exchange_code: string
  432. vwap_30d: number
  433. ask: number
  434. }