bittensor
bittensor copied to clipboard
Integrate Liquidity Provider feature
Is your feature request related to a problem? Please describe.
As a user I would like to have the liquidity providing feature so that I can provide more TAO for (a) making additional (potentially risk-free) income, and (b) making subnet prices more stable.
Describe the solution you'd like
The LP feature is being added in Subtensor and the current WIP can be see in this branch: https://github.com/opentensor/subtensor/tree/feat/uniswapv3-lp
The new feature allows users to provide liquidity to the Subnet swap pool and accrue fees while other users stake and unstake.
While the staking extrinsics all stay backward compatible (no changes are made to the interface), two new extrinsics and a few state maps are added:
-
add_liquidityandremove_liquidityare the extrinsics that allow adding/removing a liquidity position. The liquidity position is defined by the price range (tick_low and tick_high) and liquidity amount, which translates into TAO, Alpha, or a combination of TAO + Alpha depending on the current price and it's relative position to the position liquidity range. A UI example of adding a position can be found here. -
New maps
Positions,Ticks,FeeGlobalTao, andFeeGlobalAlphastore user positions, initialized price ticks, and fee information.
Describe alternatives you've considered
No response
Additional context
No response