Dev Update #2

Arcadia Finance
Block Magnates
Published in
6 min readAug 9, 2022

--

Last month we have been working hard on different fronts of the Arcadia protocol, particularly in our dapp development and testnet launch. The team went to EthCC on the hottest days of the year, started working on our risk models & made significant protocol design improvements.

Paper trading game

On July 11th, our paper trading game went live on Rinkeby. The days leading up to our testnet launch were mostly filled with dapp developments and performance improvements.

There was quite some effort done on data caching and fetching it in ‘smart’ ways. For example, getting the vault details overview uses many different smart contract calls to multiple different smart contracts. This led to our Infura plan blowing up and caused delays in loading the overview page. We then switched to deploying and using a custom helper smart contracts that already pre-fetches and pre-parses all the required data for a vault overview and for the leaderboard. The latest helper contract can be found here: https://github.com/arcadia-finance/lending-core/blob/main_paper_trading/src/utils/Helper.sol. A valid point on foreseeing view functions that simplify frontend integrations, either through your main contracts or by providing helper contracts on top!

Another learning point on our end was that our original cloud service provider didn’t have a reliable “99.99x%” uptime. On Friday July 15th and Saturday the 16th our backend server was offline for a short time, it was quickly noticed by many of the paper trading game participants. As such we migrated our backend to another cloud service provider that same Saturday. As of then we have had a nearly 100% uptime.

Throughout the paper trading game we have continuously improved the UI of the dapp, now showing vault value & composition overviews on the overview page, as well as significant improvements to the graphs and usability of the shop(ping cart).

A testnet launch isn’t only to allow users to get to know the protocol; as the name suggest it’s also used to test stuff. As such we have been running a few scenario’s behind the scenes. Think of adding new assets, new numeraires (base currencies in which you can take out debt), upgrading vault logic, … Not all of these features have been made available in the UI to prevent users being overloaded with functional changes in the span of a month. Nonetheless these test scenario’s were very valuable to the team. One point of attention that we had was to refactor the vault upgradability: the logic of a vault can be changed by the user (and only by the user) when new features would become available (such as active collateral management, flash withdrawals, …). We have improved this functionality through a recent Github PR. In short, we take testing as serious as running a node:

In a few days, the paper trading competition will officially end. We do plan on resetting the whole protocol and letting users open up vaults as they wish, should they want to continue some paper trading on the side! A big thank you to all 252 unique participants!

For those just tuning in, you can still play around on our testnet protocol at https://app.arcadia.finance/.

Public code

Together with the launch of our testnet protocol, we have also made our Github repository public: https://github.com/arcadia-finance/. Users can now see, verify and play around with our smart contracts. We strongly invite any community member to open up issues, create meaningful pull requests and to contribute to our code.

In the near future we plan on opening up more of our repositories, including the frontend for the dapp -once that reaches maturation- and our risk models.

Risk models

Any protocol that is exposed to the value and volatility of collateralized assets should (and hopefully will) have spent their fair share of time on modeling all sorts of risks.

During EthCC we joined a few very interesting talks by Galaxy Digital, 0Vix and Polygon related to both on-chain and off-chain risk models. It was very humbling to see these thought leaders opening up their risk models, assumptions and shortcomings.

Arcadia will continue building on this solid foundation of open risk models. Since our Arcadia Vaults can have a combination of different assets, our models should not only take into account volatility of individual assets, but also the correlation between different assets. The eventual goal of all such risk models is to find an optimum equilibrium, where the probability that an Arcadia Vault would become undercollateralized at any point in time is acceptable, while still offering as much LTV with the lowest possible liquidation threshold possible to the borrowers. This is a delicate exercise where much research is yet to be done. Zeki will lead this research effort, leveraging his previous experience in building the risk models for large insurance companies.

Protocol design

Arcadia Lending initially started with the CDP design such as MakerDAO uses: new debt tokens (~DAI in their case) are minted against the users’ collateral upon taking debt. Although this is a proven approach, it does come with a few drawbacks:

  1. The CDP is (often) issued as a stablecoin, such as DAI in MakerDAO’s model. Issuing a stablecoin comes with the obvious drawback that the peg of the new stablecoin has to be maintained and that the issuing protocol is responsible for maintaining the peg. Should you offer multiple base currencies in which a user can take out debt, multiple pegged coins would have to be maintained.
    On top, sadly, stablecoin issuers might get more attention from overzealous regulators in the future.
  2. The lending and collateral management layers would be too intertwined. We’ll spare you the details, but in the CDP model, it is quiet tricky (read impossible) to separate the lending logic from individual vaults. With Arcadia, we try to split the collateral management part (Arcadia Vaults) as much as possible from our lending protocol (Arcadia Lending). The only interconnection should be the fact that Arcadia Lending uses Arcadia Vaults as collateral. Keeping this separate opens up possibilities where protocols can built on top of Arcadia Vaults, separated from Arcadia Lending.
  3. Bootstrapping liquidity would mean for liquidity providers to deposit assets in an Arcadia Vault, take out a loan, receive the CDP and then either stake the CDP and/or add it to an AMM liquidity position. It would be quite cumbersome and many liquidity providers or market makers we have talked to would prefer to “simply provide the funds” instead of going through these hoops first.

As such we have been overhauling our protocol designs. We are now working on a formal split of our Arcadia Vaults and our Arcadia Lending protocol. The latter will use (tranched) Lending pools based on the ERC4626 standard. This opens up a few very cool features which we’ll be able to share with you shortly! It will also allow us to focus on our protocols themselves, without having to support new stablecoins and will make bootstrapping liquidity significantly easier.

Arcadia Vault overview
Arcadia Lending overview. Note the Arcadia Vault as collateral.

A clear overview of our updated protocol design can be found in our docs: https://docs.arcadia.finance/

To come

Coming month(s), we will focus on adding, fine-tuning and improving the following features:

  • Finish setting up tranched lending pools based on ERC4626. Let’s call them ERC4626T.
  • Finish Uniswap V3 pricing logic.
  • Add functionality to our Vaults to allow in-vault swapping of assets on external AMMs.
  • Add functionality to allow flash withdrawals. Claiming airdrops based on assets in your vault? No need to close positions and withdraw your collateral!
  • The switch to lending pools will also require some changes to our liquidation logic. We are also experimenting with “insured liquidation as a service”, which comes close to a decentralized clearing house, more to come later on this!
  • Create a robust, reliable and accurate risk model to parameterize collateral and liquidation thresholds.
  • Increasing the team with non-technical profiles, such as bizdevs.

--

--