Skip to content

Conversation

@LuqiPan
Copy link
Contributor

@LuqiPan LuqiPan commented Nov 12, 2025

closes: https://github.com/Agoric/agoric-private/issues/541

Description

Currently the default fee for smart wallet tx is 0.5 BLD, while in practice 0.015 BLD should be enough. This PR adjusts this parameter

Security Considerations

N/A

Scaling Considerations

This should reduce the rate at which planner is spending fees

Documentation Considerations

N/A

Testing Considerations

Updated unit tests

Upgrade Considerations

This should not impact upgrading

@LuqiPan LuqiPan requested review from Copilot, dckc and turadg November 12, 2025 17:52
Copilot finished reviewing on behalf of LuqiPan November 12, 2025 17:53
Copy link
Member

@dckc dckc left a comment

Choose a reason for hiding this comment

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

I suggest changing ymax-planner, not client-utils

// TODO parameterize as part of https://github.com/Agoric/agoric-sdk/issues/5912
const defaultFee: StdFee = {
amount: [{ denom: 'ubld', amount: '500000' }], // XXX enough?
amount: [{ denom: 'ubld', amount: '15000' }], // XXX enough?
Copy link
Member

Choose a reason for hiding this comment

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

I'm afraid this breaks other clients.

I suggest that the planner should pass in an explicit fee rather than using the default.

Copy link
Member

@turadg turadg left a comment

Choose a reason for hiding this comment

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

The issue is about the planner, not the default. Are we sure we want to change the default?

// TODO parameterize as part of https://github.com/Agoric/agoric-sdk/issues/5912
const defaultFee: StdFee = {
amount: [{ denom: 'ubld', amount: '500000' }], // XXX enough?
amount: [{ denom: 'ubld', amount: '15000' }], // XXX enough?
Copy link
Member

Choose a reason for hiding this comment

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

This PR should only lower it to an amount that is enough.

Suggested change
amount: [{ denom: 'ubld', amount: '15000' }], // XXX enough?
amount: [{ denom: 'ubld', amount: '15000' }],

: never;
};

// TODO parameterize as part of https://github.com/Agoric/agoric-sdk/issues/5912
Copy link
Member

Choose a reason for hiding this comment

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

drive-by but this comment is obsolete

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reduces the default transaction fee for smart wallet operations from 0.5 BLD to 0.015 BLD, addressing the issue that the current fee is higher than necessary for practical use.

  • Updated the default fee constant in the signing smart wallet kit
  • Adjusted test expectations to match the new fee value

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/client-utils/src/signing-smart-wallet-kit.ts Updated defaultFee amount from 500000 ubld (0.5 BLD) to 15000 ubld (0.015 BLD)
packages/client-utils/test/signing-smart-wallet-kit.test.ts Updated test assertions to expect the new fee value of 15000 ubld in two test cases

@LuqiPan LuqiPan force-pushed the 541-update-planner-fees branch from b0ab9e9 to 240ada4 Compare November 12, 2025 21:25
@LuqiPan LuqiPan requested a review from gibson042 November 12, 2025 21:26
@LuqiPan LuqiPan force-pushed the 541-update-planner-fees branch from 7e92f98 to e54275b Compare November 14, 2025 16:16
});

const result = await signingSmartWalletKit.executeOffer(action);
const result = await signingSmartWalletKit.executeOffer(action, smartWalletFee);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

question

I only found the place where we're using executeOffer in resolver, but I was not able to find where we're using executeOffer under services/ymax-planner folder

Copy link
Member

Choose a reason for hiding this comment

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

ymax-planner uses invokeEntry, wrapped in reflectWalletStore:

const planner = walletStore.get<PortfolioPlanner>('planner', {
sendOnly: true,
});
const { tx, id } = await planner.resolvePlan(
portfolioId,
flowId,
steps,
policyVersion,
rebalanceCount,
);

The fee could either be passed in to reflectWalletStore:

const walletStore = reflectWalletStore(signingSmartWalletKit, {
setTimeout,
makeNonce: () => new Date(now()).toISOString(),
});

Or another idea would be to add a signingSmartWalletKit.withFee(fee) method, much like cmdRunner.withEnv(...)

withEnv: env =>

Copy link
Member

Choose a reason for hiding this comment

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

@LuqiPan I pushed a couple of commits; f6d30c8 extending wallet store reflection to support specifying a fee and f92e699 taking advantage of it in ymax-planner (but limited the extension to just fee while @dckc and I work out #12055 (comment) ). But feel free to tweak further as needed.

proposal?: object;
};

const smartWalletFee: StdFee = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

question

Is there a better file to put this constant in so both planner and resolver can use it?

Copy link
Member

Choose a reason for hiding this comment

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

I expect the planner and resolver to become less integrated, not more. So this is fine.

@LuqiPan LuqiPan requested a review from gibson042 November 14, 2025 16:19
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.

5 participants