5 ms·
I could imagine they could possibly choose the amount randomly and truly deposit such amount to the fund.
by playingalong 3y ago
I could imagine they could possibly choose the amount randomly and truly deposit such amount to the fund.
- JumpCrisscross 3y ago> could imagine they could possibly choose the amount randomly and truly deposit such amount to the fund This would be bad risk management. The random number makes it clear that not creating the fund wasn't an oversight, it was a willful deception.
- londons_explore 3y agoIt wouldn't be terrible risk management. The value chosen (after many days) is going to converge to being awfully close to the trading volume × 0.0075
- maxbond 3y agoIf that's the level the fund should be at than that's how they should have written it (as a constant multiple). This implementation makes it possible for the "insurance" fund to be reduced by an unbounded amount on a day of record high trading volume (indeed, the higher the trading volume, the more likely it is you'll withdraw a large sum from the fund). Creating the possibility that some rotten luck could wreck you when you're most vulnerable is bad risk management. It's thumbing your nose in the face of Murphy's Law.
- svnt 3y agoOh of course, but then it would be breach of fiduciary duty or maybe just gross negligence.
- tomku 3y agoIf you were doing that, don't you think it'd be handy to have a record of the amount to deposit? The random amount that's generated isn't even stored anywhere, it's just added directly to the total and written back to the database. What are you going to do, have another daily task that tops off the actual insurance fund to whatever the website says the total should be? Why would you treat a display value meant for the website as the source of truth about the correct value of an actual account? The only reason to do it this way is if there's no intent for the number to correspond to reality at all.
- maxbond 3y agoTo be fair I do think they do that on line 27. They have a table of deltas which they then materialize manually in a different table (which presumably only has one row?). And amusingly link them with foreign keys. ORMs make for some weird schemas, this looks like how I might do it MongoDB. But to your point; if this code is written honestly, it's pretty weird that we don't see any code to post a transaction to the blockchain, or to verify that the funds are available to be allocated to the insurance funds. You would think that would happen before you wrote the new total to the database.
- tomku 3y agoYou're right, misread that because of the indentation and diff formatting, good catch!