Compare commits

..
Author SHA1 Message Date
Dariusz Majcherczyk 28f87e4968 test: fixed capsule tests 2023-02-28 16:36:16 +01:00
Ciaran McGhie 1bd56c9bdb chore(ci): bump ui-toolkit version to 0.7.0 (#2961) 2023-02-28 10:13:51 +00:00
Sam Keen a985bc7317 fix(governance): some fixes and tweaks for the rewards tables (#3009) 2023-02-28 10:07:51 +00:00
dexturr 1cab9abfd5 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-28 06:08:01 +00:00
dexturr 26a82ab2ab chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-28 00:17:25 +00:00
Matthew Russell 69a0830e80 fix(ui-toolkit): remove calt from nav and toasts (#3020) 2023-02-27 15:21:17 -08:00
m.ray 4eb6e09bd4 fix(trading): condense deal ticket & market info price range snags (#3012) 2023-02-27 18:04:13 +00:00
Maciek a02100b079 chore(ui-toolkit): revert: loader no rerender version only 2023-02-27 07:51:50 -08:00
Maciek 4bb78e9891 chore(ui-toolkit): loader no rerender version only (#3011) 2023-02-27 16:44:48 +01:00
dexturr 79f360dc24 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-27 12:10:43 +00:00
23 changed files with 279 additions and 146 deletions
@@ -184,9 +184,8 @@ export const MarketDetails = ({
content: (
<>
<p className="text-xs mb-4">
{`For liquidity orders count towards a commitment they have to be
within either the liquidity or price monitoring bounds (whichever is
tighter).`}
{`For liquidity orders to count towards a commitment, they must be
within the liquidity monitoring bounds.`}
</p>
<p className="text-xs mb-4">
{`The liquidity price range is a ${liquidityPriceRange} difference from the mid
+128 -40
View File
@@ -2761,7 +2761,7 @@
"tranche_end": "2023-12-05T00:00:00.000Z",
"total_added": "86666.297",
"total_removed": "0",
"locked_amount": "66660.1864521651085953168",
"locked_amount": "66423.0550858143113891258",
"deposits": [
{
"amount": "86666.297",
@@ -2827,7 +2827,7 @@
"tranche_end": "2023-06-01T00:00:00.000Z",
"total_added": "2500",
"total_removed": "0",
"locked_amount": "1287.68044744607225",
"locked_amount": "1273.962148962149",
"deposits": [
{
"amount": "2500",
@@ -3214,8 +3214,8 @@
"tranche_start": "2023-02-01T00:00:00.000Z",
"tranche_end": "2023-08-01T00:00:00.000Z",
"total_added": "37500",
"total_removed": "3295.491386325",
"locked_amount": "32060.042107888275",
"total_removed": "3376.096819125",
"locked_amount": "31853.1307550644575",
"deposits": [
{
"amount": "7500",
@@ -3234,6 +3234,11 @@
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0xe69c28fbcb90092d264d098874523f580e45052a36a71b3f423431e84d4ca074"
},
{
"amount": "80.6054328",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0x1a73c48a20c37eb5f8214ecb3c1986d0b6a24ae6472533c556ec6c264814abb6"
},
{
"amount": "142.173112275",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -3288,6 +3293,12 @@
"tranche_id": 34,
"tx": "0xe69c28fbcb90092d264d098874523f580e45052a36a71b3f423431e84d4ca074"
},
{
"amount": "80.6054328",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tranche_id": 34,
"tx": "0x1a73c48a20c37eb5f8214ecb3c1986d0b6a24ae6472533c556ec6c264814abb6"
},
{
"amount": "142.173112275",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -3326,8 +3337,8 @@
}
],
"total_tokens": "7500",
"withdrawn_tokens": "1020.378203625",
"remaining_tokens": "6479.621796375"
"withdrawn_tokens": "1100.983636425",
"remaining_tokens": "6399.016363575"
},
{
"address": "0x0B4e6fcE839B01ef43DA6F890FAC7B1Afb004600",
@@ -3359,7 +3370,7 @@
"tranche_end": "2023-12-05T00:00:00.000Z",
"total_added": "129999.45",
"total_removed": "0",
"locked_amount": "66599.36741953379042928",
"locked_amount": "66362.45240571775784592",
"deposits": [
{
"amount": "129999.45",
@@ -3425,7 +3436,7 @@
"tranche_end": "2023-09-03T00:00:00.000Z",
"total_added": "62600",
"total_removed": "0",
"locked_amount": "32199.23383434805018",
"locked_amount": "32027.95129375950986",
"deposits": [
{
"amount": "10000",
@@ -3618,7 +3629,7 @@
"tranche_end": "2023-09-17T00:00:00.000Z",
"total_added": "5000",
"total_removed": "0",
"locked_amount": "2763.604610603755",
"locked_amount": "2749.923896499239",
"deposits": [
{
"amount": "5000",
@@ -3829,7 +3840,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "97499.58",
"total_removed": "0",
"locked_amount": "8549.9770497729426934506",
"locked_amount": "8317.5854908512324839724",
"deposits": [
{
"amount": "97499.58",
@@ -3862,7 +3873,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "135173.4239508",
"total_removed": "98230.390980249184455396",
"locked_amount": "11686.34253508108202110958958",
"locked_amount": "11368.703394764008547704146912",
"deposits": [
{
"amount": "135173.4239508",
@@ -3908,7 +3919,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "32499.86",
"total_removed": "0",
"locked_amount": "3596.8276946333941696698",
"locked_amount": "3499.0645789825988556482",
"deposits": [
{
"amount": "32499.86",
@@ -3941,7 +3952,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "10833.29",
"total_removed": "0",
"locked_amount": "1170.7325118133853096759",
"locked_amount": "1138.9115663398697575689",
"deposits": [
{
"amount": "10833.29",
@@ -3974,7 +3985,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "22749.93",
"total_removed": "4720.860935375",
"locked_amount": "4376.4596075425397060448",
"locked_amount": "4257.5058062827227483966",
"deposits": [
{
"amount": "6500",
@@ -4125,8 +4136,8 @@
"tranche_start": "2022-11-01T00:00:00.000Z",
"tranche_end": "2023-05-01T00:00:00.000Z",
"total_added": "22500",
"total_removed": "4832.532899775",
"locked_amount": "7799.561176335174675",
"total_removed": "4913.13257745",
"locked_amount": "7675.414364640885075",
"deposits": [
{
"amount": "7500",
@@ -4145,6 +4156,11 @@
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0xe098f85d049dae2f5ab1d8057e7ca1d1a02bc6c95602a8db87e2d78013e236a3"
},
{
"amount": "80.599677675",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0xe5b0236fdb114d861139db0bdec5bdc26b4e107ff73eb66bc4ba262a003fd872"
},
{
"amount": "142.17311235",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -4254,6 +4270,12 @@
"tranche_id": 33,
"tx": "0xe098f85d049dae2f5ab1d8057e7ca1d1a02bc6c95602a8db87e2d78013e236a3"
},
{
"amount": "80.599677675",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tranche_id": 33,
"tx": "0xe5b0236fdb114d861139db0bdec5bdc26b4e107ff73eb66bc4ba262a003fd872"
},
{
"amount": "142.17311235",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -4364,8 +4386,8 @@
}
],
"total_tokens": "7500",
"withdrawn_tokens": "4832.532899775",
"remaining_tokens": "2667.467100225"
"withdrawn_tokens": "4913.13257745",
"remaining_tokens": "2586.86742255"
},
{
"address": "0x2539b51EbDE65a75672aBcfE9439a706a99D18D1",
@@ -4390,7 +4412,7 @@
"tranche_end": "2023-06-02T00:00:00.000Z",
"total_added": "1939928.38",
"total_removed": "928642.9598472029154",
"locked_amount": "503547.66972674586634472",
"locked_amount": "498239.748616742685424742",
"deposits": [
{
"amount": "1852091.69",
@@ -36770,7 +36792,7 @@
"tranche_end": "2023-06-05T00:00:00.000Z",
"total_added": "3732368.4671",
"total_removed": "615950.831401702010493",
"locked_amount": "798278.776421275325414380233",
"locked_amount": "790122.349697050685985728513",
"deposits": [
{
"amount": "1998.95815",
@@ -38118,8 +38140,8 @@
"tranche_start": "2022-06-05T00:00:00.000Z",
"tranche_end": "2023-12-05T00:00:00.000Z",
"total_added": "15870102.715470999700000001",
"total_removed": "579941.15446796566514452",
"locked_amount": "8130332.8724344144040666925862118737483104",
"total_removed": "581783.18955280438622952",
"locked_amount": "8101410.7069629630393713585116348828548256",
"deposits": [
{
"amount": "16249.93",
@@ -38633,6 +38655,16 @@
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0x2d99d4051c6ac81037db1eebf0f86b335ed9d1957f281134d07da192644a6a8c"
},
{
"amount": "1468.73477394015521",
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
"tx": "0x525f9427c131bc2fdea7f556d16b7781faaa41e09c7735d1c02d1f7585cc49ab"
},
{
"amount": "373.300310898565875",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0x9e97de704d81fdca889591198e04f05367514f11f4a1eddcbd6363aadb861955"
},
{
"amount": "535.4042378778335",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -40408,6 +40440,12 @@
"tranche_id": 2,
"tx": "0x2d99d4051c6ac81037db1eebf0f86b335ed9d1957f281134d07da192644a6a8c"
},
{
"amount": "373.300310898565875",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tranche_id": 2,
"tx": "0x9e97de704d81fdca889591198e04f05367514f11f4a1eddcbd6363aadb861955"
},
{
"amount": "535.4042378778335",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -41622,8 +41660,8 @@
}
],
"total_tokens": "259998.8875",
"withdrawn_tokens": "126575.552865965027",
"remaining_tokens": "133423.334634034973"
"withdrawn_tokens": "126948.853176863592875",
"remaining_tokens": "133050.034323136407125"
},
{
"address": "0x89051CAb67Bc7F8CC44F7e270c6EDaf1EC57676c",
@@ -41844,6 +41882,12 @@
}
],
"withdrawals": [
{
"amount": "1468.73477394015521",
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
"tranche_id": 2,
"tx": "0x525f9427c131bc2fdea7f556d16b7781faaa41e09c7735d1c02d1f7585cc49ab"
},
{
"amount": "1640.93679110232897",
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
@@ -42086,8 +42130,8 @@
}
],
"total_tokens": "150551.801",
"withdrawn_tokens": "71968.00074341356817",
"remaining_tokens": "78583.80025658643183"
"withdrawn_tokens": "73436.73551735372338",
"remaining_tokens": "77115.06548264627662"
},
{
"address": "0x4d982Ab0823fD2f48e934a7be2bb0a5374a26148",
@@ -43860,8 +43904,8 @@
"tranche_start": "2021-11-05T00:00:00.000Z",
"tranche_end": "2023-05-05T00:00:00.000Z",
"total_added": "14597706.0446472999",
"total_removed": "5576016.212508497282613906",
"locked_amount": "1784426.168875606617258788877936648",
"total_removed": "5576533.539587892391509156",
"locked_amount": "1757725.410382134892287839107650954",
"deposits": [
{
"amount": "129284.449",
@@ -44080,6 +44124,11 @@
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tx": "0xb4d9a135d2cfa85e52b9bb68a09ffaecde4ae4d1fab95e6f44d4dd902e2a45c9"
},
{
"amount": "517.32707939510889525",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tx": "0x07f42fed87b386a135f1b3be72112768a812687d6751cfd74e287ed3af3c16b7"
},
{
"amount": "800.792718381487871",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
@@ -47047,6 +47096,12 @@
"tranche_id": 3,
"tx": "0xb4d9a135d2cfa85e52b9bb68a09ffaecde4ae4d1fab95e6f44d4dd902e2a45c9"
},
{
"amount": "517.32707939510889525",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tranche_id": 3,
"tx": "0x07f42fed87b386a135f1b3be72112768a812687d6751cfd74e287ed3af3c16b7"
},
{
"amount": "800.792718381487871",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
@@ -49563,8 +49618,8 @@
}
],
"total_tokens": "359123.469575",
"withdrawn_tokens": "314913.2361779904076005",
"remaining_tokens": "44210.2333970095923995"
"withdrawn_tokens": "315430.56325738551649575",
"remaining_tokens": "43692.90631761448350425"
},
{
"address": "0xBdd412797c1B78535Afc5F71503b91fAbD0160fB",
@@ -50907,8 +50962,8 @@
"tranche_start": "2021-10-05T00:00:00.000Z",
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "5778205.3912159303",
"total_removed": "3055768.040200763217391295",
"locked_amount": "388134.167902190321713268137737088",
"total_removed": "3063522.787392713967070295",
"locked_amount": "377584.536736576014422212956155541",
"deposits": [
{
"amount": "552496.6455",
@@ -51052,6 +51107,11 @@
}
],
"withdrawals": [
{
"amount": "7754.747191950749679",
"user": "0xafa64cCa337eFEE0AD827F6C2684e69275226e90",
"tx": "0xb1d21b6f9cce4bfaf8870592e4cbc7a40f1ca7c13cd7c8c8bb1defeb49bc31b8"
},
{
"amount": "990.74735267405816",
"user": "0xBc934494675a6ceB639B9EfEe5b9C0f017D35a75",
@@ -52595,6 +52655,12 @@
}
],
"withdrawals": [
{
"amount": "7754.747191950749679",
"user": "0xafa64cCa337eFEE0AD827F6C2684e69275226e90",
"tranche_id": 4,
"tx": "0xb1d21b6f9cce4bfaf8870592e4cbc7a40f1ca7c13cd7c8c8bb1defeb49bc31b8"
},
{
"amount": "4961.957448767374506",
"user": "0xafa64cCa337eFEE0AD827F6C2684e69275226e90",
@@ -52843,8 +52909,8 @@
}
],
"total_tokens": "331498.5873",
"withdrawn_tokens": "301699.732563421740393",
"remaining_tokens": "29798.854736578259607"
"withdrawn_tokens": "309454.479755372490072",
"remaining_tokens": "22044.107544627509928"
},
{
"address": "0x16da609341ed67750A8BCC5AAa2005471006Cd77",
@@ -52946,8 +53012,8 @@
"tranche_start": "2022-06-05T00:00:00.000Z",
"tranche_end": "2023-06-05T00:00:00.000Z",
"total_added": "472355.6199999996",
"total_removed": "34416.2282090650685",
"locked_amount": "126491.83527997644210121089142566",
"total_removed": "34799.2735287010685",
"locked_amount": "125199.40284140018681746501978692",
"deposits": [
{
"amount": "3000",
@@ -59581,6 +59647,16 @@
"user": "0x7708B79e2bc3b7ab816E66aF33A8c9385f0FcA4b",
"tx": "0x1c5bff9afd9ddc3c385d5a089f9784606b0bac24e59dba9f16e1445e52a9c41b"
},
{
"amount": "191.524581432",
"user": "0x256274a216e0a349dC18cae08Ca45631176AF437",
"tx": "0xdc17c6673a771c209d6a3f8aaf89d12289034073da28c19047ff704b1fbf4fe2"
},
{
"amount": "191.520738204",
"user": "0xB3ae40b11af91BbD456022Bd42B4f36A8C0AEA9D",
"tx": "0x7d1caeef005902492763cabe888b5dc76fd9f224520323ac30c1927ae91a1778"
},
{
"amount": "57.900076104",
"user": "0x96d882E908C06cD697Ea07266Fb8D14ae129A50b",
@@ -81490,6 +81566,12 @@
}
],
"withdrawals": [
{
"amount": "191.520738204",
"user": "0xB3ae40b11af91BbD456022Bd42B4f36A8C0AEA9D",
"tranche_id": 5,
"tx": "0x7d1caeef005902492763cabe888b5dc76fd9f224520323ac30c1927ae91a1778"
},
{
"amount": "102.196144088",
"user": "0xB3ae40b11af91BbD456022Bd42B4f36A8C0AEA9D",
@@ -81498,8 +81580,8 @@
}
],
"total_tokens": "400",
"withdrawn_tokens": "102.196144088",
"remaining_tokens": "297.803855912"
"withdrawn_tokens": "293.716882292",
"remaining_tokens": "106.283117708"
},
{
"address": "0x256274a216e0a349dC18cae08Ca45631176AF437",
@@ -81512,6 +81594,12 @@
}
],
"withdrawals": [
{
"amount": "191.524581432",
"user": "0x256274a216e0a349dC18cae08Ca45631176AF437",
"tranche_id": 5,
"tx": "0xdc17c6673a771c209d6a3f8aaf89d12289034073da28c19047ff704b1fbf4fe2"
},
{
"amount": "102.190930996",
"user": "0x256274a216e0a349dC18cae08Ca45631176AF437",
@@ -81520,8 +81608,8 @@
}
],
"total_tokens": "400",
"withdrawn_tokens": "102.190930996",
"remaining_tokens": "297.809069004"
"withdrawn_tokens": "293.715512428",
"remaining_tokens": "106.284487572"
},
{
"address": "0xB0473C4FeBd722a6d7eE561329d3134030318132",
@@ -50,10 +50,11 @@ const DisplayReward = ({
>
<button>
<div className="flex flex-col items-start">
<span>{formatNumber(toBigNum(reward, decimals))}</span>
<span>{formatNumber(toBigNum(reward, decimals), 4)}</span>
{percentageOfTotal && (
<span className="text-vega-dark-300">
({formatNumber(toBigNum(percentageOfTotal, 4)).toString()}%)
({formatNumber(percentageOfTotal, 4).toString()}
%)
</span>
)}
</div>
@@ -8,7 +8,7 @@ describe('generateEpochIndividualRewardsList', () => {
amount: '100',
percentageOfTotal: '0.1',
receivedAt: new Date(),
asset: { id: 'usd', symbol: 'USD' },
asset: { id: 'usd', symbol: 'USD', name: 'USD' },
party: { id: 'blah' },
epoch: { id: '1' },
};
@@ -18,7 +18,7 @@ describe('generateEpochIndividualRewardsList', () => {
amount: '50',
percentageOfTotal: '0.05',
receivedAt: new Date(),
asset: { id: 'eur', symbol: 'EUR' },
asset: { id: 'eur', symbol: 'EUR', name: 'EUR' },
party: { id: 'blah' },
epoch: { id: '2' },
};
@@ -28,7 +28,7 @@ describe('generateEpochIndividualRewardsList', () => {
amount: '200',
percentageOfTotal: '0.2',
receivedAt: new Date(),
asset: { id: 'gbp', symbol: 'GBP' },
asset: { id: 'gbp', symbol: 'GBP', name: 'GBP' },
party: { id: 'blah' },
epoch: { id: '2' },
};
@@ -38,7 +38,7 @@ describe('generateEpochIndividualRewardsList', () => {
amount: '100',
percentageOfTotal: '0.1',
receivedAt: new Date(),
asset: { id: 'usd', symbol: 'USD' },
asset: { id: 'usd', symbol: 'USD', name: 'USD' },
party: { id: 'blah' },
epoch: { id: '1' },
};
@@ -48,7 +48,7 @@ describe('generateEpochIndividualRewardsList', () => {
amount: '50',
percentageOfTotal: '0.05',
receivedAt: new Date(),
asset: { id: 'eur', symbol: 'EUR' },
asset: { id: 'eur', symbol: 'EUR', name: 'EUR' },
party: { id: 'blah' },
epoch: { id: '2' },
};
@@ -134,20 +134,20 @@ describe('generateEpochIndividualRewardsList', () => {
epoch: '2',
rewards: [
{
asset: 'EUR',
totalAmount: '50',
asset: 'GBP',
totalAmount: '200',
rewardTypes: {
[AccountType.ACCOUNT_TYPE_FEES_INFRASTRUCTURE]: {
amount: '0',
percentageOfTotal: '0',
},
[AccountType.ACCOUNT_TYPE_FEES_LIQUIDITY]: {
amount: '0',
percentageOfTotal: '0',
amount: '200',
percentageOfTotal: '0.2',
},
[AccountType.ACCOUNT_TYPE_GLOBAL_REWARD]: {
amount: '50',
percentageOfTotal: '0.05',
amount: '0',
percentageOfTotal: '0',
},
[AccountType.ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES]: {
amount: '0',
@@ -164,21 +164,21 @@ describe('generateEpochIndividualRewardsList', () => {
},
},
{
asset: 'GBP',
totalAmount: '200',
asset: 'EUR',
totalAmount: '50',
rewardTypes: {
[AccountType.ACCOUNT_TYPE_FEES_INFRASTRUCTURE]: {
amount: '0',
percentageOfTotal: '0',
},
[AccountType.ACCOUNT_TYPE_FEES_LIQUIDITY]: {
amount: '200',
percentageOfTotal: '0.2',
},
[AccountType.ACCOUNT_TYPE_GLOBAL_REWARD]: {
amount: '0',
percentageOfTotal: '0',
},
[AccountType.ACCOUNT_TYPE_GLOBAL_REWARD]: {
amount: '50',
percentageOfTotal: '0.05',
},
[AccountType.ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES]: {
amount: '0',
percentageOfTotal: '0',
@@ -33,7 +33,7 @@ export const generateEpochIndividualRewardsList = (
// We take the rewards and aggregate them by epoch and asset.
const epochIndividualRewards = rewards.reduce((map, reward) => {
const epochId = reward.epoch.id;
const assetName = reward.asset.symbol;
const assetName = reward.asset.name;
const rewardType = reward.rewardType;
const amount = reward.amount;
const percentageOfTotal = reward.percentageOfTotal;
@@ -70,6 +70,12 @@ export const generateEpochIndividualRewardsList = (
'0'
);
if (epoch) {
epoch.rewards = epoch.rewards.sort((a, b) => {
return new BigNumber(b.totalAmount).comparedTo(a.totalAmount);
});
}
return map;
}, new Map<string, EpochIndividualReward>());
@@ -5,6 +5,7 @@ import type {
import { removePaginationWrapper } from '@vegaprotocol/react-helpers';
import { RowAccountTypes } from '../shared-rewards-table-assets/shared-rewards-table-assets';
import type { AccountType } from '@vegaprotocol/types';
import { BigNumber } from '../../../lib/bignumber';
interface EpochSummaryWithNamedReward extends EpochRewardSummaryFieldsFragment {
name: string;
@@ -120,7 +121,9 @@ export const generateEpochTotalRewardsList = (
return {
epoch: epochSummaries[0].epoch,
assetRewards,
assetRewards: assetRewards.sort((a, b) => {
return new BigNumber(b.totalAmount).comparedTo(a.totalAmount);
}),
};
});
@@ -3,6 +3,7 @@ fragment RewardFields on Reward {
asset {
id
symbol
name
}
party {
id
+3 -2
View File
@@ -3,7 +3,7 @@ import * as Types from '@vegaprotocol/types';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
const defaultOptions = {} as const;
export type RewardFieldsFragment = { __typename?: 'Reward', rewardType: Types.AccountType, amount: string, percentageOfTotal: string, receivedAt: any, asset: { __typename?: 'Asset', id: string, symbol: string }, party: { __typename?: 'Party', id: string }, epoch: { __typename?: 'Epoch', id: string } };
export type RewardFieldsFragment = { __typename?: 'Reward', rewardType: Types.AccountType, amount: string, percentageOfTotal: string, receivedAt: any, asset: { __typename?: 'Asset', id: string, symbol: string, name: string }, party: { __typename?: 'Party', id: string }, epoch: { __typename?: 'Epoch', id: string } };
export type DelegationFieldsFragment = { __typename?: 'Delegation', amount: string, epoch: number };
@@ -13,7 +13,7 @@ export type RewardsQueryVariables = Types.Exact<{
}>;
export type RewardsQuery = { __typename?: 'Query', party?: { __typename?: 'Party', id: string, rewardsConnection?: { __typename?: 'RewardsConnection', edges?: Array<{ __typename?: 'RewardEdge', node: { __typename?: 'Reward', rewardType: Types.AccountType, amount: string, percentageOfTotal: string, receivedAt: any, asset: { __typename?: 'Asset', id: string, symbol: string }, party: { __typename?: 'Party', id: string }, epoch: { __typename?: 'Epoch', id: string } } } | null> | null } | null, delegationsConnection?: { __typename?: 'DelegationsConnection', edges?: Array<{ __typename?: 'DelegationEdge', node: { __typename?: 'Delegation', amount: string, epoch: number } } | null> | null } | null } | null, epoch: { __typename?: 'Epoch', id: string, timestamps: { __typename?: 'EpochTimestamps', start?: any | null, end?: any | null, expiry?: any | null } } };
export type RewardsQuery = { __typename?: 'Query', party?: { __typename?: 'Party', id: string, rewardsConnection?: { __typename?: 'RewardsConnection', edges?: Array<{ __typename?: 'RewardEdge', node: { __typename?: 'Reward', rewardType: Types.AccountType, amount: string, percentageOfTotal: string, receivedAt: any, asset: { __typename?: 'Asset', id: string, symbol: string, name: string }, party: { __typename?: 'Party', id: string }, epoch: { __typename?: 'Epoch', id: string } } } | null> | null } | null, delegationsConnection?: { __typename?: 'DelegationsConnection', edges?: Array<{ __typename?: 'DelegationEdge', node: { __typename?: 'Delegation', amount: string, epoch: number } } | null> | null } | null } | null, epoch: { __typename?: 'Epoch', id: string, timestamps: { __typename?: 'EpochTimestamps', start?: any | null, end?: any | null, expiry?: any | null } } };
export type EpochRewardSummaryFieldsFragment = { __typename?: 'EpochRewardSummary', epoch: number, assetId: string, amount: string, rewardType: Types.AccountType };
@@ -37,6 +37,7 @@ export const RewardFieldsFragmentDoc = gql`
asset {
id
symbol
name
}
party {
id
+16 -10
View File
@@ -40,6 +40,7 @@ const newPrice = '200';
const completeWithdrawalBtn = 'complete-withdrawal';
const submitTransferBtn = '[type="submit"]';
const transferForm = 'transfer-form';
const depositSubmit = 'deposit-submit';
// Because the tests are run on a live network to optimize time, the tests are interdependent and must be run in the given order.
describe('capsule - without MultiSign', { tags: '@slow' }, () => {
@@ -76,11 +77,11 @@ describe('capsule - without MultiSign', { tags: '@slow' }, () => {
'contain.text',
`Deposits of ${btcSymbol} not approved`
);
cy.getByTestId('deposit-submit').click();
cy.getByTestId(depositSubmit).click();
cy.getByTestId('dialog-title').should('contain.text', 'Approve complete');
cy.get('[data-testid="Return to deposit"]').click();
cy.get(amountField).clear().type('10');
cy.getByTestId('deposit-submit').click();
cy.getByTestId(depositSubmit).click();
cy.getByTestId(toastContent, txTimeout).should(
'contain.text',
`Transaction confirmedYour transaction has been confirmed.View on EtherscanDeposit 10.00 ${btcSymbol}`,
@@ -179,14 +180,14 @@ describe('capsule - without MultiSign', { tags: '@slow' }, () => {
describe('capsule', { tags: '@slow' }, () => {
before(() => {
cy.createMarket();
cy.get('@markets').then((markets) => {
cy.wrap(markets[0]).as('market');
});
cy.updateCapsuleMultiSig();
});
beforeEach(() => {
cy.createMarket();
cy.get('@markets').then((markets) => {
cy.wrap(markets[0]).as('market');
});
cy.setVegaWallet();
});
@@ -220,7 +221,6 @@ describe('capsule', { tags: '@slow' }, () => {
timeInForce: Schema.OrderTimeInForce.TIME_IN_FORCE_GTC,
};
const rawPrice = removeDecimal(order.price, market.decimalPlaces);
const rawSize = removeDecimal(order.size, market.positionDecimalPlaces);
cy.getByTestId('Collateral').click();
cy.getByTestId('asset', txTimeout).should('contain.text', usdcSymbol);
@@ -238,7 +238,7 @@ describe('capsule', { tags: '@slow' }, () => {
.get(`[data-testid="price-${rawPrice}"]`)
.should('contain.text', order.price)
.get(`[data-testid="bid-vol-${rawPrice}"]`)
.should('contain.text', rawSize);
.should('contain.text', order.size);
cy.getByTestId(ordersTab).click();
cy.getByTestId('edit', txTimeout).should('contain.text', 'Edit');
@@ -410,12 +410,18 @@ describe('capsule', { tags: '@slow' }, () => {
it('approved amount is less than deposit', function () {
// 1001-DEPO-006
cy.getByTestId(depositsTab).click();
cy.getByTestId('deposit-button').click();
cy.get(assetSelectField, txTimeout).select(btcName, { force: true });
cy.contains('Deposits of tBTC not approved').should('not.exist');
cy.contains('Use maximum').should('be.visible');
cy.get(amountField).clear().type('20000000');
cy.getByTestId('deposit-approve-submit').should('be.visible');
cy.getByTestId(depositSubmit).should('be.visible');
cy.getByTestId(depositSubmit).click();
cy.getByTestId('input-error-text').should(
'contain.text',
'Amount is above approved amount.Update approve amount'
);
});
it('withdraw - delay verification', function () {
+1 -1
View File
@@ -98,7 +98,7 @@ export const AssetDetailsDialog = ({
}}
>
{content}
<p className="text-sm mb-4">
<p className="text-sm my-4">
{t(
'There is 1 unit of the settlement asset (%s) to every 1 quote unit.',
[assetSymbol]
@@ -12,7 +12,7 @@ export const DealTicketButton = ({ disabled, variant }: Props) => {
const { pubKey, isReadOnly } = useVegaWallet();
const isDisabled = !pubKey || isReadOnly || disabled;
return (
<div className="mb-4">
<div className="mb-2">
<Button
variant={variant}
fill
@@ -31,7 +31,7 @@ export const DealTicketFeeDetails = ({
<div>
{details.map(({ label, value, labelDescription, symbol }) => (
<div
key={label}
key={typeof label === 'string' ? label : 'value-dropdown'}
className="text-xs mt-2 flex justify-between items-center gap-4 flex-wrap"
>
<div>
@@ -38,7 +38,7 @@ export const DealTicketLimitAmount = ({
};
return (
<div className="mb-6">
<div className="mb-2">
<div className="flex items-center gap-4">
<div className="flex-1">
<FormGroup
@@ -29,9 +29,9 @@ export const DealTicketMarketAmount = ({
: undefined;
return (
<div className="mb-6">
<div className="mb-2">
<div className="flex items-end gap-4 mb-2">
<div className="flex-1 text-sm">Size</div>
<div className="flex-1 text-sm">{t('Size')}</div>
<div />
<div className="flex-2 text-sm text-right">
{isMarketInAuction(marketData.marketTradingMode) && (
@@ -307,7 +307,7 @@ const SummaryMessage = memo(
);
if (isReadOnly) {
return (
<div className="mb-4">
<div className="mb-2">
<InputError testId="dealticket-error-message-summary">
{
'You need to connect your own wallet to start trading on this market'
@@ -318,7 +318,7 @@ const SummaryMessage = memo(
}
if (!pubKey) {
return (
<div className="mb-4">
<div className="mb-2">
<Notification
testId={'deal-ticket-connect-wallet'}
intent={Intent.Warning}
@@ -343,7 +343,7 @@ const SummaryMessage = memo(
}
if (errorMessage === SummaryValidationType.NoCollateral) {
return (
<div className="mb-4">
<div className="mb-2">
<ZeroBalanceError
asset={market.tradableInstrument.instrument.product.settlementAsset}
onClickCollateral={onClickCollateral}
@@ -356,7 +356,7 @@ const SummaryMessage = memo(
// submission render that first
if (errorMessage) {
return (
<div className="mb-4">
<div className="mb-2">
<InputError testId="dealticket-error-message-summary">
{errorMessage}
</InputError>
@@ -368,7 +368,7 @@ const SummaryMessage = memo(
// balance render the margin warning, but still allow submission
if (balanceError) {
return (
<div className="mb-4">
<div className="mb-2">
<MarginWarning balance={balance} margin={margin} asset={asset} />;
</div>
);
@@ -383,7 +383,7 @@ const SummaryMessage = memo(
].includes(marketData.marketTradingMode)
) {
return (
<div className="mb-4">
<div className="mb-2">
<Notification
intent={Intent.Warning}
testId={'dealticket-warning-auction'}
@@ -145,7 +145,7 @@ export const Info = ({ market, onSelect }: InfoProps) => {
}}
decimalPlaces={market.decimalPlaces}
/>
<p className="text-xs">
<p className="text-xs mt-4">
{t(
'There is 1 unit of the settlement asset (%s) to every 1 quote unit (%s).',
[assetSymbol, quoteUnit]
@@ -249,7 +249,7 @@ export const Info = ({ market, onSelect }: InfoProps) => {
dtClassName="text-black dark:text-white text-ui !px-0 !font-normal"
ddClassName="text-black dark:text-white text-ui !px-0 !font-normal max-w-full"
/>
<p className="text-xs">
<p className="text-xs mt-4">
{t(
'There is 1 unit of the settlement asset (%s) to every 1 quote unit (%s).',
[assetSymbol, quoteUnit]
@@ -309,27 +309,40 @@ export const Info = ({ market, onSelect }: InfoProps) => {
),
},
...(market.priceMonitoringSettings?.parameters?.triggers || []).map(
(trigger, i) => ({
title: t(`Price monitoring trigger ${i + 1}`),
content: <MarketInfoTable data={trigger} />,
})
(trigger, i) => {
const bounds = market.data?.priceMonitoringBounds?.[i];
return {
title: t(`Price monitoring bounds ${i + 1}`),
content: (
<div className="text-xs">
<div className="grid grid-cols-2 text-xs mb-4">
<p className="col-span-1">
{t('%s% probability of trading', [
formatNumber(trigger.probability * 100),
])}
</p>
<p className="col-span-1 text-right">
{t('Within %s seconds', [formatNumber(trigger.horizonSecs)])}
</p>
</div>
<div className="pl-2 pb-0 text-xs border-l-2">
{bounds && (
<MarketInfoTable
data={{
highestPrice: bounds.maxValidPrice,
lowestPrice: bounds.minValidPrice,
referencePrice: bounds.referencePrice,
}}
decimalPlaces={assetDecimals}
assetSymbol={quoteUnit}
/>
)}
</div>
</div>
),
};
}
),
...(market.data?.priceMonitoringBounds || []).map((trigger, i) => ({
title: t(`Price monitoring bound ${i + 1}`),
content: (
<>
<MarketInfoTable
data={trigger}
decimalPlaces={market.decimalPlaces}
omits={['referencePrice', '__typename']}
/>
<MarketInfoTable
data={{ referencePrice: trigger.referencePrice }}
decimalPlaces={assetDecimals}
/>
</>
),
})),
{
title: t('Liquidity monitoring parameters'),
content: (
@@ -369,37 +382,38 @@ export const Info = ({ market, onSelect }: InfoProps) => {
content: (
<>
<p className="text-xs mb-4">
{`For liquidity orders count towards a commitment they have to be
within either the liquidity or price monitoring bounds (whichever is
tighter).`}
{`For liquidity orders to count towards a commitment, they must be
within the liquidity monitoring bounds.`}
</p>
<p className="text-xs mb-4">
{`The liquidity price range is a ${liquidityPriceRange} difference from the mid
price.`}
</p>
<MarketInfoTable
data={{
liquidityPriceRange: `${liquidityPriceRange} of mid price`,
lowestPrice:
market.data?.midPrice &&
`${addDecimalsFormatNumber(
new BigNumber(1)
.minus(market.lpPriceRange)
.times(market.data.midPrice)
.toString(),
market.decimalPlaces
)} ${quoteUnit}`,
highestPrice:
market.data?.midPrice &&
`${addDecimalsFormatNumber(
new BigNumber(1)
.plus(market.lpPriceRange)
.times(market.data.midPrice)
.toString(),
market.decimalPlaces
)} ${quoteUnit}`,
}}
></MarketInfoTable>
<div className="pl-2 pb-0 text-xs border-l-2">
<MarketInfoTable
data={{
liquidityPriceRange: `${liquidityPriceRange} of mid price`,
lowestPrice:
market.data?.midPrice &&
`${addDecimalsFormatNumber(
new BigNumber(1)
.minus(market.lpPriceRange)
.times(market.data.midPrice)
.toString(),
market.decimalPlaces
)} ${quoteUnit}`,
highestPrice:
market.data?.midPrice &&
`${addDecimalsFormatNumber(
new BigNumber(1)
.plus(market.lpPriceRange)
.times(market.data.midPrice)
.toString(),
market.decimalPlaces
)} ${quoteUnit}`,
}}
></MarketInfoTable>
</div>
</>
),
},
@@ -6,6 +6,7 @@ import {
formatNumber,
formatNumberPercentage,
isNumeric,
toDecimal,
toNumberParts,
} from './number';
@@ -197,3 +198,20 @@ describe('compactNumber', () => {
}
);
});
describe('toDecimal', () => {
it.each([
{ v: 0, o: '1' },
{ v: 1, o: '0.1' },
{ v: 2, o: '0.01' },
{ v: 3, o: '0.001' },
{ v: 4, o: '0.0001' },
{ v: 5, o: '0.00001' },
{ v: 6, o: '0.000001' },
{ v: 7, o: '0.0000001' },
{ v: 8, o: '0.00000001' },
{ v: 9, o: '0.000000001' },
])('formats with toNumber given number correctly', ({ v, o }) => {
expect(toDecimal(v)).toStrictEqual(o);
});
});
+1 -1
View File
@@ -1,4 +1,4 @@
{
"name": "@vegaprotocol/ui-toolkit",
"version": "0.0.1"
"version": "0.7.0"
}
@@ -20,7 +20,7 @@ export const FormGroup = ({
labelAlign = 'left',
hideLabel = false,
}: FormGroupProps) => {
const wrapperClasses = classNames('relative mb-6', className);
const wrapperClasses = classNames('relative mb-2', className);
const labelClasses = classNames('block mb-2 text-sm', {
'text-right': labelAlign === 'right',
'sr-only': hideLabel,
@@ -24,11 +24,7 @@ export const KeyValueTable = ({
return (
<React.Fragment>
{title && <TitleTag className={`text-xl my-2`}>{title}</TitleTag>}
<div
data-testid="key-value-table"
{...rest}
className={classNames('mb-4', className)}
>
<div data-testid="key-value-table" {...rest} className={className}>
<div>
{children &&
React.Children.map(
+1 -1
View File
@@ -50,7 +50,7 @@ export const Nav = ({
title,
}: NavbarProps) => {
const themeWrapperClasses = classNames(
'w-full overflow-y-hidden overflow-x-auto md:overflow-x-hidden font-alpha calt lg:text-lg',
'w-full overflow-y-hidden overflow-x-auto md:overflow-x-hidden font-alpha lg:text-lg',
{
dark: navbarTheme === 'dark',
}
@@ -155,7 +155,7 @@ export const Toast = ({
'w-[320px] rounded-md overflow-hidden',
'shadow-[8px_8px_16px_0_rgba(0,0,0,0.4)]',
'text-black dark:text-white',
'font-alpha calt text-[14px] leading-[19px]',
'font-alpha text-[14px] leading-[19px]',
// background
{
'bg-vega-light-100 dark:bg-vega-dark-100 ': intent === Intent.None,
+1 -1
View File
@@ -14,7 +14,7 @@
"vegacapsule": "vegacapsule network bootstrap --config-path=../frontend-monorepo/vegacapsule/config.hcl"
},
"engines": {
"node": ">=16.14.0"
"node": ">=16.15.1"
},
"private": true,
"dependencies": {