8000 feat(dango): allow providing partial `PairParams` updates using `optional_struct` · Issue #501 · left-curve/left-curve · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(dango): allow providing partial PairParams updates using optional_struct #501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pacmanifold opened this issue Mar 3, 2025 · 1 comment

Comments

@pacmanifold
Copy link
Contributor

Use the optional_struct macro from optional_struct to allow for partial updates of PairParams.

#[optional_struct(PairParamsUpdates)]
#[grug::derive(Serde, Borsh)]
pub struct PairParams {
    /// Liquidity token denom of the passive liquidity pool.
    pub lp_denom: Denom,
    /// Curve invariant for the passive liquidity pool.
    pub curve_invariant: CurveInvariant,
    /// Fee rate for instant swaps in the passive liquidity pool.
    pub swap_fee_rate: Bounded<Udec128, ZeroInclusiveOneExclusive>,
}

Would allow calling for example

ExecuteMsg::BatchUpdatePairs(vec![
   PairParamsUpdates {
        lp_denom: None,
        curve_invariant: None,
        swap_fee_rate: Udec128::new_permille(5)
   }]
)
@larry0x
Copy link
Contributor
larry0x commented Mar 5, 2025

@pacmanifold It doesn't make sense to change lp_denom. Does optional_struct allow "skipping" a field such as this? If not I would prefer to manually craft a PairParamsUpdates instead of using the macro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0