BLOG — Use cases

426 days ago

NFT Lending Management with Gelato

Orium Network Use Case: Petting & Lending Aavegotchis

Summary

  • Innovative DeFi projects are increasingly implementing NFT Lending
  • Orium Network is one of these use cases, enabling people to lend Aavegotchi NFTs to players
  • Gelato Automate ensures Aavegotchis are returned when their lending periods are over

NFT Lending

Non-fungible Tokens (NFTs) have pushed blockchain technology into the mainstream arena, fuelling the adoption of web3. Be it digital art, real estate, or gaming, an NFT represents the digital ownership of an asset which can be traded. More recently, multiple projects have introduced an exciting new use case: NFT lending.

The Problem

While real world borrowing and lending requires trust, web3 promises “trustless” interactions between parties, meaning you don't need to trust third parties in order for a marketplace to work. So how do you bypass the need for trust in lending? In DeFi, protocols do this by requiring borrowers to deposit more collateral than the amount they are borrowing. However, when it comes to NFT lending and borrowing, there are better options than forcing the borrower to put up collateral valued at more than the NFT they are borrowing.

Gelato allows lenders and borrowers to transact without needing any collateral, providing the trust with a battle-tested army of executors that will execute the return of the NFT when the lending period is over.

Exploring Solutions

The most common way NFT lending is implemented is via locking the NFT as collateral for a loan. This can be done peer-to-peer like NFTfi or peer-to-pool like BendDao.

A second use case is an NFT rental, where the lender loans the NFT to a borrower for a period of time in return for an upfront payment.

Orium Network uses this second model where a user lends an Aavegotchi to a borrower so that the borrower can play the Aavegotchi game.

Orium Network Use Case

Aavegotchi is an “open-source community-owned NFT gaming protocol, enabling true asset ownership for gamers”. The Aavegotchi platform is a mix of DeFi, NFT and gaming offering the players rewards following the “play-to-earn” model – the more you play, the more you earn.

Orium Network is a “pet operator” that offers the automatic petting and lending of Aavegotchis by using Gelato to automate the petting task. Over 60,000 Aavegotchis have been shown some love with automatic petting. The proxy contract and the implementation contract can be found on the Polygon network, where we can see how simple it is to implement Gelato.

Lending Scheduler

One fundamental aspect of the Aavegotchi world is the ability to lend your Aavegotchis. This allows users to start interacting with the game without buying an Aavegotchi upfront.

When lending, the lender and borrower agree on an upfront cost and the profit share split from the game, including an Orium fee (5%).

Once the lending period finishes, Gelato ensures that the Aavegotchi is returned to the owner.

The beauty of this use case, as can be seen in the resolver contract, is that with the help of Gelato and very few lines of code, Orium Network can offer an innovative, valuable service to Aavegotchi gamers.

Gelato Automate

Here we can see how Orium Network Gelato-fy their tasks:

  1. Wire-in Gelato Infrastructure: They use minimal infrastructure, only passing the Gelato address in the initializer.
function initialize(address aavegotchiDiamondContract, uint256 max_number_aavegotchis, address gelatoAddress)
   public
    initializer {
       _gelatoAddress = gelatoAddress;
      }
  1. Funding Strategy: They opt to use the treasury contract to pay for task executions.
  2. Gelato Custom Logic - the lending logic:

a) Task creation: There's no need to create the task dynamically, it can be created through the Gelato Automate UI

b) Checker Condition: - logic that determines if task needs executing. This is done using a resolver contract:

     // @notice Gelato pools the checker function for every bloc

    function checker() external view returns (bool canExec, bytes memory execPayload) {
        IAavegotchiOperator aavegotchiOperator = IAavegotchiOperator(_aavegotchiOperatorAddress);
        (uint256[] memory tokenIds, address[] memory revokedAddresses) = aavegotchiOperator.listAavegotchisToPetAndAddressesToRemove();
        if (tokenIds.length > 0) {
            canExec = true;
            execPayload = abi.encodeWithSelector(IAavegotchiOperator.petAavegotchisAndRemoveRevoked.selector, tokenIds, revokedAddresses);
        } else {
            canExec = false;
            execPayload = bytes("No tokenIds to pet");
        }
    }

c) Executable function: In this case, the executable function is petAavegotchisAndRemoveRevoked. The code implements the modifier onlyGelato() which ensures that only Gelato Automate can execute this task.

    function petAavegotchisAndRemoveRevoked(uint256[]
       calldata tokenIds, address[] calldata revokedAddresses)
       external onlyGelato {
       ...
       }

Conclusion

Web3 is dedicated to building an internet of value, therefore changing how we interact with value will create new business models. As Orium Network shows, integrating Gelato’s suite of services can augment your smart contracts by ensuring that transactions are executed reliably and automatically to facilitate NFT Lending.

About Gelato

Gelato is a Web3 Cloud Platform empowering developers to create automated, gasless, and off-chain-aware Layer 2 chains and smart contracts. Over 400 web3 projects rely on Gelato for years to facilitate millions of transactions in DeFi, NFTs, and gaming.

  • Gelato RaaS: Deploy your own tailor-made ZK or OP L2 chains in a single click with native Account Abstraction and all Gelato middleware baked in.

  • Web3 Functions: Connect your smart contracts to off-chain data & computation by running decentralized cloud functions.

  • Automate: Automate your smart contracts by executing transactions automatically in a reliable, developer-friendly & decentralized manner.

  • Relay: Give your users access to reliable, robust, and scalable gasless transactions via a simple-to-use API.

  • Account Abstraction SDK: Gelato has partnered with Safe, to build a fully-fledged Account Abstraction SDK, combining Gelato's industry's best gasless transaction capabilities, with the industry's most secure smart contract wallet.

Subscribe to our newsletter and turn on your Twitter notifications to get the most recent updates about the Gelato ecosystem! If you are interested in being part of the Gelato team and building the future of the Internet browse the open positions and apply here.

Resources

Aavegotchi.com

Orium Network

Orium Lending Service