bitshares / bitshares-ui

Fully featured Graphical User Interface / Reference Wallet for the BitShares Blockchain
https://wallet.bitshares.org
MIT License
517 stars 570 forks source link

[5][manikey123] Add Collateral Bids to Dashboard #2504

Open iamredbar opened 5 years ago

iamredbar commented 5 years ago

Is your feature request related to a problem? Please describe. It takes a few clicks to get to the collateral bids to monitor them. It would be nice to see those bids in the dashboard as an easy reference.

Describe the solution you'd like I would like to see a tab in the dashboard for collateral bids (if applicable). Sort of like how proposals show up if they are present. This would also give a little more attention to the smart assets and give more incentive to be involved.

Alternative An alternative could be having the Collateral Bid tab viewable by everyone, regardless of having a collateral bid or not.

Additional context Potential tab order in the dashboard for the addition of Collateral Bids:

startailcoon commented 5 years ago

It's a good idea. We would need to make sure that we can add a specifc users collateral bids to its own tab, like margin orders, if one has active orders on chain.

manikey123 commented 5 years ago

claiming this ticket. do suggest

startailcoon commented 5 years ago

It's yours @manikey123

manikey123 commented 5 years ago

Wanted to confirm what information needs to be printed for each asset. For illustration purpose, considering two assets (bitBTC and bitGOLD)

  1. bitBTC From https://wallet.bitshares.org/#/asset/btc Do you need to display only below part (image below)

image

  1. bitGOLD From https://wallet.bitshares.org/#/asset/GOLD Do you need to display only below part (image below) image @clockworkgr @sschiessl-bcp
sschiessl-bcp commented 5 years ago

On the dashboard of the user, only show bids that were done by that same user. Also, please use the style-guide table to display and not the old component, the shown columns should be the same.

manikey123 commented 5 years ago

On the dashboard of the user, only show bids that were done by that same user. Also, please use the style-guide table to display and not the old component, the shown columns should be the same.

  1. can you share the link for the new style guide ?
  2. currently collateral bid order shows up at "Dashboard>>Activity" (image below). should the same styling be applied over to the new Tab or there are some improvements in style guide ? image
sschiessl-bcp commented 5 years ago

The table should look like https://wallet.bitshares.org/#/asset/GOLD.

Please find another implementation in the UI that uses Table from bitshares-styleguide, should be straightforward. I'm not in office atm

manikey123 commented 5 years ago

PartA>

The table should look like https://wallet.bitshares.org/#/asset/GOLD.

So a given user should only see his order and not all orders as outlined in below format : image

PartB>

Please find another implementation in the UI that uses Table from bitshares-styleguide, should be straightforward. I'm not in office atm

ok. thanks.

manikey123 commented 5 years ago

can anyone confirm Part A> so as to begin

startailcoon commented 5 years ago

On Part A

Yes. Relevant information from that table should be visible on the users section.

On Part B

You should follow the standard requirements when you work on a tasks which relates somehow to UI part:

  1. We use only ant framework - http://ant.design but using our personal wrapper (style-guide): Live: https://styleguide.bitshares.org/#/dark Github: https://github.com/bitshares/bitshares-ui-style-guide - there you can find all integrated components which we support from ant.design framework.

If you can't find some component you need please let me know and I'll add them.

  1. When you work with old components please replace all of them by ant components.
  2. Please follow component-container pattern (for e.g. - https://medium.com/teamsubchannel/react-component-patterns-e7fb75be7bb0)
OpenLedgerApp commented 5 years ago

@startailcoon, if this task is unassigned, I can take it.

startailcoon commented 5 years ago

@OpenLedgerApp It's yours. Everything clear on the task?

manikey123 commented 5 years ago

Sorry for delay on this. I got sidetracked with bitshares boston hackathon and subsequently helping on beet tickets. I can resume on the task , if you dont mind.

startailcoon commented 5 years ago

Sorry for delay on this. I got sidetracked with bitshares boston hackathon and subsequently helping on beet tickets. I can resume on the task , if you dont mind.

@manikey123 I unassigned this from you after 4 weeks of no updates and it was that for another 10 days before it was assigned OpenLedgerApp. Please follow up on your issues in the future and post an update if there are delays. This is one of the requirements stated in CONTRIBUTING.md

If an issue misses the intended milestone completion, be sure to make a comment on your progress including the reason for the delay. The issue is pushed to the next milestone. Failing to comment or complete the issue will result in release of the assigned issue and could result in no bounty pay.

manikey123 commented 5 years ago

sorry about above. will take note going forward. resuming on the ticket.

manikey123 commented 5 years ago

extracted relevant collateral information from the react code and currently coding the UI mockup. I shall share the UI mockup over the PST weekend.

manikey123 commented 5 years ago

Please find the three approaches to get Account level filtered and Asset level aggregated collateral information. IMO I prefer Approach 3>. Look forward to your feedback/suggestion.

Approach 1> ChainStore Approach as used in Margin Positions Page ChainStore designed in bitsharesJS ChainStore is used to get account level information and store in the account object in account overview page and is loaded when the account is loaded. It makes various calls to the APIs and has 30 mapped operations. It has call orders which is used for the Margin Positions page likewise we could design a collateral only account specific asset summary information

Approach 2> Using get_account_history which is present in Using get_account_history get_account_history operation done in chain store, sets the maps of account.get("history") gets the history associated for the account. It has order info as below. It provides the asset level transaction details for a given account. These transactions need to be then grouped/ aggregated to represent the summary information. Basically we perfom group by asset calculations. { "id": "1.11.895962928", "op": [ 45, { "fee": { "amount": 2526, "asset_id": "1.3.0" }, "bidder": "1.2.1151585", "additional_collateral": { "amount": 100000, "asset_id": "1.3.0" }, "debt_covered": { "amount": 1000000, "asset_id": "1.3.106" }, "extensions": [] } ], "result": [ 0, {} ], "block_num": 38167451, "trx_in_block": 12, "op_in_trx": 0, "virtual_op": 51342 }

app/lib/common/MarketClasses.js image

Does above order match the order in the above JSON ? Approach 3> Make a API in Core to get_collateral_bid_by account and group by assettype By this approach, a call is made in bts core and directly used in the UI and the collateral bid class in app/lib/common/MarketClasses.js
sschiessl-bcp commented 5 years ago

How is it done in the current CollateralBid overview?

Are collateral bids included in the get_full_account return value?

manikey123 commented 5 years ago

will update after going through the current release of core

manikey123 commented 5 years ago

How is it done in the current CollateralBid overview?

In the current view CollateralBid overview is done based on the asset value. There is no way to get the collateral value based on the accont name or account id (2hrs effort)

Are collateral bids included in the get_full_account return value? The colateral values for the executed call_orders are present just like margin orders The open collateral bids which are not executed are not present (2hrs effort)

I recommend using approach 3 : making an API for getCollateralBidsByAcct(const string & names_or_ids) Do suggest

startailcoon commented 5 years ago

I recommend using approach 3 : making an API for getCollateralBidsByAcct(const string & names_or_ids) Do suggest

If that is the best approach, making an issue in the core repository is in order so we can have it included.

sschiessl-bcp commented 5 years ago

Both should be present, a separate call and inclusionin get_full_account

abitmore commented 5 years ago

I thought it's already in get_full_accounts. Will check.

abitmore commented 5 years ago

Oh, there is the issue for adding the APIs https://github.com/bitshares/bitshares-core/issues/1871

sschiessl-bcp commented 4 years ago

On hold until core provides this possibility.