{"id":13407783,"url":"https://github.com/multiversx/mx-metabonding-sc","last_synced_at":"2025-10-06T14:05:13.375Z","repository":{"id":38305665,"uuid":"462237202","full_name":"multiversx/mx-metabonding-sc","owner":"multiversx","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-07T17:31:21.000Z","size":1017,"stargazers_count":1,"open_issues_count":4,"forks_count":2,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-07-07T18:49:56.154Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/multiversx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-02-22T10:02:13.000Z","updated_at":"2025-06-04T13:14:48.000Z","dependencies_parsed_at":"2023-02-12T18:01:01.992Z","dependency_job_id":"976aefd2-bcd5-402d-b0a2-b4f2a572c679","html_url":"https://github.com/multiversx/mx-metabonding-sc","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/multiversx/mx-metabonding-sc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiversx%2Fmx-metabonding-sc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiversx%2Fmx-metabonding-sc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiversx%2Fmx-metabonding-sc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiversx%2Fmx-metabonding-sc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/multiversx","download_url":"https://codeload.github.com/multiversx/mx-metabonding-sc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiversx%2Fmx-metabonding-sc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278621844,"owners_count":26017253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T20:00:48.616Z","updated_at":"2025-10-06T14:05:13.346Z","avatar_url":"https://github.com/multiversx.png","language":"Rust","funding_links":[],"categories":["MultiversX official"],"sub_categories":["Smart contracts"],"readme":"# Metabonding\n\n## Introduction\n\nThe metabonding smart contract is meant to give additional incentives to users to stake their tokens, specifically EGLD and LKMEX (Locked MEX). Each user that has some tokens staked will receive rewards based on how much they contribute to the specific staking pool.\n\nThis can act as either a launchpad for new projects, or just as an additional reward pool for stakers.\n\n## Adding projects\n\nProjects can only be added by the contract owner. Each project has:\n- a unique ID of maximum 10 characters (bytes)\n- an owner - will receive any leftover tokens once the project is cleared\n- a reward token\n- a total reward token supply\n- a start week\n- a duration in weeks\n- a percentage of how much of the rewards is distributed to LKMEX stakers (the rest will be distributed to EGLD stakers)\n\nProjects can also be removed by the owner if deemed necessary. All leftover funds will be returned to the project owner in such a scenario.\n\nA project is not considered \"active\" until all reward tokens have been deposited.\n\n## Rewards distribution\n\nRewards are distributed on a weekly basis. For example, if a project has a 4 week duration, then 25% of the rewards will be distributed each week. From this 25%, a part will be distributed to EGLD stakers, and a part to LKMEX stakers. This depends on the percentage given at the project's initialization. \n\nThe owner will add weekly checkpoints, which will describe the total staking pool for both EGLD and LKMEX.\n\nDistribution is not done automatically. Each user will have to claim their own rewards. They can do so until the project is expired, which is currently set to one week after its end.\n\nSince the metabonding SC does not have access to the staking pool's information, it will receive these informations from the users when they claim. These are checked against a signature provided by the owner (or another designated signer address). The current implementation works like this:\n\n- owner checks the staking pools, and gets the total amounts, then creates the checkpoint for the current week with those values\n- owner checks the specific values for users, then the signature is given by `sign_ed25519(week_number + user_address + user_egld_staked_amount + user_lkmex_staked_amount)`. This is signed using the `signer`'s secret key\n- the user claims rewards, by giving the week number, user_egld_staked_amount, user_lkmex_staked_amount and the signature as arguments. \n- the metabonding SC verifies the signature, and gives the user their share of the rewards\n- the SC marks the rewards as claimed for the given week for the current user\n\n## Rewards formula\n\nThe weekly reward formula is as follows:\n\nNote: Percentages are considered to be in range [0, 100] in this example.  \n\ntotal_weekly_reward = project_reward_supply / project_duration_weeks \nweekly_reward_lkmex = total_weekly_reward * lkmex_reward_percentage / 100  \nweekly_reward_egld = total_weekly_reward - weekly_reward_lkmex  \n\nuser_weekly_reward_for_lkmex = weekly_reward_lkmex * user_lkmex_staked / total_lkmex_staked  \nuser_weekly_reward_for_egld = weekly_reward_egld * user_egld_staked / total_egld_staked\n\nuser_weekly_reward = user_weekly_reward_for_lkmex + user_weekly_reward_for_egld\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiversx%2Fmx-metabonding-sc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultiversx%2Fmx-metabonding-sc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiversx%2Fmx-metabonding-sc/lists"}