Skip to content

Commit

Permalink
Merge pull request #42 from SundaeSwap-finance/rrruko/update-benchmark
Browse files Browse the repository at this point in the history
update benchmark
  • Loading branch information
Quantumplation authored Jan 26, 2024
2 parents cdb82cb + e30677f commit a6d4410
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 5 additions & 3 deletions lucid/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,14 @@ function settingsDatum(poolStakeHash: string, userPkh: string): string {
userPkh,
],
authorizedStakingKeys: [
poolStakeHash,
{
VKeyCredential: { bytes: poolStakeHash },
}
],
baseFee: 1000000n,
simpleFee: 100000n,
strategyFee: 200000n,
poolCreationFee: 0n,
extensions: 0n,
};
return Data.to(datum, types.SettingsDatum);
Expand Down Expand Up @@ -783,11 +786,10 @@ async function scoopPool(scripts: Scripts, lucid: Lucid, userAddress: Address, s
const indexingSet = computeIndexingSet(scripts, changeUtxo, targetPool, orderUtxos);
console.log("indexingSet: ");
console.log(indexingSet);
const amortizedBaseFee = protocolBaseFee / ordersCount;
const amortizedBaseFee = (protocolBaseFee + ordersCount - 1n) / ordersCount;
const scoopPoolRedeemer: types.PoolRedeemer = {
signatoryIndex: 0n,
scooperIndex: 0n,
amortizedBaseFee: amortizedBaseFee,
inputOrder: indexingSet,
};
let redeemerData = Data.to(scoopPoolRedeemer, types.PoolRedeemer);
Expand Down
5 changes: 2 additions & 3 deletions lucid/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,11 @@ export const SettingsDatumSchema = Data.Object({
treasuryAddress: AddressSchema,
treasuryAllowance: Data.Array(Data.Integer()),
authorizedScoopers: Data.Nullable(Data.Array(Data.Bytes())),
authorizedStakingKeys: Data.Array(Data.Bytes()),
authorizedStakingKeys: Data.Array(CredentialSchema),
baseFee: Data.Integer(),
simpleFee: Data.Integer(),
strategyFee: Data.Integer(),
poolCreationFee: Data.Integer(),
extensions: Data.Integer(),
});
export type SettingsDatum = Data.Static<typeof SettingsDatumSchema>;
Expand Down Expand Up @@ -191,7 +192,6 @@ export const PoolSpendRedeemerSchema = Data.Enum([
PoolScoop: Data.Object({
signatoryIndex: Data.Integer(),
scooperIndex: Data.Integer(),
amortizedBaseFee: Data.Integer(),
inputOrder: Data.Map(Data.Integer(), Data.Nullable(SignedStrategyExecutionSchema)),
}),
}),
Expand All @@ -214,7 +214,6 @@ export const examplePoolRedeemer = {
Spend: {
signatoryIndex: 0n,
scooperIndex: 0n,
amortizedBaseFee: 10000n,
inputOrder: [
[
1n,
Expand Down

0 comments on commit a6d4410

Please sign in to comment.