bigshortbets / market-frontend

BigShortBet$ P2P Market is a cutting-edge peer-to-peer marketplace built on the principles of decentralization that allows direct P2P trading on unique & event-based markets. Enjoy ultra-low fees and no swaps. Powered by $BigSB.
https://app.bigsb.io
GNU General Public License v3.0
2 stars 5 forks source link

Rename "Total Deposits" to "Used Balance" and "Market Deposit" to "Market Margin" #90

Closed DanDanielD closed 2 months ago

DanDanielD commented 6 months ago

Following the agreed logic for displaying fund structure on the market, the following changes are required:

-Rename "Total Deposits" to "Used Balance". -Rename "Market Deposit" to "Market Margin".

As per the planned design, Used Balance will display the sum of the following amounts: -All initial margins currently reserved for open orders -All initial margins of open positions -All market margins Market Deposit will be renamed to Market Margin for better clarity.

Screenshot of the expected result: ScreenShot 31 05 24 at 18-05-10

Klapeyron commented 4 months ago

Depends on: https://github.com/bigshortbets/indexer/pull/75

Klapeyron commented 4 months ago

@autopilot

codeautopilot[bot] commented 4 months ago

@autopilot

Hi @Klapeyron,

Thank you for the update. I have noted the dependency on https://github.com/bigshortbets/indexer/issues/69. Once that issue is resolved, we can proceed with the renaming changes as described.

If you need any further assistance or have additional questions, feel free to ask!

Best regards, Autopilot

Klapeyron commented 4 months ago

@autopilot

codeautopilot[bot] commented 4 months ago

@autopilot

Hi @Klapeyron,

Is there anything specific you need assistance with regarding this issue? Please let me know how I can help!

Best regards, Autopilot

Klapeyron commented 4 months ago

@autopilot solve this issue

codeautopilot[bot] commented 4 months ago

@autopilot solve this issue

Hi @Klapeyron,

To solve this issue, please follow these steps:

  1. Update the Labels in the Codebase:

    • Rename "Total Deposits" to "Used Balance".
    • Rename "Market Deposit" to "Market Margin".
  2. Ensure the Calculations for Used Balance are Correct:

    • Verify that Used Balance displays the sum of:
      • All initial margins currently reserved for open orders.
      • All initial margins of open positions.
      • All market margins.
  3. Update the UI:

    • Make sure the UI reflects the new labels and calculations as per the planned design.
  4. Test the Changes:

    • Ensure that the changes are correctly reflected in the UI.
    • Verify that the calculations for Used Balance are accurate.
  5. Update Documentation:

    • Update any relevant documentation to reflect the new terminology.
  6. Resolve Dependencies:

If you need any specific code snippets or further assistance with any of these steps, please let me know!

Best regards, Autopilot

Klapeyron commented 4 months ago

@autopilot propose code solution

codeautopilot[bot] commented 4 months ago

@autopilot propose code solution

Hi @Klapeyron,

Sure, here is a proposed code solution to address the renaming and calculation changes:

1. Update the Labels in the Codebase

Before:

const labels = {
  totalDeposits: "Total Deposits",
  marketDeposit: "Market Deposit",
};

After:

const labels = {
  usedBalance: "Used Balance",
  marketMargin: "Market Margin",
};

2. Ensure the Calculations for Used Balance are Correct

Before:

const totalDeposits = initialMarginsOpenOrders + initialMarginsOpenPositions + marketDeposits;

After:

const usedBalance = initialMarginsOpenOrders + initialMarginsOpenPositions + marketMargins;

3. Update the UI

Before:

<div>
  <label>{labels.totalDeposits}</label>
  <span>{totalDeposits}</span>
</div>
<div>
  <label>{labels.marketDeposit}</label>
  <span>{marketDeposits}</span>
</div>

After:

<div>
  <label>{labels.usedBalance}</label>
  <span>{usedBalance}</span>
</div>
<div>
  <label>{labels.marketMargin}</label>
  <span>{marketMargins}</span>
</div>

4. Test the Changes

Ensure that the UI reflects the new labels and calculations correctly. You can use unit tests or manual testing to verify the changes.

5. Update Documentation

Update any relevant documentation to reflect the new terminology. For example, if you have a README or a user guide, make sure to update the terms "Total Deposits" and "Market Deposit" to "Used Balance" and "Market Margin" respectively.

6. Resolve Dependencies

Ensure that the dependency on https://github.com/bigshortbets/indexer/issues/69 is resolved before proceeding with these changes.

If you need further assistance or specific code snippets for a particular framework or library, please let me know!

Best regards, Autopilot

Klapeyron commented 4 months ago

@autopilot dependency is resolved

codeautopilot[bot] commented 4 months ago

@autopilot dependency is resolved

Hi @Klapeyron,

Great to hear that the dependency is resolved! Here are the steps to implement the changes:

1. Update the Labels in the Codebase

Before:

const labels = {
  totalDeposits: "Total Deposits",
  marketDeposit: "Market Deposit",
};

After:

const labels = {
  usedBalance: "Used Balance",
  marketMargin: "Market Margin",
};

2. Ensure the Calculations for Used Balance are Correct

Before:

const totalDeposits = initialMarginsOpenOrders + initialMarginsOpenPositions + marketDeposits;

After:

const usedBalance = initialMarginsOpenOrders + initialMarginsOpenPositions + marketMargins;

3. Update the UI

Before:

<div>
  <label>{labels.totalDeposits}</label>
  <span>{totalDeposits}</span>
</div>
<div>
  <label>{labels.marketDeposit}</label>
  <span>{marketDeposits}</span>
</div>

After:

<div>
  <label>{labels.usedBalance}</label>
  <span>{usedBalance}</span>
</div>
<div>
  <label>{labels.marketMargin}</label>
  <span>{marketMargins}</span>
</div>

4. Test the Changes

Ensure that the UI reflects the new labels and calculations correctly. You can use unit tests or manual testing to verify the changes.

5. Update Documentation

Update any relevant documentation to reflect the new terminology. For example, if you have a README or a user guide, make sure to update the terms "Total Deposits" and "Market Deposit" to "Used Balance" and "Market Margin" respectively.

If you need further assistance or specific code snippets for a particular framework or library, please let me know!

Best regards, Autopilot

Klapeyron commented 2 months ago

Associated with: https://github.com/bigshortbets/market-frontend/issues/93

DanDanielD commented 2 months ago

We have revised the design and will now display three elements: Account Balance, Available Balance, and Market Margin (which will remain unchanged).

image

Klapeyron commented 2 months ago

Depends on: https://github.com/bigshortbets/market-frontend/issues/96