diff --git a/src/widgets/TokenPrices.tsx b/src/widgets/TokenPrices.tsx index 06b367c..d713568 100644 --- a/src/widgets/TokenPrices.tsx +++ b/src/widgets/TokenPrices.tsx @@ -38,7 +38,7 @@ export function TokenPrices({ title = 'Summary', data, isLoading }: Props) { // Determine 24h change in oracle price const sortedOracleDailyPrices = token?.oracleDailyPrices?.sort((a, b) => b.dateKey - a.dateKey); const changeValue = - sortedOracleDailyPrices.length > 0 + sortedOracleDailyPrices.length >= 2 ? (() => { const oraclePriceYesterday = sortedOracleDailyPrices[0].typeOutAmountLast / sortedOracleDailyPrices[0].typeInAmountLast; diff --git a/tests/__snapshots__/Reserve.test.tsx.snap b/tests/__snapshots__/Reserve.test.tsx.snap index 6958360..82228f9 100644 --- a/tests/__snapshots__/Reserve.test.tsx.snap +++ b/tests/__snapshots__/Reserve.test.tsx.snap @@ -1449,7 +1449,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="83.83333333333333" > - 03/09 + 03/10 @@ -1485,7 +1485,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="91.5" > - 03/10 + 03/11 @@ -1521,7 +1521,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="99.16666666666666" > - 03/11 + 03/12 @@ -1557,7 +1557,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="106.83333333333333" > - 03/12 + 03/13 @@ -1593,7 +1593,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="114.5" > - 03/13 + 03/14 @@ -1629,7 +1629,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="122.16666666666667" > - 03/14 + 03/15 @@ -1665,7 +1665,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="129.83333333333334" > - 03/15 + 03/16 @@ -1701,7 +1701,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="137.50000000000003" > - 03/16 + 03/17 @@ -1737,7 +1737,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="145.16666666666669" > - 03/17 + 03/18 @@ -1773,7 +1773,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="152.83333333333334" > - 03/18 + 03/19 @@ -1809,7 +1809,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="160.50000000000003" > - 03/19 + 03/20 @@ -1845,7 +1845,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="168.16666666666669" > - 03/20 + 03/21 @@ -1881,7 +1881,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="175.83333333333334" > - 03/21 + 03/22 @@ -1917,7 +1917,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="183.50000000000003" > - 03/22 + 03/23 @@ -1953,7 +1953,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="191.16666666666669" > - 03/23 + 03/24 @@ -1989,7 +1989,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="198.83333333333334" > - 03/24 + 03/25 @@ -2025,7 +2025,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="206.50000000000003" > - 03/25 + 03/26 @@ -2061,7 +2061,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="214.16666666666669" > - 03/26 + 03/27 @@ -2097,7 +2097,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="221.83333333333334" > - 03/27 + 03/28 @@ -2133,7 +2133,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="229.50000000000003" > - 03/28 + 03/29 @@ -2169,7 +2169,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="237.16666666666669" > - 03/29 + 03/30 @@ -2205,7 +2205,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="244.83333333333334" > - 03/30 + 03/31 @@ -2241,7 +2241,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="252.50000000000003" > - 03/31 + 04/01 @@ -2277,7 +2277,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="260.1666666666667" > - 04/01 + 04/02 @@ -2313,7 +2313,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="267.8333333333333" > - 04/02 + 04/03 @@ -2349,7 +2349,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="275.5" > - 04/03 + 04/04 @@ -2385,7 +2385,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="283.1666666666667" > - 04/04 + 04/05 @@ -2421,7 +2421,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="290.8333333333333" > - 04/05 + 04/06 @@ -2457,7 +2457,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="298.5" > - 04/06 + 04/07 @@ -2493,7 +2493,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="306.1666666666667" > - 04/07 + 04/08 @@ -2529,7 +2529,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="313.8333333333333" > - 04/08 + 04/09 @@ -2565,7 +2565,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="321.5" > - 04/09 + 04/10 @@ -2601,7 +2601,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="329.1666666666667" > - 04/10 + 04/11 @@ -2637,7 +2637,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="336.8333333333333" > - 04/11 + 04/12 @@ -2673,7 +2673,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="344.5" > - 04/12 + 04/13 @@ -2709,7 +2709,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="352.1666666666667" > - 04/13 + 04/14 @@ -2745,7 +2745,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="359.8333333333333" > - 04/14 + 04/15 @@ -2781,7 +2781,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="367.5" > - 04/15 + 04/16 @@ -2817,7 +2817,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="375.1666666666667" > - 04/16 + 04/17 @@ -2853,7 +2853,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="382.8333333333333" > - 04/17 + 04/18 @@ -2889,7 +2889,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="390.5" > - 04/18 + 04/19 @@ -2925,7 +2925,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="398.1666666666667" > - 04/19 + 04/20 @@ -2961,7 +2961,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="405.8333333333333" > - 04/20 + 04/21 @@ -2997,7 +2997,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="413.5" > - 04/21 + 04/22 @@ -3033,7 +3033,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="421.1666666666667" > - 04/22 + 04/23 @@ -3069,7 +3069,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="428.8333333333333" > - 04/23 + 04/24 @@ -3105,7 +3105,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="436.5" > - 04/24 + 04/25 @@ -3141,7 +3141,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="444.1666666666667" > - 04/25 + 04/26 @@ -3177,7 +3177,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="451.8333333333333" > - 04/26 + 04/27 @@ -3213,7 +3213,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="459.5" > - 04/27 + 04/28 @@ -3249,7 +3249,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="467.1666666666667" > - 04/28 + 04/29 @@ -3285,7 +3285,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="474.8333333333333" > - 04/29 + 04/30 @@ -3321,7 +3321,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="482.5" > - 04/30 + 05/01 @@ -3357,7 +3357,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="490.1666666666667" > - 05/01 + 05/02 @@ -3393,7 +3393,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="497.8333333333333" > - 05/02 + 05/03 @@ -3429,7 +3429,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="505.5" > - 05/03 + 05/04 @@ -3465,7 +3465,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="513.1666666666667" > - 05/04 + 05/05 @@ -3501,7 +3501,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="520.8333333333334" > - 05/05 + 05/06 @@ -3537,7 +3537,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="528.5000000000001" > - 05/06 + 05/07 @@ -3573,7 +3573,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="536.1666666666667" > - 05/07 + 05/08 @@ -3609,7 +3609,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="543.8333333333334" > - 05/08 + 05/09 @@ -3645,7 +3645,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="551.5000000000001" > - 05/09 + 05/10 @@ -3681,7 +3681,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="559.1666666666667" > - 05/10 + 05/11 @@ -3717,7 +3717,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="566.8333333333334" > - 05/11 + 05/12 @@ -3753,7 +3753,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="574.5000000000001" > - 05/12 + 05/13 @@ -3789,7 +3789,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="582.1666666666667" > - 05/13 + 05/14 @@ -3825,7 +3825,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="589.8333333333334" > - 05/14 + 05/15 @@ -3861,7 +3861,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="597.5000000000001" > - 05/15 + 05/16 @@ -3897,7 +3897,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="605.1666666666667" > - 05/16 + 05/17 @@ -3933,7 +3933,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="612.8333333333334" > - 05/17 + 05/18 @@ -3969,7 +3969,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="620.5000000000001" > - 05/18 + 05/19 @@ -4005,7 +4005,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="628.1666666666667" > - 05/19 + 05/20 @@ -4041,7 +4041,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="635.8333333333334" > - 05/20 + 05/21 @@ -4077,7 +4077,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="643.5000000000001" > - 05/21 + 05/22 @@ -4113,7 +4113,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="651.1666666666667" > - 05/22 + 05/23 @@ -4149,7 +4149,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="658.8333333333334" > - 05/23 + 05/24 @@ -4185,7 +4185,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="666.5000000000001" > - 05/24 + 05/25 @@ -4221,7 +4221,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="674.1666666666667" > - 05/25 + 05/26 @@ -4257,7 +4257,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="681.8333333333334" > - 05/26 + 05/27 @@ -4293,7 +4293,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="689.5000000000001" > - 05/27 + 05/28 @@ -4329,7 +4329,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="697.1666666666667" > - 05/28 + 05/29 @@ -4365,7 +4365,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="704.8333333333334" > - 05/29 + 05/30 @@ -4401,7 +4401,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="712.5000000000001" > - 05/30 + 05/31 @@ -4437,7 +4437,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="720.1666666666667" > - 05/31 + 06/01 @@ -4473,7 +4473,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="727.8333333333334" > - 06/01 + 06/02 @@ -4509,7 +4509,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="735.5000000000001" > - 06/02 + 06/03 @@ -4545,7 +4545,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="743.1666666666667" > - 06/03 + 06/04 @@ -4581,7 +4581,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="750.8333333333334" > - 06/04 + 06/05 @@ -4617,7 +4617,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="758.5000000000001" > - 06/05 + 06/06 @@ -4653,7 +4653,7 @@ exports[`Reserve Dashboard Snapshot tests should match snapshot when data is loa dy="0.71em" x="766.1666666666667" > - 06/06 + 06/07