Skip to content

Commit

Permalink
Remove leftover instances of FACTOR_LPT from 3-asset interface
Browse files Browse the repository at this point in the history
  • Loading branch information
rockbmb committed Apr 25, 2024
1 parent 501489f commit 2ebf23d
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions ramm-sui/sources/interface3.move
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ module ramm_sui::interface3 {

const THREE: u8 = 3;

/// Amounts of LP tokens are considered to have 9 decimal places.
///
/// Sui Move does not allow the export of `const`s, so this is a redefinition from `ramm.move`.
///
/// This `const` factor is used when performing calculations with LP tokens.
const FACTOR_LPT: u256 = 1_000_000_000_000 / 1_000_000_000; // FACTOR_LPT = 10**(PRECISION_DECIMAL_PLACES-LP_TOKENS_DECIMAL_PLACES)

const ERAMMInvalidSize: u64 = 0;
const EDepositsDisabled: u64 = 1;
const EInvalidDeposit: u64 = 2;
Expand Down Expand Up @@ -826,11 +819,11 @@ module ramm_sui::interface3 {
*lpt_amount =
ramm::div(
ramm::mul(
lpt_u256 * FACTOR_LPT,
lpt_u256 * factor_o,
(ramm::value(&withdrawal_output) - ramm::remaining(&withdrawal_output)) * factor_o
),
ramm::value(&withdrawal_output) * factor_o
) / FACTOR_LPT;
) / factor_o;
};

let burn_amount: u64 = (*lpt_amount as u64);
Expand Down

0 comments on commit 2ebf23d

Please sign in to comment.