subtensor icon indicating copy to clipboard operation
subtensor copied to clipboard

Feat/subnet leasing

Open l0r1s opened this issue 6 months ago • 2 comments

Description

Add the subnet leasing feature that can be used as the call passed to a crowdloan.

This enables each contributor of a crowdloan to become a shareholder of a subnet for a finite or infinite number of blocks, hence receiving a part of the subnet owner's cut when they are distributed, directly to their cold keys.

The distribution is done on each block if the subnet is leased and if there is enough liquidity in the subnet pool, if there is not enough liquidity, the dividends to the lease are accumulated for later distribution.

When the lease has passed his end block, the lease can be terminated by the beneficiary (the crowdloan creator that will target this call) to transfer the ownership of the subnet from the lease to himself.

Related Issue(s)

  • Closes #[issue number]

Type of Change

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [X] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Documentation update
  • [ ] Other (please describe):

Breaking Change

If this PR introduces a breaking change, please provide a detailed description of the impact and the migration path for existing applications.

Checklist

  • [X] I have performed a self-review of my own code
  • [X] I have commented my code, particularly in hard-to-understand areas
  • [x] I have run cargo fmt and cargo clippy to ensure my code is formatted and linted correctly
  • [x] I have made corresponding changes to the documentation
  • [x] My changes generate no new warnings
  • [X] I have added tests that prove my fix is effective or that my feature works
  • [X] New and existing unit tests pass locally with my changes
  • [X] Any dependent changes have been merged and published in downstream modules

Screenshots (if applicable)

Please include any relevant screenshots or GIFs that demonstrate the changes made.

Additional Notes

Please provide any additional information or context that may be helpful for reviewers.

l0r1s avatar Apr 30 '25 16:04 l0r1s