• Short guides to forum navigation, searching, posting, translation, alerts and notifications viewable by clicking here.
  • Türk dostlarımıza hoş geldiniz Giriş burada.
  • Scammers are running ads on Facebook and Instagram claiming a giveaway. DO NOT OPEN THESE LINKS AND LOG IN. See this thread: here
  • The Kinesis Community Forum will be down starting on Friday, Eastern Standard Time, and is expected to be back online on Monday. Big changes in the backend are coming!

[Forensics] KAU flow-graph

KAU-digraph-arc-flows.png
Sum of flows for records of Type 1
Sum of flows for records of type 0 is penciled in in lower left (48.8M).
Mistake: Type 2. Wrong. Type 0. I can't be bothered to rescan (turnaround time too big)

We draw the Type 1 numbers as flows on the arcs of a digraph.
In some cases, we'll sum INBOUND flows or OUTBOUND flows later. To check no flows come into R for example.
Arc counts:
(not to be confused with actual flows on each arc)
Code:
1 payment 8336
0 create_account 37412
[CODE]

I'll fill in the details in the replies.
This will be similar to the same work I did for KAG yesterday.

For reference:
[CODE]
linux> set | grep ^KAU | sort
KAU_EmissionAccount=GDIENNQ3BXCTB74ZYCQAGXCY7KTGFBZGHRMUVF3ZLIW6SMAZIGX2JCCS
KAU_extract=../Blockchain-Exploration/KAU/stellar-export-KAU-2023-02-24-T09:37:45-UTC.csv
KAU_GAPSAccount=GAPS3KZ4YVEL4UYFAGTE6L6H6GRZ3KYBWGY2UTGTAJBXGUJLBCYQIXXA
KAU_HotWalletAccount=GBUBOKEFUNF4ZZQA7QJCGYF54U4N2T5VV2QAN7RWQCVS75OOI5KSVCZS
KAU_InflationAccount=GCO75U2EVO3HKGYO2PUO2ZO7CEL52JPQL5WYUHHKPEORQSASSKT4MA3B
KAU_RootAccount=GDTYNME5HX3FCFDS4D3R3LTVH3DFLSB5HWVTV3VVL4PBGQ6SCKC7J3PD

Listed alphabetically.

Later I'll use
e g h i r
in alphabetic order
for the above when passing these into awk scripts.
In programming, it pays to be manic.

In the pencil digraph, I use uppercase for the same
E G H I R
The G account appears to be the same as for KAG.
I don't know that. Just making an educated guess.

Can be checked in the browser Explorer, here
Has numbers for both KAG and KAU.
(in non-alphabetic order)
 
Using same bag of tricks as I did for KAG digraph yesterday,
Let's begin in reverse. With the results.
The flows along each arc.
The complete digraph on 5 vertices.

Should correspond to what I pencilled in to the KAU digraph above.
Code:
KAU_EmissionAccount
KAU_EmissionAccount
0.00      
KAU_EmissionAccount
KAU_GAPSAccount
0.00      
KAU_EmissionAccount
KAU_HotWalletAccount
0.00      
KAU_EmissionAccount
KAU_InflationAccount
0.00      
KAU_EmissionAccount
KAU_RootAccount
0.00      
KAU_GAPSAccount
KAU_EmissionAccount
0.00      
KAU_GAPSAccount
KAU_GAPSAccount
0.00      
KAU_GAPSAccount
KAU_HotWalletAccount
609000.10 
KAU_GAPSAccount
KAU_InflationAccount
0.00      
KAU_GAPSAccount
KAU_RootAccount
0.00      
KAU_HotWalletAccount
KAU_EmissionAccount
47890335.19
KAU_HotWalletAccount
KAU_GAPSAccount
1426078.51
KAU_HotWalletAccount
KAU_HotWalletAccount
0.00      
KAU_HotWalletAccount
KAU_InflationAccount
0.00      
KAU_HotWalletAccount
KAU_RootAccount
0.00      
KAU_InflationAccount
KAU_EmissionAccount
72107.34  
KAU_InflationAccount
KAU_GAPSAccount
1165.50   
KAU_InflationAccount
KAU_HotWalletAccount
223398.10 
KAU_InflationAccount
KAU_InflationAccount
0.00      
KAU_InflationAccount
KAU_RootAccount
0.00      
KAU_RootAccount
KAU_EmissionAccount
3060422.00
KAU_RootAccount
KAU_GAPSAccount
0.00      
KAU_RootAccount
KAU_HotWalletAccount
0.00      
KAU_RootAccount
KAU_InflationAccount
0.00      
KAU_RootAccount
KAU_RootAccount
0.00
How to do it
Code:
KAU_extract=../Blockchain-Exploration/KAU/stellar-export-KAU-2023-02-24-T09\:37\:45-UTC.csv

linux> . ./KAU-set-main-account-symbols.sh
check format of Type 1 records for KAU
Insert a hash sign at beginning of line (^, standard regexp) to include in header of awk scripts.
For extra clarity.
Code:
sed '1d' $KAU_extract | sed 's/\"//g' | awk -F, '($5==1) {print $0}' | head -1 | sed 's/,/\n/g' | nl -ba | sed 's/^/\#/g'
linux> sed '1d' $KAU_extract | sed 's/\"//g' | awk -F, '($5==1) {print $0}' | head -1 | sed 's/,/\n/g' | nl -ba | sed 's/^/\#/g'
#     1    105593544793657345
#     2    true
#     3    GBUBOKEFUNF4ZZQA7QJCGYF54U4N2T5VV2QAN7RWQCVS75OOI5KSVCZS
#     4    payment
#     5    1
#     6    2023-02-22T19:08:40Z
#     7    c508035abf68a3af36c1d2bcc9d2d6811a92d3a0f3cbe32191484a7c12759c60
#     8    
#     9    
#    10    
#    11    
#    12    native
#    13    GBUBOKEFUNF4ZZQA7QJCGYF54U4N2T5VV2QAN7RWQCVS75OOI5KSVCZS
#    14    GDIENNQ3BXCTB74ZYCQAGXCY7KTGFBZGHRMUVF3ZLIW6SMAZIGX2JCCS
#    15    2400.0000000
#    16    
#    17    
#    18    
#    19    
#    20    
#    21    

Different from that of KAG
I have no idea why. It just is.

Set up the 2 nested for loops to generate sum of the flows on the complete graph where the vertices are the main system accounts.

linux> set | grep "KA[U]" | sort
KAU_EmissionAccount=GDIENNQ3BXCTB74ZYCQAGXCY7KTGFBZGHRMUVF3ZLIW6SMAZIGX2JCCS
KAU_extract=../Blockchain-Exploration/KAU/stellar-export-KAU-2023-02-24-T09:37:45-UTC.csv
KAU_HotWalletAccount=GBUBOKEFUNF4ZZQA7QJCGYF54U4N2T5VV2QAN7RWQCVS75OOI5KSVCZS
KAU_InflationAccount=GCO75U2EVO3HKGYO2PUO2ZO7CEL52JPQL5WYUHHKPEORQSASSKT4MA3B
KAU_RootAccount=GDTYNME5HX3FCFDS4D3R3LTVH3DFLSB5HWVTV3VVL4PBGQ6SCKC7J3PD

linux> cat KAU-set-main-account-symbols.sh | sort | cut -d= -f2 > Vertices
linux> cat Vertices 
GDIENNQ3BXCTB74ZYCQAGXCY7KTGFBZGHRMUVF3ZLIW6SMAZIGX2JCCS
GBUBOKEFUNF4ZZQA7QJCGYF54U4N2T5VV2QAN7RWQCVS75OOI5KSVCZS
GCO75U2EVO3HKGYO2PUO2ZO7CEL52JPQL5WYUHHKPEORQSASSKT4MA3B
GDTYNME5HX3FCFDS4D3R3LTVH3DFLSB5HWVTV3VVL4PBGQ6SCKC7J3PD
Go!
The fun part...
Record Type 1
($5 == 1)
Code:
for i in `cat Vertices`
do
  for j in `cat Vertices`
  do
    grep $i KAU-set-main-account-symbols.sh | cut -d= -f1
    grep $j KAU-set-main-account-symbols.sh | cut -d= -f1
    sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v x="$i" -v y="$j" '(($5 == 1) && ($13==x) && ($14==y)) {sum_15 += $15} END {printf "%-10.2f\n", sum_15 }'
    sleep 5
  done
done
 
Vertex R
Root
Top left in the KAU digraph.

Sum of all flows into R
zero

All this may be obvious to experienced Kinesis users.
Not to me. I'm just a techie trying to build an understanding of this system from the ground up.

From first principles.
By inspection.
By trial and error.


I may not be a beginner at linux but I am actually only an intermediary level linux guy. The real linux Chads have real jobs in the real world and are otherwise engaged.

And yet in my modest view, this is precisely what has been missing both on Telegram and here. So here I am gallantly making the sacrifice ;-) Users looking at hard data. No emoting. No talking about data.

It is quite possible that @Forsytjr has already done all this before. I do have some recollection of his relating his technical Due Diligence orally. I can't find that session in the digital ocean of podcasts we live in.
It is extremely easy to doxx yourself inadvertently. This is both a disadvantage and an advantage of a blockchain system. I am guessing that Jim had to pull his techie DD because he had been too generous with information [visions of Mrs Forsythe pursuing her husband with a slipper in a menacing way....]

I do not have an eidetic memory but quite frankly a techie like myself and others just feel compelled to do this work. I hadn't realised we could pull CSV extracts from the blockchain until a few weeks ago. So 'ere we go.

The following illustrates the use of an awk script to go sniffing for data.
There may be no need to pass it all these System Accounts as variables.
I just like not having to think too much.

INBOUND r
Code:
linux> sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v e=$KAU_EmissionAccount -v h=$KAU_HotWalletAccount -v i=$KAU_InflationAccount -v r=$KAU_RootAccount -f KAU-INBOUND-r.awk 
0.00
OUTBOUND r
Code:
sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v e=$KAU_EmissionAccount -v g=$KAU_GAPSAccount -v h=$KAU_HotWalletAccount -v i=$KAU_InflationAccount -v r=$KAU_RootAccount -f KAU-OUTBOUND-r.awk

linux> sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v e=$KAU_EmissionAccount -v g=$KAU_GAPSAccount -v h=$KAU_HotWalletAccount -v i=$KAU_InflationAccount -v r=$KAU_RootAccount -f KAU-OUTBOUND-r.awk
3060422.00

OUTBOUND r
=
FLOW (R,E)
=
3060422.00

Code:
KAU_RootAccount
KAU_EmissionAccount
3060422.00

From the 2 nested for loops from somewhere higher up.

Another proof by demonstration with a 3 line awk script:
This is redundant work. We have already done it.

Code:
sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v e=$KAU_EmissionAccount -v h=$KAU_HotWalletAccount -v i=$KAU_InflationAccount -v r=$KAU_RootAccount -f KAU-OUTBOUND-r.awk 
linux> sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v e=$KAU_EmissionAccount -v h=$KAU_HotWalletAccount -v i=$KAU_InflationAccount -v r=$KAU_RootAccount -f KAU-OUTBOUND-r.awk 
3060422.00
data is one month out-of-date

Let's have a look from an Internet browser:
https://explorer.kinesis.money/account/GDTYNME5HX3FCFDS4D3R3LTVH3DFLSB5HWVTV3VVL4PBGQ6SCKC7J3PD
Code:
KAU
99996925516.0999900
linux> bc <<< "10^11 - 99996925516.0999900"
3074483.9000100
linux> units -t "100 billion - 3 million"
9.9997e+10
linux> units -t "100 billion - (9.9997 * 10) billion"
3000000
Looks as if could be a match
Oh. that's GNU units. Very kewl.

I may already have uploaded this zip.
It should contain:
Code:
linux> zip -sf KAU-utilities.zip 
Archive contains:
  KAU-INBOUND-r.awk
  KAU-OUTBOUND-e.awk
  KAU-OUTBOUND-h.awk
  KAU-OUTBOUND-h-NOT-TO-e-g.awk
  KAU-digraph-arc-flows.png
  KAU-set-main-account-symbols.sh
  KAU-record-formats
  KAG-record-formats
  KAG-KAU-record-formats-sideByside
Total 9 entries (360056 bytes)
Should we make any conclusions?
Nah, we're still just laying out the facts.
Looking at the data.
Kicking the tires.
Until next time...
 

Attachments

  • KAU-utilities.zip
    342.4 KB · Views: 1
Gosh the fun never stops.
OUTBOUND e
The second vertex from the left in the diagram.
Code:
sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v e=$KAU_EmissionAccount -v h=$KAU_HotWalletAccount -v i=$KAU_InflationAccount -v r=$KAU_RootAccount -f KAU-OUTBOUND-e.awk
3139366.21
bc <<< 10^6
1000000
The bc part to help the eyes read off the units correctly.
<<<
known as here
I only met it a few months ago. You learn all the time in this game.

From the diagram (pencil KAU digraph),
we see no flows out of E to System Accounts.
All the flow goes to user accounts.

Sniff around a little.
Stumble on what looks like a whale.
Check further.

"%s %f %d"
standard C language formatting

\n carriage return
\t tab

Train the eye to see the %
We are honouring Super Chads from 40 years ago. Kernighan and Ritchie et al.
Praise be Upon Their Names for evah.
This is part of the experience.
A grand Revenge Of The Nerds. yayyyy

Code:
sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v e=$KAU_EmissionAccount -v h=$KAU_HotWalletAccount -v i=$KAU_InflationAccount -v r=$KAU_RootAccount '(($5 == 1) && ($13==e)) {printf "%s\n", $14}' | sort | uniq -c | sort -b -n -k1 | tail -10
     99 GB7TSIJMA3IUYNAZFXLVPPURFNT7526FSS5FIF5R3HD7HES6PGHVTM4S
    105 GC4NCBDHW7HATM23OG4RBOOU45TRCLCUWH4XVMKJZGX525G72LOVWJ7K
    109 GAAQZV3XBNWCXHH7GNDYNC7ZHG3V7ELCSJTKD55EGTJA3LTJAGOEYCCG
    112 GC247E7NKDF4WQO4LXFRZHYMSN3N2HP3OSVTHVPRPZVR7CBYTIUVDXW4
    114 GAD56XNB5ZP5VP2M325SXHXPZF64KRQRN3A553DD7HH5UPPTUUP6LG4W
    127 GBK2EKJ62UIJKX6Z5TU7ZBB7WESSU2A6GKFWGMXNNOIPIDXYSK5MPZJS
    154 GBMWTY6R4JSFV73F6U5K6KUESSSYW5OVSX4T5SYHXN7TGIKP4LK247AM
    155 GB2MITJXM444GLVV3R4OQBDJTV74HIODHMTFXDBJB3KL7NTLFV54HKI3
    252 GCLJ4RQRG3HAN3GGO4DHMHI7STA6PKOBWQJLH3NRS56Z647SLYPHPN7I
    265 GDOVPGZ6F6DXY4MPHLLL6VFF5IOOZG5ITM7LNR535W6OGHDAPD2IJTKA
Allo allo. What 'ave we 'ere aye?
Let's dig further
First a bit of pipe rearranging.
This is where the iPhone users and other users of Shiny Stuff (not Ag, sadly) roll their eyes back and we linux people exchange knowing looks while containing our true FeelZ for Sales and Marketing people (and other Powerpoint Presentation fanatics) as quietly as is feasible.
Praise Be To Pipes Always.
Code:
grep GBW4XYJPEK7CI4TSK2T56I4TOXH3ARQQXPTVNRGZEDJNEDYP4V4OMP5I $KAU_extract | sed '1d' | sed 's/"//g' | awk -F, -v e=$KAU_EmissionAccount -v h=$KAU_HotWalletAccount -v i=$KAU_InflationAccount -v r=$KAU_RootAccount '(($5 == 1) && ($13==e)) {printf "%s\t%8.2f\t%20s\n", $14, $15, $6}' | sort -k2 -k3
[SNIP]
We don't want to show everything now do we?
Just to say, we can see a lot by playing interactively with the CSV file.
Code:
grep GBW4XYJPEK7CI4TSK2T56I4TOXH3ARQQXPTVNRGZEDJNEDYP4V4OMP5I $KAU_extract | sed '1d' | sed 's/"//g' | awk -F, -v e=$KAU_EmissionAccount -v h=$KAU_HotWalletAccount -v i=$KAU_InflationAccount -v r=$KAU_RootAccount '(($5 == 1) && ($13==e)) {printf "%s\t%8.2f\t%20s\n", $14, $15, $6}' | sort -r -k3 | cut -f2 | paste -sd+ | bc -l
680700.00
680 kg gold
Code:
units -t "680 kg (1/ozt) XAU" USD
41977982
40+ USD M at current spot
Praise Be To GNU units too
Gnu is Not Unix.
Code:
grep GBW4XYJPEK7CI4TSK2T56I4TOXH3ARQQXPTVNRGZEDJNEDYP4V4OMP5I $KAU_extract | sed '1d' | sed 's/"//g' | awk -F, -v e=$KAU_EmissionAccount '(($5 == 1) && ($13==e)) {printf "%8.2f\t%20s\n", $15, $6}' | sort -k2  

  700.00    2021-07-01T03:47:17Z
  700.00    2021-07-21T17:56:42Z
 1000.00    2021-10-04T17:17:26Z
 2000.00    2021-10-04T17:52:11Z
 1000.00    2021-10-04T17:53:06Z
 2000.00    2021-10-04T17:56:11Z
 1000.00    2021-10-04T17:57:11Z
 3000.00    2021-10-04T17:58:11Z
 1000.00    2021-10-04T18:00:11Z
 2000.00    2021-10-04T18:01:16Z
 1000.00    2021-10-04T18:02:16Z
 1000.00    2021-10-04T18:03:16Z
 1000.00    2021-10-04T18:04:16Z
 2000.00    2021-10-04T18:05:21Z
 1000.00    2021-10-04T18:06:26Z
 3000.00    2021-10-04T18:07:21Z
 1000.00    2021-10-04T18:08:21Z
 1000.00    2021-10-04T18:09:21Z
 2000.00    2021-10-04T18:10:26Z
 1000.00    2021-10-04T18:11:26Z
49000.00    2021-10-04T18:12:26Z
 1000.00    2021-10-04T18:13:26Z
49000.00    2021-10-04T18:14:31Z
 1000.00    2021-10-04T18:15:31Z
49000.00    2021-10-04T18:16:31Z
 2000.00    2021-10-04T18:17:31Z
49000.00    2021-10-04T18:18:31Z
93500.00    2021-10-04T18:19:36Z
 1000.00    2021-10-04T18:20:36Z
93500.00    2021-10-04T18:21:36Z
49000.00    2021-10-04T18:22:36Z
93500.00    2021-10-04T18:30:26Z
49000.00    2021-10-04T18:32:32Z
 1000.00    2021-10-04T18:33:36Z
 2000.00    2021-10-04T18:34:36Z
 1000.00    2021-10-04T18:35:36Z
 2900.00    2021-10-04T18:36:41Z
 1000.00    2021-10-04T18:37:41Z
 2000.00    2021-10-04T18:38:46Z
49000.00    2021-10-04T18:39:46Z
 1000.00    2021-10-04T18:40:46Z
 3000.00    2021-10-04T18:41:46Z
 1000.00    2021-10-04T18:42:51Z
 2000.00    2021-10-04T18:43:51Z
 1000.00    2021-10-04T18:44:51Z
 2900.00    2021-10-04T18:45:56Z
 1000.00    2021-10-04T18:46:56Z
 2000.00    2021-10-04T18:48:31Z
-k2
sort on Field 2
Probably a mere lexicographic sort.
But it works.
So we use it.
Duh.

I have no idea if this is an entrance or an exit.
I just observe.
Take note.

If it were a whale, I could easily understand the operation had to be planned somewhat. The transactions deliberateley timed every minute or so.
And yeah anonimity matters. Even for a whale.
Kinesis users love whales.

A quick look at the calendar:
Code:
OCT 4 2021

linux> ncal -w oct 2021
    Oktober 2021      
Mo     4 11 18 25   
Di     5 12 19 26   
Mi     6 13 20 27   
Do     7 14 21 28   
Fr  1  8 15 22 29   
Sa  2  9 16 23 30   
So  3 10 17 24 31   
   39 40 41 42 43
Could be Istanbul coming in.
Love it, if so.
Haven't checked the audits.

Not our purpose now.
Not yet time to get physical.
For now, we must remain focussed on the digital side.

Code:
linux> sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v e=$KAU_EmissionAccount -v h=$KAU_HotWalletAccount -v i=$KAU_InflationAccount -v r=$KAU_RootAccount '(($5 == 1) && ($13==e)) {printf "%s\n", $14}' | sort | uniq -c | sort -b -n -k1 | wc -l
257
257 separate users.
Ain't that something?
I'll probably peter off right now. no more Budweiser Budvar beer on hand.
A most regrettable situation indeed.
 
Vertex R
Root
Top left in the KAU digraph.

Sum of all flows into R
zero

All this may be obvious to experienced Kinesis users.
Not to me. I'm just a techie trying to build an understanding of this system from the ground up.

From first principles.
By inspection.
By trial and error.


I may not be a beginner at linux but I am actually only an intermediary level linux guy. The real linux Chads have real jobs in the real world and are otherwise engaged.

And yet in my modest view, this is precisely what has been missing both on Telegram and here. So here I am gallantly making the sacrifice ;-) Users looking at hard data. No emoting. No talking about data.

It is quite possible that @Forsytjr has already done all this before. I do have some recollection of his relating his technical Due Diligence orally. I can't find that session in the digital ocean of podcasts we live in.
It is extremely easy to doxx yourself inadvertently. This is both a disadvantage and an advantage of a blockchain system. I am guessing that Jim had to pull his techie DD because he had been too generous with information [visions of Mrs Forsythe pursuing her husband with a slipper in a menacing way....]

I do not have an eidetic memory but quite frankly a techie like myself and others just feel compelled to do this work. I hadn't realised we could pull CSV extracts from the blockchain until a few weeks ago. So 'ere we go.

The following illustrates the use of an awk script to go sniffing for data.
There may be no need to pass it all these System Accounts as variables.
I just like not having to think too much.

INBOUND r
Code:
linux> sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v e=$KAU_EmissionAccount -v h=$KAU_HotWalletAccount -v i=$KAU_InflationAccount -v r=$KAU_RootAccount -f KAU-INBOUND-r.awk
0.00
OUTBOUND r
Code:
sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v e=$KAU_EmissionAccount -v g=$KAU_GAPSAccount -v h=$KAU_HotWalletAccount -v i=$KAU_InflationAccount -v r=$KAU_RootAccount -f KAU-OUTBOUND-r.awk

linux> sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v e=$KAU_EmissionAccount -v g=$KAU_GAPSAccount -v h=$KAU_HotWalletAccount -v i=$KAU_InflationAccount -v r=$KAU_RootAccount -f KAU-OUTBOUND-r.awk
3060422.00

OUTBOUND r
=
FLOW (R,E)
=
3060422.00

Code:
KAU_RootAccount
KAU_EmissionAccount
3060422.00

From the 2 nested for loops from somewhere higher up.

Another proof by demonstration with a 3 line awk script:
This is redundant work. We have already done it.

Code:
sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v e=$KAU_EmissionAccount -v h=$KAU_HotWalletAccount -v i=$KAU_InflationAccount -v r=$KAU_RootAccount -f KAU-OUTBOUND-r.awk
linux> sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v e=$KAU_EmissionAccount -v h=$KAU_HotWalletAccount -v i=$KAU_InflationAccount -v r=$KAU_RootAccount -f KAU-OUTBOUND-r.awk
3060422.00
data is one month out-of-date

Let's have a look from an Internet browser:
https://explorer.kinesis.money/account/GDTYNME5HX3FCFDS4D3R3LTVH3DFLSB5HWVTV3VVL4PBGQ6SCKC7J3PD
Code:
KAU
99996925516.0999900
linux> bc <<< "10^11 - 99996925516.0999900"
3074483.9000100
linux> units -t "100 billion - 3 million"
9.9997e+10
linux> units -t "100 billion - (9.9997 * 10) billion"
3000000
Looks as if could be a match
Oh. that's GNU units. Very kewl.

I may already have uploaded this zip.
It should contain:
Code:
linux> zip -sf KAU-utilities.zip
Archive contains:
  KAU-INBOUND-r.awk
  KAU-OUTBOUND-e.awk
  KAU-OUTBOUND-h.awk
  KAU-OUTBOUND-h-NOT-TO-e-g.awk
  KAU-digraph-arc-flows.png
  KAU-set-main-account-symbols.sh
  KAU-record-formats
  KAG-record-formats
  KAG-KAU-record-formats-sideByside
Total 9 entries (360056 bytes)
Should we make any conclusions?
Nah, we're still just laying out the facts.
Looking at the data.
Kicking the tires.
Until next time...
I have not done this. 😂. @Derek and others have been doing the verification of circulation, I’ve just been too swamped trying to get casting business off the ground. Impressed with your Linux skills!!
 
I need to go through those 5 record types more systematically (in case you're wondering why, I still can't make sense of the Minting and Redemption calculation instructions, one of my ultimate aims here).

copy/ pasting from my working notes:

Calculate INBOUND and OUTBOUND flows
into and out of System Accounts.

Will include flows from/to non-System Accounts.
Kinesis/ Horizon may call those Root Accounts.

Cycle systematically through each of the 5 record types

0
1
5
8
9

Code:
linux> echo $KAU_extract
../Blockchain-Exploration/KAU/stellar-export-KAU-2023-02-24-T09:37:45-UTC.csv
==================

($5 == 0)

Check field location:
Code:
cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==0) {print $0}' | head -1 | sed 's/,/\n/g' | nl -ba
8 11
10
from to
flow


Grand total
Sum of all flows for this record type ?
INBOUND and OUTBOUND
Code:
sed '1d' $KAU_extract | sed 's/"//g' | awk -F, '($5 == 0) { sum_10 += $10 } END {printf "%.2f\n", sum_10 }'
linux> sed '1d' $KAU_extract | sed 's/"//g' | awk -F, '($5 == 0) { sum_10 += $10 } END {printf "%.2f\n", sum_10 }'
48843906.12
linux> bc <<< 10^7
10000000
48 million
==================
Code:
echo "INBOUND"
for j in `cat Vertices`
do
  grep $j KAU-set-main-account-symbols.sh | cut -d= -f1
  sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v y="$j" '(($5 == 0) && ($11 == y)) { sum_10 += $10 } END {printf "%.2f\n", sum_10 }'
  sleep 5
done > INBOUND-sums
Code:
cat INBOUND-sums
KAU_EmissionAccount
51024157.80
KAU_GAPSAccount
1427244.11
KAU_HotWalletAccount
832980.26
KAU_InflationAccount
0.12
KAU_RootAccount
0.00

grep ^[0-9] INBOUND-sums | paste -sd+ | bc -l
53284382.29
==================
Code:
echo "OUTBOUND"
for i in `cat Vertices`
do
  grep $i KAU-set-main-account-symbols.sh | cut -d= -f1
  sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v x="$i" '(($5 == 0) && ($8 == x)) { sum_10 += $10 } END {printf "%.2f\n", sum_10 }'
  sleep 5
done > OUTBOUND-sums

Code:
cat OUTBOUND-sums
linux> cat OUTBOUND-sums 
KAU_EmissionAccount
90.00
KAU_GAPSAccount
0.02
KAU_HotWalletAccount
1.00
KAU_InflationAccount
110.05
KAU_RootAccount
0.00

Code:
grep ^[0-9] OUTBOUND-sums | paste -sd+ | bc -l
linux> grep ^[0-9] OUTBOUND-sums | paste -sd+ | bc -l
201.07
Record Type 1 is next (0 1 5 8 9)
 
($5 == 1)

Field locations:
Code:
cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==1) {print $0}' | head -1 | sed 's/,/\n/g' | nl -ba
13 14
15
from to
flow


=========================

Sum of all flows for this record type ?
Code:
sed '1d' $KAU_extract | sed 's/"//g' | awk -F, '($5 == 1) { sum_15 += $15 } END {printf "%.2f\n", sum_15 }'
56603127.36

=========================
Code:
echo "INBOUND"
for j in `cat Vertices`
do
  grep $j KAU-set-main-account-symbols.sh | cut -d= -f1
  sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v y="$j" '(($5 == 1) && ($14 == y)) { sum_15 += $15 } END {printf "%.2f\n", sum_15 }'
  sleep 5
done > INBOUND-sums
Code:
linux> cat INBOUND-sums 
KAU_EmissionAccount
51024157.80
KAU_GAPSAccount
1427244.11
KAU_HotWalletAccount
832980.26
KAU_InflationAccount
0.12
KAU_RootAccount
0.00
Code:
grep ^[0-9] INBOUND-sums | paste -sd+ | bc -l
linux> grep ^[0-9] INBOUND-sums | paste -sd+ | bc -l
53284382.29
linux> bc <<< 10^7
10000000
==================
Code:
echo "OUTBOUND"
for i in `cat Vertices`
do
  grep $i KAU-set-main-account-symbols.sh | cut -d= -f1
  sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v x="$i" '(($5 == 1) && ($13 == x)) { sum_15 += $15 } END {printf "%.2f\n", sum_15 }'
  sleep 5
done > OUTBOUND-sums

Code:
cat OUTBOUND-sums
OUTBOUND
KAU_EmissionAccount
3139366.21
KAU_GAPSAccount
609000.10
KAU_HotWalletAccount
49449863.74
KAU_InflationAccount
296670.94
KAU_RootAccount
3060422.00

Code:
grep ^[0-9] OUTBOUND-sums | paste -sd+ | bc -l
56555322.99
linux> bc <<< 10^7
10000000
 
The next guy has a different shape

($5==5)

Field locations:
Code:
cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==5) {print $0}' | head -1 | sed 's/,/\n/g' | nl -ba

or select line 20 just for kicks
Code:
linux> cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==5) {print $0}' | sed -n '20p' | sed 's/,/\n/g' | nl -ba
looks the same

Fields 3 and 16 are addresses
Let's see what they are.

Code:
linux> cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==5) {print $3}' | sort -u 
GAPS3KZ4YVEL4UYFAGTE6L6H6GRZ3KYBWGY2UTGTAJBXGUJLBCYQIXXA
GBUBOKEFUNF4ZZQA7QJCGYF54U4N2T5VV2QAN7RWQCVS75OOI5KSVCZS
GCO75U2EVO3HKGYO2PUO2ZO7CEL52JPQL5WYUHHKPEORQSASSKT4MA3B
GDIENNQ3BXCTB74ZYCQAGXCY7KTGFBZGHRMUVF3ZLIW6SMAZIGX2JCCS
GDTYNME5HX3FCFDS4D3R3LTVH3DFLSB5HWVTV3VVL4PBGQ6SCKC7J3PD

5 old friends
Code:
linux> set | grep ^KAU_[A-Z] | sort -t= -k2
KAU_GAPSAccount=GAPS3KZ4YVEL4UYFAGTE6L6H6GRZ3KYBWGY2UTGTAJBXGUJLBCYQIXXA
KAU_HotWalletAccount=GBUBOKEFUNF4ZZQA7QJCGYF54U4N2T5VV2QAN7RWQCVS75OOI5KSVCZS
KAU_InflationAccount=GCO75U2EVO3HKGYO2PUO2ZO7CEL52JPQL5WYUHHKPEORQSASSKT4MA3B
KAU_EmissionAccount=GDIENNQ3BXCTB74ZYCQAGXCY7KTGFBZGHRMUVF3ZLIW6SMAZIGX2JCCS
KAU_RootAccount=GDTYNME5HX3FCFDS4D3R3LTVH3DFLSB5HWVTV3VVL4PBGQ6SCKC7J3PD

To ?
20 different accounts:

Code:
linux> cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==5) {print $16}' | sort -u | wc -l
20
linux> cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==5) {print $16}' | sort -u 

GA5KJZOQBPUOZZDTLOR3JIOQKE5A7BMVRX6M6FJHBN7CKDX67QXY2JYQ
GABYDANZ4T4TXQXSYTLAYTYODBHD3ZINPCZ2NCWGL3DLED6HBVMOAZ2X
GAFBZLPWBO7ZVWXWAGQCHN3FQNVU5AIGLUBNEWX2ZNM644EJNNMR4QN2
GAVPXTIGSO7ADHW2ZKPXAOXGTJTZAZ6TCDZCXMSR2VAYEQWGRGAZCNO2
GAVRF5EMIOBVCV6K5KBMZH3HGORIL2ADKO2PC6BIRJUNZJ24CD5OPB2N
GB27I6UXIREDJOH7G3VQQXFEJP6SUZZS3N46W5LHOO6TYPDM7G3SX7HS
GB356J3F7XHNZV6SYD2Y5SYWJTTAM7R72FFX3DXWJ7YMIGV5GFRKWQKC
GB6MDWWGQRLK5AZ2PHGJRPZMJCY6DC3JIJ273LXNJSGGTHZ3F5QV5Q2V
GB6V2RXDYWZ2HKCS7RSIJSG2EBBNLRMQWQ3FYSIXAYPNLJR46Y4CGYZG
GBCJB75MWTU4JMVJ7URDEJ4KTV5OQYUMEYHFOG5X4ETS7YTIAFJIGOGM
GBX6UN2KBCEOCBBJC5YTGMWRUDGDMURRLNSA4KIG2WSTLT74G6RRSGWH
GBXJQBLKIOIIJYZX3UFNRGV7K3G75P4F5IFVGTX6J4RBR6M7UDZTL2UK
GC22PCI6IPALW66UW7C3UASECETJINURYZAIPZ2K7N43Z6NORBBFIRBO
GCA33OCM6SEJ5EFXPSWBIOZAYM5XYUNSXNYUIESPCSXFH3YRTFS6Y2KD
GCZODUHMDVSOWRTKG4S4R7NHBQ5N4ZKHQIIJ2XLNNDOW4K454QM4QXEO
GDCGRUJDVW2ZL2DJRXNSTHDDIDFIJL67ZUIOPV3KEZKAHDHM7E7LZWNH
GDT5RGR66BJJUEPBYKM2GF3KKGNIPGWUWK3T7LC3YI6KCDN6QVVE5MCE
GDYFI4YJIW6U64NTSZPVTK7RIICRDWQUJWEQ3SCDF3R5GXAMK3AGFYG5
GDZCELJJULEE5R7DM5TXENOX3G2Z3MW3LJOVYPEHME4Z5LB257TQZ2EU

Any of those System Accounts?

"comm" for common
a very useful tool
Anything to avoid SQL...

Code:
comm <(cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==5) {print $16}' | sort -u) <(set | grep ^KAU_[A-Z] | sort -t= -k2 | cut -d= -f2)

linux> comm <(cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==5) {print $16}' | sort -u) <(set | grep ^KAU_[A-Z] | sort -t= -k2 | cut -d= -f2) | nl -ba
     1    
     2    GA5KJZOQBPUOZZDTLOR3JIOQKE5A7BMVRX6M6FJHBN7CKDX67QXY2JYQ
     3    GABYDANZ4T4TXQXSYTLAYTYODBHD3ZINPCZ2NCWGL3DLED6HBVMOAZ2X
     4    GAFBZLPWBO7ZVWXWAGQCHN3FQNVU5AIGLUBNEWX2ZNM644EJNNMR4QN2
     5        GAPS3KZ4YVEL4UYFAGTE6L6H6GRZ3KYBWGY2UTGTAJBXGUJLBCYQIXXA
     6    GAVPXTIGSO7ADHW2ZKPXAOXGTJTZAZ6TCDZCXMSR2VAYEQWGRGAZCNO2
     7    GAVRF5EMIOBVCV6K5KBMZH3HGORIL2ADKO2PC6BIRJUNZJ24CD5OPB2N
     8    GB27I6UXIREDJOH7G3VQQXFEJP6SUZZS3N46W5LHOO6TYPDM7G3SX7HS
     9    GB356J3F7XHNZV6SYD2Y5SYWJTTAM7R72FFX3DXWJ7YMIGV5GFRKWQKC
    10    GB6MDWWGQRLK5AZ2PHGJRPZMJCY6DC3JIJ273LXNJSGGTHZ3F5QV5Q2V
    11    GB6V2RXDYWZ2HKCS7RSIJSG2EBBNLRMQWQ3FYSIXAYPNLJR46Y4CGYZG
    12    GBCJB75MWTU4JMVJ7URDEJ4KTV5OQYUMEYHFOG5X4ETS7YTIAFJIGOGM
    13        GBUBOKEFUNF4ZZQA7QJCGYF54U4N2T5VV2QAN7RWQCVS75OOI5KSVCZS
    14    GBX6UN2KBCEOCBBJC5YTGMWRUDGDMURRLNSA4KIG2WSTLT74G6RRSGWH
    15    GBXJQBLKIOIIJYZX3UFNRGV7K3G75P4F5IFVGTX6J4RBR6M7UDZTL2UK
    16    GC22PCI6IPALW66UW7C3UASECETJINURYZAIPZ2K7N43Z6NORBBFIRBO
    17    GCA33OCM6SEJ5EFXPSWBIOZAYM5XYUNSXNYUIESPCSXFH3YRTFS6Y2KD
    18        GCO75U2EVO3HKGYO2PUO2ZO7CEL52JPQL5WYUHHKPEORQSASSKT4MA3B
    19    GCZODUHMDVSOWRTKG4S4R7NHBQ5N4ZKHQIIJ2XLNNDOW4K454QM4QXEO
    20    GDCGRUJDVW2ZL2DJRXNSTHDDIDFIJL67ZUIOPV3KEZKAHDHM7E7LZWNH
    21        GDIENNQ3BXCTB74ZYCQAGXCY7KTGFBZGHRMUVF3ZLIW6SMAZIGX2JCCS
    22    GDT5RGR66BJJUEPBYKM2GF3KKGNIPGWUWK3T7LC3YI6KCDN6QVVE5MCE
    23        GDTYNME5HX3FCFDS4D3R3LTVH3DFLSB5HWVTV3VVL4PBGQ6SCKC7J3PD
    24    GDYFI4YJIW6U64NTSZPVTK7RIICRDWQUJWEQ3SCDF3R5GXAMK3AGFYG5
    25    GDZCELJJULEE5R7DM5TXENOX3G2Z3MW3LJOVYPEHME4Z5LB257TQZ2EU

Nope
Apparently not.
Double-check:
Code:
linux> comm -12 <(cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==5) {print $16}' | sort -u) <(set | grep ^KAU_[A-Z] | sort -t= -k2 | cut -d= -f2) 
BLANK
No intersection of the 2 sets
Confirmed

"comm" is a very powerful tool

Code:
comm -23 A B
comm -12 A B
comm -13 A B
are all you need

where A, B are sorted sets

If you call "comm" without parameters, it does all 3 by arranging the data in a relatively maningful way at output.

For a demonstration by example of comm, check out this link
and these for background if you've used the tool before:


Onwards to record Type 8
 
($5==8)

Field locations:
Code:
cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==8) {print $0}' | head -1 | sed 's/,/\n/g' | nl -ba
3 8 9
are addresses
no amounts
apparently

Let's see what they are.

Code:
cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==8) {print $8}' | sort -u

linux> cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==8) {print $3}' | sort -u | wc -l
1853
linux> cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==8) {print $8}' | sort -u | wc -l
1853
linux> cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==8) {print $9}' | sort -u | wc -l
4
Code:
linux> cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==8) {print $9}' | sort -u 
GBUBOKEFUNF4ZZQA7QJCGYF54U4N2T5VV2QAN7RWQCVS75OOI5KSVCZS
GDIENNQ3BXCTB74ZYCQAGXCY7KTGFBZGHRMUVF3ZLIW6SMAZIGX2JCCS
GDITIX7PTPVNZZNDJWSAX4CRGKRHQMCK7A2LYO7Q2HAGLQFTQLGH654B
GDMC6I6RZARVR6SBL2AA7AHCOTM44LFGYDZI2RBUAZPMSMJJJHAIQGQF
Let's use same technique as in previous post,
Code:
comm -12 <(cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==8) {print $9}' | sort -u ) <(set | grep ^KAU_[A-Z] | sort -t= -k2 | cut -d= -f2) 
linux> comm -12 <(cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==8) {print $9}' | sort -u ) <(set | grep ^KAU_[A-Z] | sort -t= -k2 | cut -d= -f2) 
GBUBOKEFUNF4ZZQA7QJCGYF54U4N2T5VV2QAN7RWQCVS75OOI5KSVCZS
GDIENNQ3BXCTB74ZYCQAGXCY7KTGFBZGHRMUVF3ZLIW6SMAZIGX2JCCS
Pipe that out to temporary file t
Code:
linux> comm -12 <(cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==8) {print $9}' | sort -u ) <(set | grep ^KAU_[A-Z] | sort -t= -k2 | cut -d= -f2) > t
linux> for i in `cat t`
> do 
> grep $i KAU-set-main-account-symbols.sh 
> done
KAU_HotWalletAccount=GBUBOKEFUNF4ZZQA7QJCGYF54U4N2T5VV2QAN7RWQCVS75OOI5KSVCZS
KAU_EmissionAccount=GDIENNQ3BXCTB74ZYCQAGXCY7KTGFBZGHRMUVF3ZLIW6SMAZIGX2JCCS
Ah....
 
($5==9)

Field locations:
Code:
cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==9) {print $0}' | head -1 | sed 's/,/\n/g' | nl -ba
3
contains an address

Code:
cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==9) {print $3}' | sort -u
linux> cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==9) {print $3}' | sort -u
GDCQANEHPUIIT6CQGJO2NTKGCRFD5NETJNC33CJG3PWCSRVYNHISHLHK
GDIENNQ3BXCTB74ZYCQAGXCY7KTGFBZGHRMUVF3ZLIW6SMAZIGX2JCC

Name them programatically:
Code:
linux> cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==9) {print $3}' | sort -u > t
linux> for i in `cat t`; do  grep $i KAU-set-main-account-symbols.sh ; done
KAU_EmissionAccount=GDIENNQ3BXCTB74ZYCQAGXCY7KTGFBZGHRMUVF3ZLIW6SMAZIGX2JCCS
Hit the main file directly with that first record that has no match in System Accounts (E G H I R).
Second record is E
Code:
linux> grep GDCQANEHPUIIT6CQGJO2NTKGCRFD5NETJNC33CJG3PWCSRVYNHISHLHK $KAU_extract | wc -l
92
Some form of special System Account?

https://explorer.kinesis.money/account/GDCQANEHPUIIT6CQGJO2NTKGCRFD5NETJNC33CJG3PWCSRVYNHISHLHK
 
What is messing with my mind for a while:
Minting (The sum of all transfer amounts from Emission to non-Root accounts)
That's from main page of Explorer.
Here
Top left

We have found out by inspection that Emission (E or e) does not write to System Accounts anyway.
See the KAU flow graph/ digraph right at the top.
And the calculations lower down throughout this thread.

From the wording,
we deduce we want all OUTBOUND e:
We have already calculated this.

Repeat:
OUTBOUND e
Code:
linux> sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v e=$KAU_EmissionAccount -v g=$KAU_GAPSAccount -v h=$KAU_HotWalletAccount -v i=$KAU_InflationAccount -v r=$KAU_RootAccount -f KAU-OUTBOUND-e.awk           
3139366.21
linux> bc <<< 10^6
1000000
3 million
nowhere near what is on screen:
Code:
49,451,448.3540    
linux> echo "49,451,448.3540    " | sed 's/,\| //g' | tr -d [:blank:]
49451448.3540
49 million
My data file may be 1 month out-of-date. But something is off 'ere...
A mystery.

KAU-OUTBOUND-e.awk is already in the ZIP previously attached:
Code:
linux> zip -sf KAU-utilities.zip 
Archive contains:
  KAU-INBOUND-r.awk
  KAU-OUTBOUND-e.awk
  KAU-OUTBOUND-h.awk
  KAU-OUTBOUND-h-NOT-TO-e-g.awk
  KAU-digraph-arc-flows.png
  KAU-set-main-account-symbols.sh
  KAU-record-formats
  KAG-record-formats
  KAG-KAU-record-formats-sideByside
Total 9 entries (360056 bytes)
 
On to Redemptions
Redemption (The sum of all transfer amounts from Hot wallet to Emission or Root account)
from same web page
Top left

H to E or to R

Check location of fields:
Code:
cat $KAU_extract | sed 's/\"//g' | awk -F, '($5==1) {print $0}' | head -1 | sed 's/,/\n/g' | nl -ba
13 14
15

Code:
linux> sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v e=$KAU_EmissionAccount -v g=$KAU_GAPSAccount -v h=$KAU_HotWalletAccount -v i=$KAU_InflationAccount -v r=$KAU_RootAccount '(($5 == 1) && ($13 == h ) && (($14 == e ) || ( $14 == r ))) { sum_15 += $15 } END {printf "%.2f\n", sum_15 }'
47890335.19

But we know by inspection further up E does not write to R anyway.

So we simplify our code.
Just to drive the point home.

Code:
linux> sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v e=$KAU_EmissionAccount -v g=$KAU_GAPSAccount -v h=$KAU_HotWalletAccount -v i=$KAU_InflationAccount -v r=$KAU_RootAccount '(($5 == 1) && ($13 == h ) && (($14 == e ))) { sum_15 += $15 } END {printf "%.2f\n", sum_15 }'
47890335.19
Same result
Duh

Tech Note #1:

&&
||
standard C programming language notation for
AND
OR

Tech note #2
De Morgan's laws
Just the basics.
Useful in the implicit condition statement in the awk further up
Code:
 (($14 == e ) || ( $14 == r ))

=============

Perhaps they meant G instead of R ?

H to E or to G
Let's try it
Code:
linux> sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v e=$KAU_EmissionAccount -v g=$KAU_GAPSAccount -v h=$KAU_HotWalletAccount -v i=$KAU_InflationAccount -v r=$KAU_RootAccount '(($5 == 1) && ($13 == h ) && (($14 == e ) || ( $14 == g ))) { sum_15 += $15 } END {printf "%.2f\n", sum_15 }'
49316413.70

On screen:
Code:
cat >> tmp << EOF                                   
48,262,485.1942    
EOF

cat tmp | sed 's/,\| //g' | tr -d [:blank:]
linux> cat tmp | sed 's/,\| //g' | tr -d [:blank:]
48262485.1942

The CSV extract file is 1 month old
Possible match.

Does it make Stellar/ Kinesis Horizon sense to add those particular numbers up?
I don't know.
Yet.
 
A revised version...
KAU-digraph-Version-2.png
Set-up environment:
Code:
linux> KAU_CI_extract=../CI-dat/kau-raw.csv 
linux> . ./KAU-set-main-account-symbols.sh 
linux> set | grep ^KAU
KAU_CI_extract=../CI-dat/kau-raw.csv
KAU_EmissionAccount=GDIENNQ3BXCTB74ZYCQAGXCY7KTGFBZGHRMUVF3ZLIW6SMAZIGX2JCCS
KAU_GAPSAccount=GAPS3KZ4YVEL4UYFAGTE6L6H6GRZ3KYBWGY2UTGTAJBXGUJLBCYQIXXA
KAU_HotWalletAccount=GBUBOKEFUNF4ZZQA7QJCGYF54U4N2T5VV2QAN7RWQCVS75OOI5KSVCZS
KAU_InflationAccount=GCO75U2EVO3HKGYO2PUO2ZO7CEL52JPQL5WYUHHKPEORQSASSKT4MA3B
KAU_RootAccount=GDTYNME5HX3FCFDS4D3R3LTVH3DFLSB5HWVTV3VVL4PBGQ6SCKC7J3PD
linux> set | grep ^KAU_[E,G,H,I,R] | cut -d= -f2
GDIENNQ3BXCTB74ZYCQAGXCY7KTGFBZGHRMUVF3ZLIW6SMAZIGX2JCCS
GAPS3KZ4YVEL4UYFAGTE6L6H6GRZ3KYBWGY2UTGTAJBXGUJLBCYQIXXA
GBUBOKEFUNF4ZZQA7QJCGYF54U4N2T5VV2QAN7RWQCVS75OOI5KSVCZS
GCO75U2EVO3HKGYO2PUO2ZO7CEL52JPQL5WYUHHKPEORQSASSKT4MA3B
GDTYNME5HX3FCFDS4D3R3LTVH3DFLSB5HWVTV3VVL4PBGQ6SCKC7J3PD

linux> cat KAU-set-main-account-symbols.sh | sort | cut -d= -f2
GDIENNQ3BXCTB74ZYCQAGXCY7KTGFBZGHRMUVF3ZLIW6SMAZIGX2JCCS
GAPS3KZ4YVEL4UYFAGTE6L6H6GRZ3KYBWGY2UTGTAJBXGUJLBCYQIXXA
GBUBOKEFUNF4ZZQA7QJCGYF54U4N2T5VV2QAN7RWQCVS75OOI5KSVCZS
GCO75U2EVO3HKGYO2PUO2ZO7CEL52JPQL5WYUHHKPEORQSASSKT4MA3B
GDTYNME5HX3FCFDS4D3R3LTVH3DFLSB5HWVTV3VVL4PBGQ6SCKC7J3PD
linux> cat KAU-set-main-account-symbols.sh | sort | cut -d= -f2 > Vertices

linux> cat Vertices 
GDIENNQ3BXCTB74ZYCQAGXCY7KTGFBZGHRMUVF3ZLIW6SMAZIGX2JCCS
GAPS3KZ4YVEL4UYFAGTE6L6H6GRZ3KYBWGY2UTGTAJBXGUJLBCYQIXXA
GBUBOKEFUNF4ZZQA7QJCGYF54U4N2T5VV2QAN7RWQCVS75OOI5KSVCZS
GCO75U2EVO3HKGYO2PUO2ZO7CEL52JPQL5WYUHHKPEORQSASSKT4MA3B
GDTYNME5HX3FCFDS4D3R3LTVH3DFLSB5HWVTV3VVL4PBGQ6SCKC7J3PD

Work:
($3=="payment")


Code:
for i in `cat Vertices`
do
  for j in `cat Vertices`
  do
    grep $i KAU-set-main-account-symbols.sh | cut -d= -f1
    grep $j KAU-set-main-account-symbols.sh | cut -d= -f1
    sed '1d' $KAU_CI_extract | sed 's/"//g' | awk -F, -v x="$i" -v y="$j" '( ($3=="payment") && (($5==x) && ($6==y)) ) {sum_7 += $7} END {printf "%-10.2f\n", sum_7 }'
    sleep 5
  done
done > KAU-K5-CI-all-flows-type-payment

($3=="create_account")
Code:
for i in `cat Vertices`
do
  for j in `cat Vertices`
  do
    grep $i KAU-set-main-account-symbols.sh | cut -d= -f1
    grep $j KAU-set-main-account-symbols.sh | cut -d= -f1
    sed '1d' $KAU_CI_extract | sed 's/"//g' | awk -F, -v x="$i" -v y="$j" '( ($3=="create_account") && (($5==x) && ($6==y)) ) {sum_7 += $7} END {printf "%-10.2f\n", sum_7 }'
    sleep 5
  done
done > KAU-K5-CI-all-flows-type-create_account

($3 == "create_account") || ($3 == "payment")
Code:
echo "INBOUND"
for j in `cat Vertices`
do
  grep $j KAU-set-main-account-symbols.sh | cut -d= -f1
  sed '1d' $KAU_CI_extract | sed 's/"//g' | awk -F, -v y="$j" '( ($3 == "create_account") || ($3 == "payment") ) && ($6==y) {sum_7 += $7} END {printf "%-10.2f\n", sum_7 }' 
  sleep 5
done > KAU-INBOUND-CI-sums-both-record-types

($3 == "create_account") || ($3 == "payment")
Code:
echo "OUTBOUND"
for i in `cat Vertices`
do
  grep $i KAU-set-main-account-symbols.sh | cut -d= -f1
  sed '1d' $KAU_CI_extract | sed 's/"//g' | awk -F, -v x="$i" '( ($3 == "create_account") || ($3 == "payment") ) && ($5==x) {sum_7 += $7} END {printf "%-10.2f\n", sum_7 }'
  sleep 5
done > KAU-OUTBOUND-CI-sums-both-record-types
Convert the scan of my digraph drawing:
Code:
pdftoppm 'Scanned Document-2.pdf' KAU-digraph-Version-2
convert -resize 50% KAU-digraph-Version-2-1.ppm KAU-digraph-Version-2.png
eog KAU-digraph-Version-2.png
Create ZIP
Code:
zip -j KAU-digraph-Version-2-with-results.zip \
KAU-K5-CI-all-flows-type-payment \
KAU-K5-CI-all-flows-type-create_account \
KAU-INBOUND-CI-sums-both-record-types \
KAU-OUTBOUND-CI-sums-both-record-types \
pix/KAU-digraph-Version-2.png
Check ZIP
Code:
linux> zip -sf KAU-digraph-Version-2-with-results.zip
Archive contains:
  KAU-K5-CI-all-flows-type-payment
  KAU-K5-CI-all-flows-type-create_account
  KAU-INBOUND-CI-sums-both-record-types
  KAU-OUTBOUND-CI-sums-both-record-types
  KAU-digraph-Version-2.png
Total 5 entries (603006 bytes)
Calculations
Code:
Minting
outbound (E) =
48668751.58
KAU_EmissionAccount
48668751.58
from result file:
KAU-OUTBOUND-CI-sums-both-record-types

Redemptions
flow (H, E) =
47445292.25
KAU_HotWalletAccount
KAU_EmissionAccount
47445292.25
from result file:
KAU-K5-CI-all-flows-type-payment

bc <<< "48668751.58 - 47445292.25"
linux> bc <<< "48668751.58 - 47445292.25"
1223459.33
1223459.33
Tentative coin in circulation KAU EOY(2022)

Tentative conclusion


We only need 2 pieces of data to find coin in circulation:

Code:
linux> sed '1d' $KAU_CI_extract | awk -F, -v x=$KAU_EmissionAccount '( ($3 == "create_account") || ($3 == "payment") ) && ($5==x) {sum_7 += $7} END {printf "%-10.2f\n",  sum_7 }'
48668751.58

linux> sed '1d' $KAU_CI_extract | awk -F, -v x=$KAU_HotWalletAccount -v y=$KAU_EmissionAccount '( ($3=="payment") && (($5==x) && ($6==y)) ) {sum_7 += $7} END {printf "%-10.2f\n", sum_7 }'
47445292.25

Hands-off:
Code:
Mint=`sed '1d' $KAU_CI_extract | awk -F, -v x=$KAU_EmissionAccount '( ($3 == "create_account") || ($3 == "payment") ) && ($5==x) {sum_7 += $7} END {printf "%-10.2f\n",  sum_7 }'`
Redemption=`sed '1d' $KAU_CI_extract | awk -F, -v x=$KAU_HotWalletAccount -v y=$KAU_EmissionAccount '( ($3=="payment") && (($5==x) && ($6==y)) ) {sum_7 += $7} END {printf "%-10.2f\n", sum_7 }'`

bc <<< "$Mint - $Redemption"
linux> bc <<< "$Mint - $Redemption"
1223459.33
Et voilà
 

Attachments

  • KAU-digraph-Version-2-with-results.zip
    587.7 KB · Views: 2
Just 5 lines.
Code:
. ./KAU-set-main-account-symbols.sh
KAU_CI_extract=../CI-dat/kau-raw.csv 
Mint=`sed '1d' $KAU_CI_extract | awk -F, -v x=$KAU_EmissionAccount '( ($3 == "create_account") || ($3 == "payment") ) && ($5==x) {sum_7 += $7} END {printf "%-10.2f\n",  sum_7 }'`
Redemption=`sed '1d' $KAU_CI_extract | awk -F, -v x=$KAU_HotWalletAccount -v y=$KAU_EmissionAccount '( ($3=="payment") && (($5==x) && ($6==y)) ) {sum_7 += $7} END {printf "%-10.2f\n", sum_7 }'`
bc <<< "$Mint - $Redemption"
 

Attachments

  • KAU-justInCase.zip
    482 bytes · Views: 2

Translate

Back
Top