Skip to content

Add execute message to provide liquidity at user specified price in the Astroport Lper #311

@uditvira

Description

@uditvira

We should modify the LPer to incorporate user-provided price information when providing liquidity to PCL pools. This can be done by separating the one provide_double_sided_liquidity message into two. One that provides liquidity at the pool ratio and one that provides liquidity at any ratio supplied by the user.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    // Provides liquidity at the pool ratio and optionally validates that the ratio is within the expected range. Typically used for XYK
    ProvideLiquidityAtPoolRatio {
        expected_pool_ratio_range: Option<DecimalRange>,
    },

    // Provides liquidity at user supplied ratio. Does not validate pool ratio. Typically used for custom pool types, like PCL
    ProvideLiquidityAtUserRatio {
        price_ratio: Decimal, // User-specified ratio
    },
    // ... other execute messages ...
}

Additionally, in the documentation, we should mention that the ProvideLiquidityAtUserRatio message should be used for PCL pools and the ProvideLiquidityAtPoolRatio for XYK pools.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions