From d39491aa9813e717a739d9bb36b38a5f13d3f6eb Mon Sep 17 00:00:00 2001 From: Rose Heart Date: Fri, 29 Mar 2024 15:00:59 +0000 Subject: [PATCH] WalletInspect: Added fees per each pair in wallet. Changes to be committed: modified: Extras/Mimic/WalletInspect --- Extras/Mimic/.WalletInspect.swp | Bin 0 -> 1024 bytes Extras/Mimic/WalletInspect | 8 +++++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 Extras/Mimic/.WalletInspect.swp diff --git a/Extras/Mimic/.WalletInspect.swp b/Extras/Mimic/.WalletInspect.swp new file mode 100644 index 0000000000000000000000000000000000000000..0897fa2e59122621fe9c441fe937f6f7ba3b3ca2 GIT binary patch literal 1024 zcmYc?$V<%2S1{8vVn6|h%y}4!^7Bhj1aWYRQgae3Qd4vb5{pYxON(%*VqkEsC@D%T p*7wcK%}mx0Pt3_lE%D4NE=Wx#$`+i)j!KM%z-R~%7XqQ^$^eW07Ayb& literal 0 HcmV?d00001 diff --git a/Extras/Mimic/WalletInspect b/Extras/Mimic/WalletInspect index 19e140b..d461dab 100755 --- a/Extras/Mimic/WalletInspect +++ b/Extras/Mimic/WalletInspect @@ -31,6 +31,7 @@ if not os.path.exists(acn): lines=JRRsupport.ReadFile(acn).strip().split('\n') +fees={} cnr={} Wallet={} @@ -66,6 +67,9 @@ for line in lines: if data['Asset'] not in Wallet: Wallet[data['Asset']]=[] + if data['Asset'] not in fees: + fees[data['Asset']]=0 + if act=='B': if bw!=0: cnr[data['Asset']]-=abs(p*a) @@ -74,6 +78,8 @@ for line in lines: elif act=='S': cnr[data['Asset']]+=abs(p*a) + fees[data['Asset']]+=f + str=f"{dt} {act} {bw:14.8f} {qw:14.8f} {a:14.8f} {p:.8f} {f:.8f} {cnr[data['Asset']]:14.8f}" Wallet[data['Asset']].append(str) @@ -81,7 +87,7 @@ for pair in sorted(Wallet.keys()): if len(sys.argv)>2 and sys.argv[2]!=pair: continue - print(f"{pair}:") + print(f"{pair}: {fees[pair]:.8f} paid in fees") for l in Wallet[pair]: print(f" {l}") print()