Merge branch 'develop' of github.com:vegaprotocol/frontend-monorepo into feat/margin-maintenance-level

This commit is contained in:
Madalina Raicu
2023-02-27 19:08:15 +00:00
8 changed files with 51 additions and 35 deletions
+32 -21
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": "66600.6885662553549491123",
"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": "1284.23843228530725",
"deposits": [
{
"amount": "2500",
@@ -3215,7 +3215,7 @@
"tranche_end": "2023-08-01T00:00:00.000Z",
"total_added": "37500",
"total_removed": "3295.491386325",
"locked_amount": "32060.042107888275",
"locked_amount": "32008.126630601595",
"deposits": [
{
"amount": "7500",
@@ -3359,7 +3359,7 @@
"tranche_end": "2023-12-05T00:00:00.000Z",
"total_added": "129999.45",
"total_removed": "0",
"locked_amount": "66599.36741953379042928",
"locked_amount": "66539.923817958609949455",
"deposits": [
{
"amount": "129999.45",
@@ -3425,7 +3425,7 @@
"tranche_end": "2023-09-03T00:00:00.000Z",
"total_added": "62600",
"total_removed": "0",
"locked_amount": "32199.23383434805018",
"locked_amount": "32156.25787037037408",
"deposits": [
{
"amount": "10000",
@@ -3618,7 +3618,7 @@
"tranche_end": "2023-09-17T00:00:00.000Z",
"total_added": "5000",
"total_removed": "0",
"locked_amount": "2763.604610603755",
"locked_amount": "2760.1720256215125",
"deposits": [
{
"amount": "5000",
@@ -3829,7 +3829,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "97499.58",
"total_removed": "0",
"locked_amount": "8549.9770497729426934506",
"locked_amount": "8491.6684140496565878092",
"deposits": [
{
"amount": "97499.58",
@@ -3862,7 +3862,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "135173.4239508",
"total_removed": "98230.390980249184455396",
"locked_amount": "11686.34253508108202110958958",
"locked_amount": "11606.644696613363239057508256",
"deposits": [
{
"amount": "135173.4239508",
@@ -3908,7 +3908,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "32499.86",
"total_removed": "0",
"locked_amount": "3596.8276946333941696698",
"locked_amount": "3572.2982585208873489478",
"deposits": [
{
"amount": "32499.86",
@@ -3941,7 +3941,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "10833.29",
"total_removed": "0",
"locked_amount": "1170.7325118133853096759",
"locked_amount": "1162.7484183867779537778",
"deposits": [
{
"amount": "10833.29",
@@ -3974,7 +3974,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "22749.93",
"total_removed": "4720.860935375",
"locked_amount": "4376.4596075425397060448",
"locked_amount": "4346.6132830988218703751",
"deposits": [
{
"amount": "6500",
@@ -4126,7 +4126,7 @@
"tranche_end": "2023-05-01T00:00:00.000Z",
"total_added": "22500",
"total_removed": "4832.532899775",
"locked_amount": "7799.561176335174675",
"locked_amount": "7768.411889963167125",
"deposits": [
{
"amount": "7500",
@@ -4390,7 +4390,7 @@
"tranche_end": "2023-06-02T00:00:00.000Z",
"total_added": "1939928.38",
"total_removed": "928642.9598472029154",
"locked_amount": "503547.66972674586634472",
"locked_amount": "502215.87592198306198629",
"deposits": [
{
"amount": "1852091.69",
@@ -36770,7 +36770,7 @@
"tranche_end": "2023-06-05T00:00:00.000Z",
"total_added": "3732368.4671",
"total_removed": "615950.831401702010493",
"locked_amount": "798278.776421275325414380233",
"locked_amount": "796232.273024709558568810279",
"deposits": [
{
"amount": "1998.95815",
@@ -38118,8 +38118,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": "581409.88924190582035452",
"locked_amount": "8123076.1027882686093883722947201633400919",
"deposits": [
{
"amount": "16249.93",
@@ -38633,6 +38633,11 @@
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0x2d99d4051c6ac81037db1eebf0f86b335ed9d1957f281134d07da192644a6a8c"
},
{
"amount": "1468.73477394015521",
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
"tx": "0x525f9427c131bc2fdea7f556d16b7781faaa41e09c7735d1c02d1f7585cc49ab"
},
{
"amount": "535.4042378778335",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -41844,6 +41849,12 @@
}
],
"withdrawals": [
{
"amount": "1468.73477394015521",
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
"tranche_id": 2,
"tx": "0x525f9427c131bc2fdea7f556d16b7781faaa41e09c7735d1c02d1f7585cc49ab"
},
{
"amount": "1640.93679110232897",
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
@@ -42086,8 +42097,8 @@
}
],
"total_tokens": "150551.801",
"withdrawn_tokens": "71968.00074341356817",
"remaining_tokens": "78583.80025658643183"
"withdrawn_tokens": "73436.73551735372338",
"remaining_tokens": "77115.06548264627662"
},
{
"address": "0x4d982Ab0823fD2f48e934a7be2bb0a5374a26148",
@@ -43861,7 +43872,7 @@
"tranche_end": "2023-05-05T00:00:00.000Z",
"total_added": "14597706.0446472999",
"total_removed": "5576016.212508497282613906",
"locked_amount": "1784426.168875606617258788877936648",
"locked_amount": "1777726.765473197066260457387430519",
"deposits": [
{
"amount": "129284.449",
@@ -50908,7 +50919,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "5778205.3912159303",
"total_removed": "3055768.040200763217391295",
"locked_amount": "388134.167902190321713268137737088",
"locked_amount": "385487.193100244108102591696423251",
"deposits": [
{
"amount": "552496.6455",
@@ -52947,7 +52958,7 @@
"tranche_end": "2023-06-05T00:00:00.000Z",
"total_added": "472355.6199999996",
"total_removed": "34416.2282090650685",
"locked_amount": "126491.83527997644210121089142566",
"locked_amount": "126167.555118478468636691490005064",
"deposits": [
{
"amount": "3000",
+1 -1
View File
@@ -98,7 +98,7 @@ export const AssetDetailsDialog = ({
}}
>
{content}
<p className="text-sm mb-4 mt-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
@@ -38,7 +38,7 @@ export const DealTicketLimitAmount = ({
};
return (
<div className="mb-4">
<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-4">
<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'}
@@ -315,12 +315,10 @@ export const Info = ({ market, onSelect }: InfoProps) => {
title: t(`Price monitoring bounds ${i + 1}`),
content: (
<div className="text-xs">
{/* <MarketInfoTable data={trigger} /> */}
<div className="grid grid-cols-2 text-xs mb-4">
<p className="col-span-1">
{t('%s% probability of trading', [
formatNumber(trigger.probability * 100),
formatNumber(trigger.horizonSecs),
])}
</p>
<p className="col-span-1 text-right">
@@ -201,9 +201,16 @@ 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: 0, o: '0' },
{ v: 9, o: '0.000000001' },
])('formats with toNumber given number correctly', ({ v, o }) => {
expect(toDecimal(v)).toStrictEqual(o);
});