Skip to content

Improve btcli liquidity add logic #532

@basfroman

Description

@basfroman

We need to improve logic for adding liquidity

Steps:

1. USER: Ask for netuid

2. BTCLI: check if the SN exist

3. USER: Ask user to enter low and high position prices. (2 prompts)

4. BTCLI: does the call to the chain to fetch current SN price (based netuid)
- USER: If low price is higher or equal to the current SN price, only ask for Alpha amount to provide and the HOTKEY (Optional) to take this Alpha stake from.
- USER: If high price is lower or equal to the current SN price, only ask for TAO amount to provide (the hotkey still needs to be provided to the extrinsic, but it has no effect, so use the HOTKEY (Optional).
- USER: In all other cases ask for the HOTKEY (Optional), read how much TAO and Alpha the user has (2 MORE calls to the Chain), calculate the maximum liquidity that can be provided considering these amounts of Alpha, TAO, and the current SN price (using the liquidity formulas (already in codebase)) and display these TAO and Alpha amounts with message saying something like "This is the max amount of TAO and Alpha that can be currently provided".

5. (in case of option 3 on step 4) Allow user to enter either TAO or Alpha (or just TAO for simplicity of the interface and display how much Alpha it corresponds to). >>>Personally I disagree to provide just TAO if we already splatted previous steps.

6. BTCLI: Execute the extrinsic call

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions