Staqe Protocol - Non-castodial pools for NFT and token staking


Project Name: Staqe Protocol

Project Track: DeFi

Team Name: Decentra

Team Member(s): 1-3 @mypeaceduck

HackerEarth Project Link: https://devpost.com/software/staqe-protocol

Project Goal: To empower users by enabling them to create, manage, and stake in personalized liquidity pools for NFTs and ERC20 tokens, fostering a new level of interaction and liquidity in the DeFi ecosystem.

Project Value: Staqe Protocol introduces a significant advancement in the DeFi space by providing a platform where users have the autonomy to create their own staking conditions, enhance asset liquidity, and earn rewards in a fully decentralized, non-custodial environment. This elevates the utility of NFTs and ERC20 tokens, creating new opportunities for income and engagement within the BTTC blockchain ecosystem.

Project Info: Staqe Protocol is a decentralized, non-custodial platform that allows users to create custom pools for staking NFTs and ERC20 tokens. It utilizes BTTC smart contracts and IPFS/BTFS for secure, transparent operations and storage, offering tools for pool creation, staking, reward distribution, and metadata management.

Project Website: Staqe Protocol · GitHub

Project Test Instructions:

  1. Access the Staqe App.
  2. Connect a Web3 wallet like MetaMask to interact with the test BTTC network.
  3. Create a pool by following the on-screen instructions, including specifying ERC20 and ERC721 tokens for staking and rewards.
  4. Stake tokens or NFTs into a created pool.
  5. As a pool owner, add rewards to the pool and manage its settings.
  6. Withdraw staked assets and rewards.
  7. Review transaction history and changes in pool settings through the browser extension or dashboard.

Project Details:

  • Smart Contracts: Solidity contracts for creating and managing pools, staking, and reward distribution.
  • Frontend: React application with WAGMI integration for a dynamic, user-friendly interface.
  • IPFS/BTFS: For decentralized storage of off-chain data such as pool metadata and images.

Testnet: StaqeProtocol | Address 0x9cbd0a9d9fb8e8c1baa4687e4e8068ada57a220f | BTTCScan

Mainnet: StaqeProtocol | Address 0x67980361970aac40767187437326234c4ac4d003 | BTTCScan

Project Milestones:

  1. Q3 2024:
  • Add cross-chain pools.
  • Add a time-weighted stake.
  1. Q4 2024:
  • Refactoring the app interface.
  • Publish extensions to Chrome/FF/Edge Store.
  1. Q1 2025:
  • Audit smart contracts.
  • Deployment in the main network.
8 Likes

Welcome to hackathon season 6

The project description mentions fostering a “new level of interaction” within the DeFi ecosystem through user-created staking pools.
Can you elaborate on specific ways these pools might create new forms of interaction between users or projects, and how this could benefit the BTTC ecosystem.

5 Likes

Can you provide insights into the user experience within your platform, from creating liquidity pools to earning rewards?

7 Likes

Thanks for the question.

  • Users can design pools based on their specific needs and preferences, such as selecting the types of assets (NFTs and ERC20 tokens) to stake, the rewards mechanisms, and the conditions for withdrawal and rewards claims. This level of customization can significantly increase user engagement as it provides a personalized DeFi experience.
  • Staqe Protocol can facilitate the creation of pools that integrate different tokens from various projects within the BTTC ecosystem. This not only increases liquidity for these tokens but also encourages cross-pollination of communities, leading to a more interconnected ecosystem.
  • Projects can collaborate to create joint staking pools that support mutual growth and benefit. For example, two projects could create a pool that requires staking of both tokens (ERC20 and ERC721), potentially increasing the utility and value of both assets.
  • By allowing the creation of pools with diverse requirements and rewards, Staqe Protocol can help increase the utility and circulation of lesser-known tokens within the BTTC ecosystem. This can be particularly beneficial for new projects seeking to gain traction and visibility.
  • The decentralized and non-custodial nature of Staqe Protocol ensures that users retain control over their assets at all times, increasing trust and security within the ecosystem. The transparent operation of pools via smart contracts also enhances trust, as all transactions and changes are verifiable on the blockchain.
  • In the Staqe Protocol, NFTs can be designed not only as collectibles or investment assets but also as access keys to exclusive functionalities within other smart contracts. For instance, owning and staking a particular NFT could grant the user the ability to create their own liquidity pools or access advanced features in another project integrated within the BTTC ecosystem.
  • Projects can launch new products or services by creating specialized staking pools where tokens are sold or distributed as part of the staking process. Participants can stake BTTC tokens to receive new project tokens, which might represent a stake in the project’s success, governance rights, or a share of future revenues.
  • … =)
1 Like

Thanks for the question.

1. User Onboarding and Wallet Integration

When users first visit the Staqe Protocol platform, they are prompted to connect their digital wallet (e.g., MetaMask). This step is essential for interacting with the blockchain, managing assets, and ensuring transactions are secure and personalized.

2. Creating a Liquidity Pool

Pool Configuration:

  • Access: Users must first stake a Genesis NFT to create a pool, reinforcing the platform’s community and value.
  • Setting Parameters: Users can configure various aspects of the liquidity pool:
    • Stakable Assets: Choose which NFTs and/or ERC20 tokens can be staked.
    • Reward Tokens: Select the type of ERC20 tokens to be distributed as rewards.

Metadata Management:

  • Users can upload metadata for the pool to IPFS/BTFS, which might include descriptions, logos, and images. This data ensures transparency and appeal in pool listings.

Deployment:

  • Once all settings are confirmed, the user can deploy the pool. This process involves interacting with smart contracts and may require transaction confirmation via their connected wallet.

3. Staking in Pools

Users can browse available pools on the platform and select one that matches their interest or investment strategy. Staking involves transferring NFTs or tokens into the pool’s contract, which is handled securely through their wallet interface. Users will see a confirmation once their assets are staked.

4. Monitoring and Managing Pools

Pool creators can monitor their pools through a dedicated dashboard that displays:

  • Staking Activity: Overview of current stakers and staked assets.
  • Rewards Distribution: Track how rewards are allocated and claimable.

Browser Extension

For Pool Creators:

  1. Real-Time Monitoring:

    • The extension can provide real-time data on the pool’s activity, such as the number of active stakers, total staked assets, and recent transactions. This allows pool creators to quickly assess the health and popularity of their pools.
  2. Notification System: (Upcoming Feature)

    • Creators can receive notifications for important events, such as when new stakes are made, when rewards are claimed, or if the staking conditions are met for adding new rewards. This ensures that they stay informed and can react promptly to changes or opportunities.
  3. Management Tools: (Upcoming Feature)

    • Direct management tools within the extension allow for convenient adjustments to the pool without needing to visit the main platform. This could include adding rewards, updating pool metadata, or modifying staking requirements.

For Stakers:

  1. Dashboard Overview:

    • A personalized dashboard in the extension shows all pools in which the user has stakes, including detailed information on their staked assets, accumulated rewards, and any upcoming reward opportunities.
  2. Claims and Alerts: (Upcoming Feature)

    • Users can claim their rewards directly through the extension. They can also set up alerts for when rewards are distributed or when certain staking thresholds are reached in any of the pools they are involved in.
  3. Exploration and Recommendations: (Upcoming Feature)

    • The extension can suggest new pools based on the user’s previous staking habits and preferences, facilitating discovery of new investment opportunities within the Staqe ecosystem.

4. Adding Rewards:

If there are active stakers, the pool owner can add additional rewards to incentivize further participation or reward loyal stakers. This involves transferring ERC20 tokens into the pool’s reward contract.

5. Claiming Rewards

Stakers can claim their rewards based on the pool’s distribution rules. This might involve interacting with the smart contract through the platform, which will handle the calculation and distribution of rewards owed to each staker.

6. Withdrawal of Stakes

Stakers can withdraw their assets at any time, assuming there are no lock-up periods currently in effect. The withdrawal process is initiated through the platform, and the assets are returned to the user’s wallet.

2 Likes

You are welcome
Wish you and your team all the best

4 Likes

Thank you for this detailed explanation. What are the measures in place to ensure transparency and fairness in the operation of personalized liquidity pools within the Staqe Protocol platform?

4 Likes

Thank you for your question.
Transparency and fairness is the responsibility of the math :sweat_smile:

1 Like

NEW :tada:: Our goal was to create a protocol that supports staking for ERC20 and ERC721 tokens and allows users to receive rewards on any EVM-compatible network, leveraging Chainlink’s Cross-Chain Interoperability Protocol (CCIP).

how the staker would earn staking rewards in nft I dont get it ? or what type of reward you talking about? Can u explain me more in detail!

1 Like

Thank you for your question.

For example, a service gives individual access in a contract only to the stakers of its NFT (this is how Staqe Protocol works, only Genesis NFT stakers have the ability to create their own pools).

import "@staqeprotocol/v1-core/contracts/Staqe.sol";

contract MyContract {
    Staqe staqe = Staqe(0x9cbd0a9d9fb8e8c1baa4687e4e8068ada57a220f);
    uint256 public poolId = 123;

    function privateAccess() public {
        if (isActiveStaker(msg.sender)) {
            // Access granted. 
        }
    }

    function isActiveStaker(
        address staker
    ) internal view returns (bool) {
        Staqe.Pool memory pool = staqe.getPool(poolId);
        Staqe.Stake[] memory stakes = staqe.getStakes(staker, poolId);

        if (pool.totalStakedERC721 <= 0) return false;

        for (uint256 i = 0; i < stakes.length; i++) {
            if (stakes[i].unstakeBlock <= 0) return true;
        }

        return false;
    }
}

NFTs are sold, the service gets a commission (like Uniswap, 1inch and others) and can distribute the profit among the stakers. If a project has issued its own token, it can distribute the tokens fairly among the NFT stakers.

ok cool ! great explanation got it!

1 Like

Interesting project, keep building!

1 Like

:eyes:

:green_heart: Each pool, is an ERC721 standard NFT, so it can be sold and transferred to other users.

To be added to Metamask :fox_face::

  • Copy the protocol address :hedgehog:
  • Import the new NFT into Metamask :fox_face:
  • Enter the protocol address :house: 0x9cbd0a9d9fb8e8c1baa4687e4e8068ada57a220f
  • Enter your pool number :1234: 1,2,3,4,5,...
  • Voila :tada::tada::tada:

hhh

:level_slider:

:vulcan_salute: Added switching of test network and main network.

1 Like

ext

:dart:

  • :metal: Added mainnet to extensions
2 Likes

Screen

:man_superhero:

:dog: Dark theme for Chrome/Firefox/Edge extension.

withdraw

:memo: The pool page now allows the administrator to see the balance of sold tokens and NFTs that users used for staking.
:money_with_wings: It is possible to withdraw the balance of earned funds to the wallet of the token creator.

1 Like

Hey, i wanna try using your project but reliability does it guarantee?
Are you going to keep live and for how long?

1 Like

Hi, thanks for your questions.

Protocol is non-custodial, meaning you retain full ownership of your pool once it is created. You can withdraw all collected funds from token sales and NFTs used for staking. Additionally, you have the flexibility to customize multiple tokens for rewards, pay out rewards to stakers multiple times, and set the timeframe for when rewards can be claimed. You can also customize all graphics and more.

The project has been rigorously tested main functions with a 100% success rate, although it has not yet undergone an external audit.

| File                                   | % Lines          | % Statements     | % Branches      | % Funcs        |
|----------------------------------------|------------------|------------------|-----------------|----------------|
| contracts/Staqe.sol                    | 86.74% (157/181) | 86.51% (218/252) | 62.04% (67/108) | 95.00% (19/20) |
| contracts/StaqeProtocol.sol            | 100.00% (0/0)    | 100.00% (0/0)    | 100.00% (0/0)   | 0.00% (0/1)    |
| contracts/extensions/StaqeDetails.sol  | 100.00% (18/18)  | 97.22% (35/36)   | 100.00% (4/4)   | 100.00% (4/4)  |
| contracts/extensions/StaqePermit.sol   | 100.00% (4/4)    | 100.00% (4/4)    | 100.00% (0/0)   | 100.00% (2/2)  |
| contracts/interfaces/IStaqeERC7572.sol | 100.00% (3/3)    | 100.00% (3/3)    | 100.00% (0/0)   | 100.00% (2/2)  |

Feel free to reach out if you encounter any issues or need assistance with the Staqe Protocol.

1 Like