Skip to content

Commit

Permalink
WalletInspect: Added fees per each pair in wallet.
Browse files Browse the repository at this point in the history
Changes to be committed:
	modified:   Extras/Mimic/WalletInspect
  • Loading branch information
rapmd73 committed Mar 29, 2024
1 parent 86bc0f2 commit d39491a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Binary file added Extras/Mimic/.WalletInspect.swp
Binary file not shown.
8 changes: 7 additions & 1 deletion Extras/Mimic/WalletInspect
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if not os.path.exists(acn):

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

fees={}
cnr={}
Wallet={}

Expand Down Expand Up @@ -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)
Expand All @@ -74,14 +78,16 @@ 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)

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()

0 comments on commit d39491a

Please sign in to comment.