const / コンスト
473 posts





流動性提供の手数料発生のしくみ Part 3|yugure.sol @crypto2real #note 手数料を生み出さない流動性と改善の方向性、レンジ外を意図的に使うことなどを説明します。 note.com/crypto2real/n/…

A thread: *ALL ABOUT AJNA* @ajnafi Next week Ajna redeploys to the Ethereum mainnet and to multiple L2s. I think it's as good a time as any to share the story of how the project came to be, and why it was so insanely hard to build. The story begins in July of 2021 with the winddown of the @MakerDAO Foundation. The entire original founding team of Ajna (9 of us) had all recently left the Maker Foundation as part of its winddown process. It was the peak of the "free money era" bull market and optimism regarding the future of DeFi was everywhere. But not for us. We had seen how the sausage was made. We knew that the mechanisms and risk trade-offs behind the scenes were never going to hold water. But even more importantly, we realized that the fundamental architecture of most protocols inhibited us from doing what we actually wanted to do, which was to use the majority of the crypto assets in our portfolio across DeFi. The team came from a combination of backgrounds in software development and prop/high-frequency trading, and many of us had the shared experience of helping to build MakerDAO. We knew it would be a challenge to solve this problem, but we thought we were uniquely suited to do it. Until now, most protocols (pretty sure Uniswap is the sole notable exception) have used a model that socializes risk across all users and manages this risk through governance. They also employ centralized price feeds via oracles like Chainlink that introduce fundamentally unscalable trust assumptions into the business logic of the protocol. Why unscalable? Just look at how the major DeFi protocols work today and it should be obvious. They can only support "blue chip" assets with huge secondary market liquidity and a reliable price oracle. The moment they stray from this they get rekt. It's not a matter of tweaking governance parameters, it is a fundamental design flaw. In order to be supported by these protocols, a new asset creator needs to spend months building secondary market liquidity, working with exchanges and market makers, integrating with oracle providers, and (worst of all IMO) negotiating with the "governance" abominations we call DAOs. The result is that only extremely well funded teams with an army of lawyers to defend their decentralization theatrics can actually launch assets and get them supported across the ecosystem. This is completely against the promise and the ethos of crypto. But why is it so hard to get a reliable price oracle? Price oracles rely on a sufficient amount of secondary market liquidity in order to be used as a price feed for other DeFi activities like lending/borrowing. If the amount of liquidity in a lending protocol is greater than the amount of liquidity in the secondary market, the secondary market can be manipulated to (generally) profitably manipulate the lending market. We've seen this happen more times than I can count now. For a new or smaller asset it's very difficult (if not impossible) to get to a sufficient level of secondary market liquidity, and even harder to get a DAO to pay attention/justify putting in the resources required for onboarding. There is also a "chicken and the egg" problem at work. In order for a secondary market to develop, market makers need inventory, and this inventory is generally provided to them as a loan. If they can't get a loan, they will have to tie up their own capital and take on the price risk themselves, which they won't do isn't scalable anyway. In order to secure a loan on a new or small asset, market makers will need to work directly with the team that created the asset. This pattern is optimizing for centralization and hurting the regulatory status of the entire industry. Ajna offers a new path. The reason it took 2.5 years to implement and reach a final deployment of the Ajna Protocol is that we completely removed oracles from the equation. It was incredibly difficult to do this. Frankly, any protocol that does not remove the need for oracles is just not trying to solve the same problem as Ajna and cannot possibly serve the same breadth of assets that Ajna does. Ultimately the Ajna Protocol not only removed price oracles, but also any form of governance. Our contracts are completely immutable, credibly neutral, and permissionless. So how does it work? First, Ajna introduces a novel mechanism for liquidity management inside the lending pool. Most other lending markets are one-dimensional, in the sense that the entire pool will lend and collateralize loans at the same price (the one provided by the oracle). Ajna is multi-dimensional. It uses a type of order book to accept deposits and automatically distributes loans across these prices. To do this we had to implement a novel mechanism called a Scaled Fenwick Tree. This was created by our team member @anthropicprince and the concept was published in the IEEE journal: ieeexplore.ieee.org/document/10196… By having lenders provide the price at which they are willing to lend at to the protocol, rather than using an external and trusted price source, Ajna removes the need for oracles altogether. The implication of this is that an Ajna market is completely self contained and therefore resistant to price manipulation on secondary markets. You can use Ajna to borrow/lend against any asset in your portfolio - be it a super illiquid ERC20, or even an individual NFT. This has never been possible before now in a peer-to-pool setting. Now, the pool must determine what level of over-collateralization is required for a given asset. Through the research of our economic consultants/advisors, we reached the conclusion that a good approximation for the annualized volatility of an asset is the square root of the annualized interest rate in an efficient lending market (denominated in the lending asset). We therefore take the square root of the annualized interest rate and apply some extra calculations to determine the overcollateralization required of a loan at any given time. The overcollateralization of a specific loan is fixed upon origination, giving the borrower a known liquidation price, and therefore provides a UX similar to other lending protocols. The next component of the lending pool is managing the interest rate, which Ajna does without governance. Each Ajna pool has an internal concept of balance, which tries to match two numbers: "target utilization" and "meaningful actual utilization." This balance metric accounts for all meaningful deposits (i.e. deposits above a certain price) and checks what % of them are being utilized. It then looks at the average collateralization of the loans in the pool and inverts this number to create a target level of utilization. The logic behind this target level is that users collateralize their loans in line with the volatility of the asset (partially because they don't want to get liquidated and partially because they are forced to), which in turn informs the pool how difficult it will be to replenish liquidity and therefore what % of the deposits it should ideally keep reserved. Every 12 hours the pool checks how far these two numbers are from each other and adjusts the rate up or down by 10%. It does this until the utilization rates are in equilibrium. The combination of these mechanisms creates a virtuous cycle where lenders can make an informed decision based on the current rate of the pool, and where the accumulation of these informed decisions further influences the rate mechanics. Finally, and perhaps most importantly, all lending markets need an efficient liquidation mechanism. The problem with a liquidation mechanism that does not use oracles is that it relies on game theory and can be manipulated if the incentives are not carefully calibrated. To solve this problem, Ajna pioneered the concept of “liquidation bonds.” A liquidation bond is effectively a bet that the kicker of a liquidation will need to make on the outcome of that liquidation. For example, if I see a loan in an Ajna pool that is below the minimum collateralization relative to the actual market price (which the pool does not know), I can kick that loan into liquidation. However, in order to do so, I will need to put down a cash deposit that guarantees the settlement of the liquidation auction below a certain price. If the auction settles above this price range, I will lose my bond. If it settles below, I will make money on my bond. The result of this mechanism is a decentralized marketplace for liquidations where liquidators need to put skin in the game in order to kick a loan into auction, and one in which they have no direct incentive to cheat, removing the need for oracles or governance in the liquidation mechanics. On a personal level, my experience working with my co-founders at Ajna, and all of the other amazing people who I've met along the way, has been one of the most meaningful learning experiences of my life. It is bittersweet to see it come to an end. When the protocol is relaunched next week, we will be simultaneously winding down Ajna Labs LLC and disbanding our team. We are doing this because we need to eat our own dogfood. We truly believe in the promise of decentralization. Once the team is gone and the protocol is once again live, the first grants cycle will begin and decentralized ecosystem development can take root. Ping @Davidutro to learn more about that. I’m excited to see how you all will use Ajna and I’m hopeful for the positive impact it can have on DeFi. See you all on the other side 🫡