Skip to content

Commit d39491a

Browse files
committed
WalletInspect: Added fees per each pair in wallet.
Changes to be committed: modified: Extras/Mimic/WalletInspect
1 parent 86bc0f2 commit d39491a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Extras/Mimic/.WalletInspect.swp

1 KB
Binary file not shown.

Extras/Mimic/WalletInspect

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ if not os.path.exists(acn):
3131

3232
lines=JRRsupport.ReadFile(acn).strip().split('\n')
3333

34+
fees={}
3435
cnr={}
3536
Wallet={}
3637

@@ -66,6 +67,9 @@ for line in lines:
6667
if data['Asset'] not in Wallet:
6768
Wallet[data['Asset']]=[]
6869

70+
if data['Asset'] not in fees:
71+
fees[data['Asset']]=0
72+
6973
if act=='B':
7074
if bw!=0:
7175
cnr[data['Asset']]-=abs(p*a)
@@ -74,14 +78,16 @@ for line in lines:
7478
elif act=='S':
7579
cnr[data['Asset']]+=abs(p*a)
7680

81+
fees[data['Asset']]+=f
82+
7783
str=f"{dt} {act} {bw:14.8f} {qw:14.8f} {a:14.8f} {p:.8f} {f:.8f} {cnr[data['Asset']]:14.8f}"
7884
Wallet[data['Asset']].append(str)
7985

8086
for pair in sorted(Wallet.keys()):
8187
if len(sys.argv)>2 and sys.argv[2]!=pair:
8288
continue
8389

84-
print(f"{pair}:")
90+
print(f"{pair}: {fees[pair]:.8f} paid in fees")
8591
for l in Wallet[pair]:
8692
print(f" {l}")
8793
print()

0 commit comments

Comments
 (0)