A quant gets hold of a stable coin :) But some interesting points for EVM token coding ... 👇 https://twitter.com/odtorson/status/1289228338767093760
Adjusting balances is horrifyingly gas inefficient. To manage this you need to keep an internal accounting unit, and then adjust the ratio between the accounting unit and the "real balance". (Yes, this causes rounding issues.)
#ERC1155 allows us to define a universe of tokens. So we could take the uuid of the particular #ERC1155 sub-token to be a hash of the parameters defining it, ex.
{
reset_time_sec: 233243,
denomination: USD
}.
Rather than being stored on-chain, these parameters would be passed every time the rebalance function was called. IIRC this sort of thing was @wekabot 's idea to save on storage, and is used extensively by @FunFairTech
Nick's Amplethoughts 🙂 are here btw 👉 https://twitter.com/wekabot/status/1288725424021725185
Instead of using USD as a denominator, in reality, it would need to be an Oracle, ex. @provablethings or @chainlink or piggy-backing on some other DeFi idea's price feed.
You could even pass an acceptably up-to-date proof from the Oracle at transfer time at the cost of breaking compatibility with ERC1155 and probably introducing a range of opportunities to game the system. That would give you effectively real-time adjustments.
In the end though, I suspect there's some law that makes all pure crypto-assets replicate the risk of a Martingale Walk. All constructions like Ampleforth can effect is to shift the tails around a bit.
Maybe I'll get around to implementing this for fun 🙂 Along with some binary options and catbonds...
You can follow @thomasbarkercom.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: