Skip to content

Commit

Permalink
debugging rate-change
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgunozerk committed Feb 4, 2024
1 parent f914c6f commit 85de402
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/controllers/report_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,9 @@ class ReportController extends GetxController {
);

// we set `endValue` and `amount` later
if (assetUid.item2 == 'link' || assetUid.item2 == 'chainlink') {
print("price: ${currentAssetData!.price}, for i: $i");
}

// Calculate the deposit/withdrawal for each asset, category, and report
double amountDiff;
Expand Down Expand Up @@ -360,6 +363,24 @@ class ReportController extends GetxController {
return AssetItem(assetId, assetReport, category, assetType);
}))
.toList();

_report.value.categories.entries
.where((categoryEntry) => categoryEntry.key == 'crypto')
.forEach((categoryEntry) {
categoryEntry.value.assets.entries
.where((assetEntry) =>
assetEntry.key.item2 == 'chainlink' ||
assetEntry.key.item2 == 'link')
.forEach((assetEntry) {
print("start value: ${assetEntry.value.startValue}");
print("end value: ${assetEntry.value.endValue}");
print("deposit: ${assetEntry.value.deposit}");
print("withdrawal: ${assetEntry.value.withdrawal}");
print("net deposit: ${assetEntry.value.netDeposit}");
print("profit: ${assetEntry.value.profit}");
print("rate change: ${assetEntry.value.rateChange}");
});
});
}

void _calculateTopGainers() {
Expand Down

0 comments on commit 85de402

Please sign in to comment.