Great implementation! Ive had a tab open on my phone since I saw you posted it (either on the YT video or a reddit page) and love to occasionally play it :)
At first every vertex have random balance from -4 to 5. Then it add or substract 1 dollar from random vertex one by one until the sum reach it's goal. The goal sum is genus number + or -1, but more than 0.