[feature] add optional slippage simulation for paper market orders#20
[feature] add optional slippage simulation for paper market orders#20theghostmac wants to merge 3 commits into
Conversation
|
Thanks for the contribution — the approach is solid and mirrors the existing Must fix
Should fix
Clarification
Non-blocking design notes (for follow-up)
Items 1 and 2 should be fixed before merge. The rest are improvements that would be appreciated but won't block on. |
… rate to execute_status output
|
Thank you @agent-smith-k. Addressed both blocking and non-blocking. |
agent-smith-k
left a comment
There was a problem hiding this comment.
All findings from the initial review have been addressed. The JSON key typo is fixed, serde defaults are consistent, validation is extracted into a reusable helper with edge-case tests, backward-compat deserialization is tested, --slippage alias works, paper status now surfaces both rates, and PaperConfig eliminates the positional-params concern.
296/296 tests pass. Runtime verification confirms correct JSON output for both paper init and paper status.
One low-severity hardening note for a follow-up: persisted state.json values are trusted on reload without re-validation. Not blocking since the trust boundary is local.
Approving.
|
Superseded by #24, which contains your changes as a signed squash commit with Co-authored-by credit. Merged to main. Thank you for the contribution! |
Context
Market orders in paper trading filled at the exact best ask/bid with zero slippage, causing paper PnL to consistently overstate what a strategy would achieve live -- especially for larger order sizes, illiquid pairs, and volatile conditions.
This PR adds an optional
--slippageflag topaper initandpaper reset, following existing--fee-ratepattern.Brief Changelog
Usage:
Update: flags
--slippage-rateor--slippageworks.Init with slippage rate:
Reset slippage rate:
Closes #15