File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,11 +37,12 @@ validator synth_dolar(
3737 let ada_deposited = get_ada_delta (policy_id, inputs, outputs)
3838 let is_deposit_not_zero: Bool = ada_deposited >= 1
3939
40- // Collateral requirement: deposited ADA must be worth at least
41- // collateral_ratio% of the synth tokens being minted.
42- let collateralized_ada = ada_deposited * collateral_ratio / 100
40+
41+
42+ // Collateral requirement: the user can only mint a fraction of the ADA's
43+ // USD value. With collateral_ratio=150, $1.50 of ADA mints $1.00 of synth.
4344 let expected_minted_amount =
44- compute_expected_synth_amount (collateralized_ada , raw_price, exponent)
45+ compute_expected_synth_amount (ada_deposited , raw_price, exponent) * 100 / collateral_ratio
4546
4647 let is_deposit_correct: Bool = minted_amount == expected_minted_amount
4748
You can’t perform that action at this time.
0 commit comments