Skip to content

Commit 11dfea7

Browse files
committed
chore(portfolio-contract): Improve "toUSDN" comments
Ref Agoric/agoric-private#433
1 parent 0610edb commit 11dfea7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/portfolio-contract/tools/plan-solve.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,9 +446,12 @@ export const rebalanceMinCostFlowSteps = async (
446446
break;
447447
}
448448
case 'toUSDN': {
449-
// NOTE USDN transfer incurs a fee on output amount in basis points
450-
// HACK of subtract 1n in order to avoid rounding errors in Noble
451-
// See https://github.com/Agoric/agoric-private/issues/415
449+
// USDN transfer imposes a "haircut" fee on the *amount*.
450+
// Expose the post-fee net output as `detail.usdnOut`.
451+
// TODO: Apply this in both directions per
452+
// https://github.com/Agoric/agoric-private/issues/433
453+
// HACK: subtract 1n to avoid rounding errors in Noble per
454+
// https://github.com/Agoric/agoric-private/issues/415
452455
const usdnOut =
453456
(BigInt(flow) * (10000n - BigInt(edge.variableFee))) / 10000n - 1n;
454457
details = { detail: { usdnOut } };

0 commit comments

Comments
 (0)