3) Let's say that you have a margin trading protocol which allows cross-margin between a bunch of different assets.
Your algorithm is "require 30% initial margin and 20% maintenance margin"--i.e. allow ~3x leverage, and margin call accounts if they get up to 5x leverage.
4) You have an 'oracle' which reports the price of the assets, and your risk engine--the thing that calculates users' margin--uses prices from that oracle.
One asset--say XYZ--has a price of roughly $0.40 according to the oracle.
A user--Alice--has $200m XYZ and -$25m USD.
5) Alice:
500m XYZ ~ $200m
-25m USD = -$25m
net value ~ $175m
margin ~ 87.5%
how much should the risk engine allow Alice to withdraw?
6) A naïve answer would be "well if you require 30% margin then Alice can withdraw up to $115m; at that point her account would be:
500m XYZ ~ $200m
-140m USD = -$140m
net value ~ $60m
margin ~ 30%"
7) But there's a picture of a mango over The Oracle's face.
So, obviously, XYZ is actually MNGO, and MNGO isn't really worth $0.40; it's worth around $0.04.
Alice's real account value is, roughly:
500m XYZ ~ $20m
-25m USD = -$25m
net value ~ -$5m
margin < 0
It's already gone.
8) But for a brief period, someone (almost certainly Alice) bought enough MNGO that it did trade for $0.40, and before people could get in to sell and return it to a more reasonable price, the risk engine had already allowed Alice to withdraw $100m from Mango Markets.
9) So, what went wrong? Did the oracle fuck up?
I mean, not really. Or, rather, it depends on what the specs of the oracle were.
The oracle accurate reported the current price of MNGO. It's just that the 'current price' wasn't really anything close to the 'fair price'.
10) What should you really do?
Well, let's look at what FTX does, and why *it* didn't have any risk engine issues.
11) First, FTX has EWMA price bands.
What this means is, roughly, that FTX consumes raw price feeds.
But, before feeding that into its risk engine, it bounds those price feeds so that they can't move more than ~20% over a 5 minute period.
18) (It's worth noting that this is all referring to FTX International.
In addition to all of the above protections, our amendment for FTX US Derivative's margin order would only be for BTC and ETH futures using USD margin. No MNGO, and certainly no MNGO collateral.)
19) There are a bunch of other risk engine protections and sanity checks, too, which would have caught something like this.
So -- back to the oracle.
It reports:
"MNGO: $0.40"
Is it wrong?
20) Well, it depends on what it's promising.
But probably it's just promising to tell you, literally, what MNGO is currently trading at. And, for a brief period, on some exchanges, MNGO was in fact trading at $0.40.
The real problem here was using the raw oracle price.
21) The Oracle tells you everything and nothing--the history and current state of markets.
It's the risk engine's job to consume that information, and decide what positions are safe.
Sometimes it can't just regurgitate The Oracle. Sometimes it has to make up its own damn mind.
22) Which doesn't mean that the risk engine needs to be manual.
You can create a set of rules for it so that it's conservative, and handles apparent large moves gracefully.
That, in the end, is probably the most important thing we do at FTX.
23) And, really, it's why we started FTX in the first place.
Tradfi had sophisticated (sometimes!), slow, manual risk models, and--in some FCMs--fast, egregious ones.
Crypto had fast, automated, broken risk models.
There was an opening for a thoughtfully automated risk engine.
• • •
Missing some Tweet in this thread? You can try to
force a refresh
my current best guess is consistent what @GaryGensler says: that the CFTC will regulate spot + futures for non-security tokens, and the SEC will regulate spot + issuance of tokens that are securities
2) In theory, if social media messages were on-chain, then in addition to composability between different platforms, you could have the blockchain operate within a tweet.
What does that mean?
3) Well, first, there would be ways to send messages like:
"The winner of the protocol governance vote is {xyz}", where {xyz} was a reference to an actual on-chain smart contract, _combined with its value_.