Skip to content

Commit

Permalink
Merge pull request #56 from SundaeSwap-finance/pi/SSW-203-create-pool…
Browse files Browse the repository at this point in the history
…-fees

Resolve SSW-203
  • Loading branch information
Quantumplation authored Mar 5, 2024
2 parents bfe8e8f + 6dfccde commit c290154
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion validators/pool.ak
Original file line number Diff line number Diff line change
Expand Up @@ -434,13 +434,19 @@ validator(settings_policy_id: PolicyId) {
// - the pool identifier is set correctly
// - the assets is set correctly
// - the initial circulating supply is set correctly
// - and the market open time is before the fee finalized time; TODO: should we relax this?
// - the market open time is before the fee finalized time; TODO: should we relax this?
// I'm not sure it's harmful if someone initializes this with a feeFinalized in the past
// - the initial and final fees per 10,000 are both non-negative (>= 0%)
// - the intitial and final fees per 10,000 are both less than or equal to 10000 (<= 100%)
let pool_output_datum_correct = and {
pool_output_datum.identifier == new_pool_id,
pool_output_datum.assets == (asset_a, asset_b),
pool_output_datum.circulating_lp == initial_lq,
pool_output_datum.market_open <= pool_output_datum.fee_finalized,
pool_output_datum.fees_per_10_thousand.1st >= 0,
pool_output_datum.fees_per_10_thousand.2nd >= 0,
pool_output_datum.fees_per_10_thousand.1st <= 10000,
pool_output_datum.fees_per_10_thousand.2nd <= 10000,
}

// Make sure that the pool output is paid into own_policy_id (the pool script, remember this is a multivalidator)
Expand Down

0 comments on commit c290154

Please sign in to comment.