What powers Fuji’s Cross-Chain Money Market Aggregator?

Mark Anstead
Fuji Finance
Published in
5 min readJan 17, 2023

Since the inception of Fuji’s V1, the team has been focused on optimizing money markets (specifically borrowing) to ensure the lowest possible interest rate on your debt positions. This works because Fuji is constantly looking at various terms across different markets. If one is more optimal, Fuji will automatically migrate your debt to a new market to offer you lower interest.

With the V2, this process will get leveled up. Not only will Fuji be able to view the terms on the chain you have funds on, but it will also look at the terms on all available chains. Taking things another step further, Fuji will also enable this functionality for assets that can be used as collateral, thus guaranteeing the best yield on your idle assets, and the lowest interest rate on your loans, regardless of the chain you are using. Composability at its finest!

So how will this work?

ERC-4626 tokenized vaults

Behind the scenes, Fuji is using some pretty powerful technologies! For our V2, we have adopted the ERC-4626 vault standard that will make integrations with various yield-bearing assets much more straightforward. These vaults can deal with tokens that are constantly generating yield, as well as additional token rewards, similar to what Aave, Compound, or Morpho have offered in their native token to depositors and borrowers.

What’s more, we extend the ERC-4626 standard with functionalities for debt management. Our vaults can support not only yield-bearing assets, but also debt-accruing ones. Users will now have more flexibility on how they want each vault to operate, and can easily harvest, compound, or repay outstanding loans from tokens they receive.

When dealing with complex DeFi strategies, ERC-4626, combined with a router, will allow the bundling of multiple contract calls into one single transaction, improving the UX significantly. From the developer perspective, building on 4626 will also make the integrations into some of the protocols we are supporting with the V2 straightforward, saving us a significant amount of time and resources.

Debt permits powered by EIP-712 and EIP-2612

Another innovation with Fuji V2 is leveraging the EIP-712 and EIP-2612 standards and bringing the so-called “permits” into debt management operations. The rationale is that users don’t interact directly with the smart contracts on the destination chain; they need to authorize another contract to act on their behalf.

Building on top of these EIPs helps us enhance the user experience, so let’s try to understand them better. EIP-712 allows for signing messages in a standardized manner. Previously, when signing messages, they were a bunch of random jumbled numbers and letters- and the user would always be confused about what was actually occurring. Now, you can see and understand what you are signing:

The EIP-2612 was introduced by the MakerDAO team and significantly reduced the cost and friction when dealing with approvals for ERC-20 tokens (e.g. USDC, USDT, wBTC, MATIC, among other assets). It removed the need to make a separate transaction to approve a contract.

The Fuji team is leveraging both of these standards to allow for withdrawals-on-behalf and borrow-on-behalf of a user by following a structured message. You might be wondering- what does that mean in English?… Well, that means we can make these cross-chain operations by acting on behalf of the user in a non-custodial manner on any chain, which is a key element for our cross-chain app (xApp).

Connext’s “xCall”

Fuji’s V1 aggregates money markets, but they are all siloed to the chains where they operate. This causes liquidity fragmentation and suboptimal user experience! For example, if you have a deposit on Aave on Ethereum and want to move it to DForce on Arbitrum, there is no straightforward way to do so.

Since Fuji is evolving from a multi-chain product to offer composability cross-chain, we needed infrastructure to help make this happen. We eventually built support for Connext in our V2 to enable interoperability between all those money markets across different chains. This is possible thanks to Connext’s technology, specifically their upgrade known as Amarok, which has just recently gone live! Amarok unlocks a “chain agnostic world for both developers and users.”

https://twitter.com/ConnextNetwork/status/1505256394244636674

If you aren’t familiar with Connext, they were one of the first teams to build bridges on Ethereum, enabling cross-chain communication. With the Amarok upgrade, there is one specific feature that sets them apart, which is the ability to “xCall”. This means that you can call a contract from a completely separate chain (destination chain), and execute it from the origin chain (where your funds are coming from).

We can take the aggregation engine from our V1, and bridge that concept to other chains by using “xCall”, thus creating the first cross-chain money market aggregator. One of the additional reasons we are building on top of Connext is because it leverages the security of canonical bridges (some examples of that are Polygon PoS, or rollup bridges) to verify messages, meaning there are no extra trust assumptions on top of the connected chains. Their system of watchers and circuit breakers helps to minimize risk and increase security overall.

If you want to learn more about our team and what we are building at Fuji Finance, I recommend following us on Twitter, checking out our documentation, and staying in the loop for the launch of our V2! In the meantime, you are welcome to play around with our v1 application and begin to optimize your outstanding loans on Ethereum, Polygon, Fantom, and Arbitrum. Stay tuned for what’s next!

About Fuji Finance:

Fuji Finance built the first borrowing aggregator on Ethereum and is building the first cross-chain money market aggregator. Use Fuji Finance to make borrowing and lending in DeFi, simple. Save time & money when taking out DeFi loans.

Website

Twitter

Discord

Medium

Documentation

Resources:

ERC-4626

https://ethereum.org/en/developers/docs/standards/tokens/erc-4626/

https://bowtiedisland.com/erc-4626-the-most-important-standard-youll-never-notice/

Connext

https://blog.connext.network/how-to-build-cross-chain-apps-xapps-45cf2705d17e

https://docs.connext.network/developers/guides/xcall-status

https://docs.connext.network/routers/routers-intro

--

--