Skip to content

Incentive redemption#48

Open
iboss-ptk wants to merge 2 commits intomainfrom
boss/redeem-incentive
Open

Incentive redemption#48
iboss-ptk wants to merge 2 commits intomainfrom
boss/redeem-incentive

Conversation

@iboss-ptk
Copy link
Copy Markdown
Contributor

@iboss-ptk iboss-ptk commented Jul 25, 2025

Closes CHAIN-1062

depends on #47

Comment on lines +12 to +13
const MAX_LIMIT: u32 = 30;
const DEFAULT_LIMIT: u32 = 10;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to specify PAGINATION_ as prefix

Ok(Some(ratios))
}

pub fn std_norm_factor(&self) -> Result<Uint128, ContractError> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets add some of the code docs in readme to here

.collect()
}

pub(crate) fn normalized_total_balance(&self) -> Result<Uint128, ContractError> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets add a code comment as example (1nBTC, 5 WBTC => 6 Total when fixing precision)

@@ -58,32 +65,116 @@ impl Transmuter {
mut deps: DepsMut,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we just get a code comment for this function of "e.g. nBTC -> Alloy BTC"

let out_amount_before_fee = swap_to_alloyed::out_amount_via_exact_in(
tokens_in_with_norm_factor,
token_out_min_amount,
self.alloyed_asset.get_normalization_factor(deps.storage)?,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this arg should be alloyed_norm_factor?


let run_pool = |_deps: Deps, mut pool: TransmuterPool| {
pool.join_pool(&tokens_in)?;
let token_out = coin(out_amount_before_fee.u128(), alloyed_denom.clone());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets comment that were not checking min_out_amount because we check later stage? This may become more obvious as we get more complexity absracted into functions. E.g. even this run pool code line

@iboss-ptk iboss-ptk force-pushed the boss/redeem-incentive branch from 8e91de8 to 8ebc9ae Compare July 31, 2025 11:02
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

Successfully merging this pull request may close these issues.

2 participants