Links:
Github Repository: github.com/cur...
Peg Keeper Pools: curve.fi/#/eth...
Curve Monitor: curvemonitor.c...
$crvUSD Markets: crvusd.curve.f...
$crvUSD White Paper: github.com/cur...
----
Along with $crvUSD, there is also a number of Peg Keeper pools that were launched. These are vanilla V1 pools. This is like the 3pool. It's optimized for trading stablecoins against other stablecoins, and not much else. We've seen what happens when stablecoins depeg, but generally when stablecoins hold their peg, the v1 pools just do what they do, they allow you to trade between them.
$crvUSD’s architecture allows it to aggregate amongst these pools and kind of take the average amongst all of them. And if it detects any of them kind of float too far off-peg, it actually has the capability of somewhat discarding those results.
How can you access this Peg Keeper architecture from within $crvUSD?
So if we look at the $crvUSD markets page, one thing to note here is this borrow rate. These Peg Keepers are one of the things that informs this borrow rate. If the balances of these pools get too far out in one direction or the other, this borrow rate can be adjusted. It can basically say we need more $crvUSD in the system or we need less $crvUSD in the system.
Through any of these, you can actually access the Peg Keeper pools directly. So if you check on the LLAMMA details and click on `Monetary Policy`, it'll take you to Etherscan, and on Etherscan... function seven here... `peg_keepers` 0 is going to take you to the Peg Keeper that will interact with the first Peg Keeper pool, $USDT.
If we dive into the contract, as far as Curve contracts go, this one's fairly legible: even if you don't have the most coding knowledge, you can kind of understand this. There's only a couple of interesting functions that we're really going to worry ourselves with. You know, there's a lot of admin functions and whatnot, but the meat of this is the `estimate_caller_profit.`
This is a view function. So this is just going to be publicly callable free and it's going to echo a number and it's basically the exact same logic as this `update` function, which would run in real time.
The Peg Keepers are special contracts, because other than minting $crvUSD with collateral, it's the only way that new $crvUSD can get minted. These four peg keeper pools are actually authorized to mint new $crvUSD, but only for the purposes of trading into and out of the affiliated pools.
That is, if the $USDP was a little bit off of balance, it's got the capability of “dumping” or “pumping” a stablecoin. It can actually, if you run it live, it can provide or withdraw the stablecoin directly from the LP pool... essentially trades it to help keep these pools on peg.
Smart contracts can't really call themselves. So this is why these are public functions that literally anybody can call. Like, you could do with Chainlink, but $crvUSD is designed around basically aligning the incentives so that you, the casual ape, actually want to call this function.
If you call the `update` function and this pool's `estimated_caller_profit` is greater than 0, you get some of that money. It's going to give you some of the LP token profits that it's accumulated from trading these pools.
We've built a Brownie script, which is going to be very helpful if you're planning on doing this at scale. What the script does is it looks through the four Peg Keeper pools, and it calls the `estimate_caller_profit` in each of them and says how much in terms of dollars you would get if you called the pool.
It actually ends up being slightly higher when you actually call it due to the constantly increasing LP price.
But the problem is gas. So you're going have to sit around and wait for either the profits to increase or the gas to go down or find some other way of getting the money out of the pool. So we told you would be worth your while. The Peg Keepers are an instrumental part of the $crvUSD architecture, and we've just barely glossed the surface of how well this all works.
But, we look forward to your questions. Drop them in the comments and we'll get back to you.
Негізгі бет $crvUSD Peg Keeper
Пікірлер: 5