Skip to content

feat: implement Scale order type#2083

Merged
dankim214 merged 11 commits intomainfrom
dkim/scale-orders
Mar 11, 2026
Merged

feat: implement Scale order type#2083
dankim214 merged 11 commits intomainfrom
dkim/scale-orders

Conversation

@dankim214
Copy link
Collaborator

@dankim214 dankim214 commented Feb 23, 2026

Adds Scale order type

Screen.Recording.2026-03-09.at.10.53.42.AM.mov

@vercel
Copy link

vercel bot commented Feb 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
v4-staging Ready Ready Preview, Comment Mar 10, 2026 7:05pm
v4-testnet Ready Ready Preview, Comment Mar 10, 2026 7:05pm

Request Review

@wiz-55df730c58
Copy link

wiz-55df730c58 bot commented Feb 24, 2026

Wiz Scan Summary

⚠️ Many findings detected
Many findings were detected, but only a subset of the findings are displayed inline due to API constraints. To view all findings inline, please click here.
Scanner Findings
Vulnerability Finding Vulnerabilities 26 High 21 Medium 6 Low
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings -
Software Management Finding Software Management Findings -
Total 26 High 21 Medium 6 Low

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

),
};
});
case TradeFormType.SCALE:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can also merge this logic with case TradeFormType.LIMIT with some conditionals but claude recommends keeping this a separate code path which i can also see the merit for

@dankim214 dankim214 marked this pull request as ready for review March 9, 2026 14:56
(isShortTerm ? 0 : 1) +
(summary.tradePayload?.triggersPayloads?.filter((t) => t.placePayload != null).length ?? 0);
(summary.tradePayload?.triggersPayloads?.filter((t) => t.placePayload != null).length ?? 0) +
(summary.tradePayload?.scaleOrderPayloads?.length ?? 0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

would this result in 1 more order than actually expected?

Are all of the orders for a scaleOrder within the payload or just the ones after the initial order? Because we add a default 1 order on line 1081 here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh yes you are right

if (n < 2) return [startPrice];
// Use n-1 gap weights to create non-linearly spaced prices
const { weights } = generateGeometricWeights(n - 1, skew);
const totalGapWeight = weights.reduce((a, b) => a + b, 0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

isn't this totalWeight returned from generateGeometricWeights? This is just re-summing items in the weights array?

@dankim214 dankim214 merged commit 7df4acb into main Mar 11, 2026
14 checks passed
@dankim214 dankim214 deleted the dkim/scale-orders branch March 11, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants