Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magic number #433

Merged
merged 13 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/web/components/Forms/PoolForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ export function PoolForm({ token, communityAddr }: Props) {
minimumConviction = minimumConviction / 100;

const maxRatioNum = spendingLimit / MAX_RATIO_CONSTANT;
const maxRatioNum2 = spendingLimit / (1 - Math.sqrt(minimumConviction));

const weightNum = minimumConviction * maxRatioNum ** 2;

Expand Down
8 changes: 7 additions & 1 deletion apps/web/components/PoolHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,13 @@ export default function PoolHeader({
strategy.config.minThresholdPoints,
+token.decimals,
);
const spendingLimit = spendingLimitPct * MAX_RATIO_CONSTANT;

//const spendingLimit = spendingLimitPct * MAX_RATIO_CONSTANT;
const spendingLimit =
(strategy.config.maxRatio / CV_SCALE_PRECISION) *
(1 - Math.sqrt(minimumConviction / 100)) *
100;

const communityAddr = strategy.registryCommunity.id as Address;
const defaultResolution = arbitrableConfig.defaultRuling;
const proposalCollateral = arbitrableConfig.submitterCollateralAmount;
Expand Down
Loading