100: Add Perps collateral, leverage, value, uPnL and gross-exposure totals in EMC
This commit is contained in:
@@ -162,11 +162,20 @@ final class PerpsTab {
|
||||
List<TreeItem<PositionRow>> wallets = new ArrayList<>();
|
||||
Map<String, TreeItem<PositionRow>> existingWallets = childrenById(table.getRoot());
|
||||
for (PerpsSnapshot.Wallet wallet : snapshot.wallets()) {
|
||||
String walletNotes = TOTAL_NOTES;
|
||||
for (PerpsSnapshot.Venue venue : wallet.venues()) {
|
||||
if (venue.positions().isEmpty() && venue.crossAccounts().isEmpty()) {
|
||||
walletNotes += "\n" + venue.name() + " (no rows): " + status(venue);
|
||||
}
|
||||
}
|
||||
TreeItem<PositionRow> walletItem = item(existingWallets,
|
||||
group(wallet.id(), wallet.name(), wallet.totals(), TOTAL_NOTES));
|
||||
group(wallet.id(), wallet.name(), wallet.totals(), walletNotes));
|
||||
List<TreeItem<PositionRow>> venues = new ArrayList<>();
|
||||
Map<String, TreeItem<PositionRow>> existingVenues = childrenById(walletItem);
|
||||
for (PerpsSnapshot.Venue venue : wallet.venues()) {
|
||||
if (venue.positions().isEmpty() && venue.crossAccounts().isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
String status = status(venue);
|
||||
String label = venue.name() + (venue.lastSuccess() == null
|
||||
? venue.failed() ? " (unavailable)" : " (loading)" : venue.failed() ? " (retained)" : "");
|
||||
@@ -288,7 +297,7 @@ final class PerpsTab {
|
||||
+ "account exactly once, including free capital in those accounts. Cross position requirements are "
|
||||
+ "not added to owned collateral. Missing inputs make the affected total unavailable. "
|
||||
+ "Successfully read empty scopes total zero. Totals can include last-success observations retained "
|
||||
+ "after failures; inspect venue read status. Ratios are not aggregated.";
|
||||
+ "after failures; inspect wallet and venue read status. Ratios are not aggregated.";
|
||||
private static final String LONG_ROW_STYLE = "-fx-control-inner-background: #e6f4ea;"
|
||||
+ "-fx-control-inner-background-alt: #e6f4ea;";
|
||||
private static final String SHORT_ROW_STYLE = "-fx-control-inner-background: #fce8e6;"
|
||||
|
||||
Reference in New Issue
Block a user