Published on

Nectar Points System Documentation

Authors

The Nectar Points System is designed to incentivize users on the Clynto DeFi platform by rewarding them for various activities, including loan transactions, staking, governance participation, referrals, and community engagement. Points are earned off-chain and can be claimed and redeemed on-chain, providing users with tangible benefits such as fee reductions and access to premium features.

This document outlines the technical details for implementing the Nectar Points System, including its integration with smart contracts, the structure of the points system, and the redemption process.

Key Components

1. Points Earning (Off-Chain)

Users earn Nectar points through various off-chain activities. These points are tracked by backend services that monitor user activities and calculate the corresponding rewards.

Eligible Activities:

  • Loan Transactions: Taking out loans, repaying loans early, and providing liquidity.
  • Collateralizing CLYs: Using CLYs as a collateral on a loan
  • Staking: Staking CLY tokens and participating in staking pools.
  • Governance Participation: Voting on proposals and submitting governance proposals.
  • Referrals: Successful referrals that lead to new user sign-ups and active participation.
  • Community Engagement: Participation in events and contributions to community discussions.
Eligible ActivityPoints Earned
Loan Transactions
- Taking out a loan30 points for minimum 1000 USDC loan
- Repaying a loan early30 points
- Providing liquidity to borrower pools20 points per 1% liquidity provided (% of lender contribution to the borrower’s pool)
- Collateralizing CLYs100 points for each 5000 CLYs used as collateral
Staking
- Staking native tokens20 points per 1000 tokens staked
Governance Participation
- Voting on governance proposals20 points per vote
- Governance accepts a governance proposal1000 points per accepted proposal
Referrals
- Successful referral (new user sign-up) (refer a friend and earn 50)50 points per referral (after 1st activity)
- Active participation by referred user (join a friend’s invite and earn 50)50 points (after 1st activity)
- Successful 15 referrals (Influencer)1000 points
Community Engagement
- Participation in platform events25 points per event
- Contributions to community discussions10 points per valid contribution

2. Claiming Points (On-Chain Minting)

Users can claim their accumulated off-chain Nectar points on-chain by interacting with smart contracts. This process involves validating the points and minting them as on-chain tokens that can be used within the platform.

Process:

  • User Initiation: Users initiate the claiming process through the Clynto platform's interface.
  • Verification:
    • The backend triggers the "Nectars smart contract" function to update the Nectar balance for the user's wallet address.
    • Only the Clynto wallet (the owner of the Nectars smart contract) is able to interact with the Nectar smart contract, ensuring that the process remains secure and controlled.

Trade-Off Considerations to drop negative impact for negative behaviors on the protocol:

  • The assumption that no user would want to mint negative points is valid, as users are unlikely to claim points that have a detrimental impact on their balance. However, by focusing solely on rewarding positive activities, the platform can drive user engagement, even if it sacrifices some degree of behavior management. This approach may require supplementary measures, such as platform moderation or other penalties, to address negative actions.

Claiming Flow to ensure security and validity:

  1. User Initiates Claim Request:
    • User Action: The user decides to claim their accumulated Nectar points through the Clynto platform's interface.
    • Backend Interaction: The request is sent to the backend system for processing.
  2. Transaction Preparation:
    • Backend Process:
      • Point Verification: The backend verifies the user's off-chain point balance against the last known on-chain balance to ensure accuracy.
      • Transaction Signing: The transaction to mint new Nectar points is prepared. This transaction includes:
        • The number of points to be minted.
        • Metadata necessary for the transaction (e.g., user ID, transaction ID).
      • Secure Signing: The Clynto wallet, which is the owner of the Nectar smart contract, signs the transaction. This ensures only authorized entities can mint new points.
  3. Synchronization and Lock:
    • Balance Sync: Before minting, the system ensures the on-chain and off-chain Nectar balances are synchronized to prevent any discrepancies or double claims.
    • Claim Lock:
      • Claim Locking: Once a claim process starts, it locks the user's ability to initiate another claim until the current one is processed or canceled. This prevents multiple simultaneous claims which could lead to errors or manipulation.
      • Earning Continuation: Users can still earn Nectar points during this period, but they must wait for the claim process to complete before initiating another claim.
  4. Verification and Minting:
    • Off-chain to On-chain Verification:
      • The backend performs a final check to ensure the points being claimed match the user's off-chain record, preventing any manipulation or unauthorized minting.
    • Transaction Execution:
      • Once verified, the signed transaction is executed on the blockchain, minting the Nectar points to the user's wallet. This step is crucial for maintaining the integrity of the Nectar Points System.
  5. Post-Claim Actions:
    • Update Records: Both the off-chain database and on-chain smart contract are updated to reflect the new balance.
    • User Notification: The user is notified of the successful claim or any issues encountered during the process.

3. Redemption (On-Chain Use)

On-chain Nectar points can be redeemed by users to cover fees associated with Clynto loan contracts. This redemption process directly reduces the applicable fees for loan activities.

Process:

  • Initiating Redemption: Users select the option to use Nectar points to cover loan fees.
  • Smart Contract Interaction: The loan contract interacts with the Nectar Points contract to verify available points and apply fee reductions for:
    • Borrowers and Lenders, at the time of signing any of the loan activities listed above, latest wallet Nectar balance is used to apply some or all and reduce Clynto borrowing or lending fees.
    • For every 1000 Points
  • Fee Coverage: Points are deducted from the user's balance, and the loan contract fees are reduced accordingly.
    • every transaction requires a DB sync to match the points balance
EpicUser StoryTasks
1. Points Earning System (Off-Chain)1.1 Track User Activities1.1.1 Implement event listeners for loan transactions.
1.2 Calculate Points Based on User Activities1.2.1 Create a Nectars calculation module using the rubric suggested.
1.2.2 Integrate points calculation with the event listeners.
1.3 Store Earned Points in Database1.3.1 Design database schema for storing user Nectars.
1.3.2 Implement backend services for updating Nectars balance.
2. Points Claiming System (On-Chain Minting)2.1 Allow Users to Claim Points On-Chain2.1.1 Develop smart contract for minting Nectar points.
2.1.2 Create a user interface for initiating the claim Nectars process (mint my Nectars).
2.2 Verify Off-Chain Points Before Minting2.2.1 Implement backend verification logic.
2.2.2 Integrate backend with smart contracts to trigger the minting process.
2.3 Restrict Smart Contract Interaction2.3.1 How can we secure contract interaction by limiting to owners?
3. Points Redemption System (On-Chain Use)3.1 Allow Users to Redeem Points for Loan Fee Reduction3.1.2 Integrate with loan contract signing process.
4. User Interface and Experience4.1 Display User Points Balance4.1.1 Develop frontend components for displaying points balance.
4.1.2 Integrate with backend to fetch real-time data.
4.2 Notify Users of Points Earned and RedeemedTBD @beshoy to draft a Push notification proposal 4.2.1 Implement notification service for points updates.
4.2.2 Integrate with frontend for user alerts.
(Tests) 5. System Security and Integrity5.1 Ensure Secure Interaction with Smart Contracts5.1.1 Implement security protocols for smart contract interactions.
5.1.2 Conduct security audits on smart contracts.
5.2 Prevent Abuse of Points System5.2.1 Implement monitoring and detection of fraudulent activities.
5.2.2 Develop automated actions for abuse prevention.