bittensor icon indicating copy to clipboard operation
bittensor copied to clipboard

Integrate Liquidity Provider feature

Open gztensor opened this issue 6 months ago • 0 comments

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:

  1. add_liquidity and remove_liquidity are 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.

  2. New maps Positions, Ticks, FeeGlobalTao, and FeeGlobalAlpha store user positions, initialized price ticks, and fee information.

Describe alternatives you've considered

No response

Additional context

No response

gztensor avatar Apr 21 '25 21:04 gztensor