Tech Grant Application - Litra Finance - Providing NFT Liquidity as a Service (LaaS)

Litra Finance | Creating deep NFT liquidity using advanced bonding curves and veToken model

Technical Plan for NFT Cross-Chain Interoperability (Phase One)

1. Project Info
Litra can create sufficient NFT liquidity using advanced bonding curves and veToken model to provide NFT Liquidity as a Service and empower NFT pricing and solve the low liquidity issue of the NFT market.

Litra wraps NFTs into corresponding fungible tokens (wNFT) to improve trading precision. Using AMM with auto-concentrated liquidity and customized bonding curves, Litra provides traders with low slippage while reducing impermanent loss and management costs for liquidity providers. Besides, Litra introduces the veToken model to incentivize liquidity providers to form sufficient liquidity in Litra by offering higher returns, which improves the price discovery mechanism in the NFT market.

In addition, the veToken model also aligns the long-term interests of Litra’s core users and the protocol itself, and brings a liquidity guidance feature that helps reduce the cost of maintaining NFT liquidity for issuers while allowing veToken holders to monetize their governance rights.

Website: Litra - Unleash the superliquidity of NFTs
Introduction: Litra_cn.mp4 - Google Drive
Github: litrafi (Litra) · GitHub

2. Core Strengths
The Litra protocol has been simplified to the extreme in order to become the NFT+DeFi infrastructure and connect as many protocols and platforms as possible. Therefore, it is easy to fork the smart contract but extraordinarily expensive to replace due to:

  • Litra has a first-mover advantage in the industry and is expected to become a foundational protocol soon. As wNFT synthesized by Litra will be widely accepted by other protocols and platforms, its direct and simple composability will become an industry standard, giving Litra the pricing power of NFTs;
  • The Litra core team has expertise in designing, developing, and operating in both DeFi and NFT projects, and understands various DeFi protocols and platforms, such as Curve, Uniswap, and Balancer, including their economic and governance models.

3. Goals with Map Protocol
Based on Map Protocol cross-chain services, Litra Finance can achieve the core functionality and end-to-end process for NFT cross-chain to generate revenue through the implementation of the original NFT projects or their forks.

4. Solutions
Litra utilizes the Map Protocol to enable cross-chain functionality for wrapped NFTs (wNFT), which are ERC-20 tokens. In the following technical solution, we will use an example of transferring wNFT from Chain A to Chain B, and cross-chain transfer back from Chain B to Chain A.

To achieve this, Litra must deploy the core functional contracts and cross-chain transfer contracts on both Chain A and Chain B.

Note: The Litra cross-chain contracts only interact with the Map Protocol’s MOS contract.

4.1. Cross-chain transfer of native assets from Chain A to Chain B

  1. Users call the Litra’s core contracts on Chain A to stake NFTs, wrap then into wNFTs to receive the native wNFT assets on Chain A;
  2. Users call the cross-chain transfer contract on Chain A, stake the native wNFT assets in the contract, and send a message to Chain B using the Map Protocol’s MOS contract;
  3. Through the cross-chain transfer contracts on Chain B, Litra receives the message and mint the cross-chain wNFT assets, and records the source chain and original assets information for the cross-chain assets.

4.2. Cross-chain transfer of cross-chained assets from Chain B to Chain A, the original chain

  1. Users call the cross-chain transfer contracts on Chain B, burn the cross-chained wNFT assets, and send a message to Chain A using the Map Protocol’s MOS contract;
  2. Litra receives the message from cross-chain transfer contracts on Chain A, releases the staked native wNFT assets on Chain A.

Note: Cross-chained assets can only be transferred to their original chains.

5. Implementation

5.1. Codes
The codes below will be implemented according to the principles mentioned above. Only the core components are presented here, and adjustments may be made for actual implementation.

Solidity
function crossChainTransfer(uint256 _toChainId, address _token, uint256 _amount, address _receiver) external payable {
  address target = targets[_toChainId];
  require(target != address(0), "Invalid target"); 

 IERC20(_token).transferFrom(msg.sender, address(this), _amount);
  bytes memory data;
  // Burn cross-chained assets.
  if(_isCrossedAsset(_token)) {
    // Cross-chained assets can only be transferred to their original chains.
    require(sourceChainId(_token) == _toChainId, "Invalid target Chain");
    IERC20(_token).burn(address(this), _amount);
    address sourceToken = sourceTokens[_token];
    string memory name = IERC20(sourceToken).name();
    string memory symbol = IERC20(sourceToken).symbol();
    data = _encodeReleaseData(sourceToken, name, symbol, _amount, _receiver);
  } else if(_isNativeAsset(_token)) {
    // Stake native assets and mint cross-chained assets 
    data = _encodeMintData(_token, _amount, _receiver);
  } else {
    revert("Invalid WNFT");
  }
  
  IMOSV3.MessageData mdata = IMOSV3.MessageData(false,IMOSV3.MessageType.CALLDATA,target,data,500000,0);
  (uint256 amount,address receiverAddress) = IMOSV3(mos).getMessageFee(_tochainId,address(0),500000);
  
  require(
    IMOSV3(mos).transferOut{value:amount}(
      _tochainId,
      mDataBytes,
      address(0)
    ),
    "send request failed"
  );
}

function mintCrossChainAssets(uint256 _fromChain, uint256 _toChain, bytes calldata _fromAddress, bytes32 _orderId, bytes calldata _message) external {
  bool isExecute = IMOSV3(mos).callerList(address(this),_fromChain,_fromAddress);
  require(isExecute,"Do not have execute permission");
  require(targets[_toChainId] == _fronAddress, "Invalid sender");
  
  (address sourceToken, string name, string symbol, uint256 amount, address _receiver) = _decodeMintData(_message);
  address crossedToken = crossedTokens[sourceToken];
  // Native assets being cross-chained for the first time to cross-chained assets 
  if(crossedToken == address(0)) {
    crossedToken = new CrossedToken(
        abi.encodePacked('Crossed ', name),
        abi.encodePacked('c',symbol);
    );
    // Bonding the info of native assets and cross-chained assets
    sourceTokens[crossedToken] = sourceToken;
    sourceChainId[crossedToken] = _fronChain;
    crossedTokens[sourceToken] = crossedToken;
  }
  IERC20(crossedToken).mint(receiver, amount);
}

function releaseNativeAsset(uint256 _fromChain, uint256 _toChain, bytes calldata _fromAddress, bytes32 _orderId, bytes calldata _message) external {
  bool isExecute = IMOSV3(mos).callerList(address(this),_fromChain,_fromAddress);
  require(isExecute,"Do not have execute permission");
  require(targets[_toChainId] == _fronAddress, "Invalid sender");
  
  (address token, uint256 amount, address receiver) =  _decodeReleaseData(_message);
  IERC20(token).transfer(receiver, amount);
}

5.2. Schedule
5.2.1. Study and Test the Map Protocol Document
Duration: 3 days (completed)

5.2.2. Overall Design of the Cross-Chain Solution
Duration: 2 days (completed)

5.2.3. Integration of Litra and Mapprotocol Protocol at the Contract Level
Duration: 7 days

5.2.4. Modification of Litra Front-end to Add Cross-Chain wNFT Display
Duration: 20 days

5.2.5 Deploy Litra on Two Blockchain Mainnets and the Forked ApeStaking
Duration: 7 days

5.2.6. Connect and Debug the Mapprotocol Protocol on the Deployed Blockchains
Duration: 7 days

Total Duration: 46 days

6. Flowchart

7. Team and Contacts
Litra’s core team is made up of highly qualified individuals who have graduated from top universities around the world and have extensive work experience at leading international corporations. All the members have a proven track record of success in various well-known public chains, decentralized exchanges (DEXes), and NFT projects. Additionally, the team possesses strong technical skills in terms of creating innovative models and iterating upon existing technology.

Telegram handle: @Jason_CL