Skip to content

Commit

Permalink
added membrane destination projects
Browse files Browse the repository at this point in the history
  • Loading branch information
kakucodes committed Mar 25, 2024
1 parent df89404 commit bc00586
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 9 deletions.
48 changes: 40 additions & 8 deletions packages/osmosis-destinations/src/comp_prefs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,25 @@ pub enum OsmosisDestinationProject {
// DaoDaoStake {
// dao: OsmosisDao,
// },

/// Stake as MBRN
MembraneStake {},
// MembraneDeposit {
// position_id: Uint128,
// asset: String,
// },
// MembraneRepay {
// asset: String,
// ltv_ratio_threshold: Decimal,
// },

/// Deposit asset(s) into the CDP
MembraneDepositCollateral {
position_id: Uint128,
/// optionally swap the input asset(s) to the desired asset before depositing
as_asset: Option<String>,
and_then: Option<MembraneDepositCollateralAction>,
},

/// Swap for CDT and repay debt
MembraneRepay {
/// repayment conditional based on the ltv ratio
/// if None then repay the debt regardless of the ltv ratio
/// if the repay threshold is hit the WHOLE compounding amount will be used to repay the debt
ltv_ratio_threshold: Option<RepayThreshold>,
},
// MarginedRepay {
// asset: String,
// ltv_ratio_threshold: Decimal,
Expand Down Expand Up @@ -158,6 +168,28 @@ pub enum OsmosisDestinationProject {
Unallocated {},
}

#[cw_serde]
pub enum MembraneDepositCollateralAction {
/// mint cdt up to the desired_ltv then leave it liquid
MintCDT { desired_ltv: Decimal },

/// Mint CDT and deposit it into the stability pool contract
EnterStabilityPool { desired_ltv: Decimal },

/// Mint CDT and enter an osmosis pool single sided
ProvideLiquidity {
desired_ltv: Decimal,
pool_id: u64,
pool_settings: OsmosisPoolSettings,
},
}

#[cw_serde]
pub struct RepayThreshold {
ltv_ratio: Decimal,
otherwise: OsmosisDestinationProject,
}

#[cw_serde]
pub enum KnownPairedPoolAsset {
OSMO,
Expand Down
2 changes: 1 addition & 1 deletion packages/osmosis-destinations/src/grants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub fn membrane_stake_grant(
)]
}

pub fn membrane_deposit_into_stability_ool_grant(
pub fn membrane_deposit_into_stability_pool_grant(
base: GrantBase,
contract_addr: Addr,
cdt_denom: &str,
Expand Down

0 comments on commit bc00586

Please sign in to comment.