Skip to content

L0: Add simple-amm-lp YAML preset (#30)#32

Open
sanrishi wants to merge 2 commits into
kcolbchain:mainfrom
sanrishi:main
Open

L0: Add simple-amm-lp YAML preset (#30)#32
sanrishi wants to merge 2 commits into
kcolbchain:mainfrom
sanrishi:main

Conversation

@sanrishi

@sanrishi sanrishi commented Jun 5, 2026

Copy link
Copy Markdown

Summary

Adds a new simulation preset for a simple AMM liquidity provider strategy.

Changes

New files

  • *\presets/simple-amm-lp.yaml* — AMM LP preset with tight 10 bps base spread, 1 ETH + \ USDC initial capital, 0.8 fill probability (AMM-like), 5 bps fee tier (Uniswap V3 ETH/USDC tier), 1000 simulation ticks, and \ ETH starting price.
  • *\src/utils/presets.py* — Preset loader with \list_presets()\ and \load_preset(name)\ that discovers .yaml\ files in the \presets/\ directory.

Modified files

  • *
    un.py*
    — Added --preset \ and --list-presets\ CLI arguments. The existing
    un_simulate\ function body is unchanged.

Preset parameter overview

Section Parameter Value Description
agent initial_base 1.0 Starting ETH position
agent initial_quote 3000 Starting USDC position
agent base_spread_bps 10 0.1% spread — tight for concentrated LP
agent max_order_size_pct 0.05 5% of capital per order
agent max_exposure 30 Exposure limit
agent max_inventory_pct 0.5 Max inventory skew before rebalance
agent max_base_position 2.0 Max ETH position cap
backtest fill_probability 0.8 AMM-like fill rate
backtest fee_bps 5 Uniswap V3 0.05% fee tier
backtest ticks 1000 Simulation duration
backtest base_price 3000.0 ETH starting price
backtest volatility 0.01 Lower vol for stable pair

Usage

\
python run.py --list-presets
python run.py --preset simple-amm-lp --simulate
\\

Scope note

This PR is strictly scoped to the preset system. The pre-existing import errors in
un.py\ (three missing class imports) are wrapped in a \ ry/except\ to allow the module to load, but the
un_simulate\ function body and all other code is left entirely untouched.

Closes #30

@sanrishi

sanrishi commented Jun 5, 2026

Copy link
Copy Markdown
Author

@abhicris Let me know what additionally needed?

@abhicris

abhicris commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Welcome to kcolbchain, @sanrishi — glad you're here. 🌱

Here's what happens from this PR:

  1. Our automated review looks for obvious issues (tests, secrets, size) within a couple of hours.
  2. If it's clean and CI passes, we merge without back-and-forth.
  3. If we need changes, we'll leave a specific comment — not a generic nit. Push another commit and we re-review.

While you wait:

  • Run the repo's tests locally (see the repo README.md).
  • Keep the PR scoped to one concern — bigger PRs land slower.
  • Don't commit tokens or .env contents.

What happens after your first merge

Thanks for writing the code. We're building this to last.

@abhicris

abhicris commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

🤖 Audit verdict: needs_human

Path traversal vulnerability: preset name is not validated to stay within presets/ directory, allowing relative paths to escape.

Risks flagged:

  • Path traversal in load_preset(): name parameter like '../../../etc/passwd' could escape presets directory
  • Should validate resulting path.resolve() is relative to PRESETS_DIR.resolve()

Audited by the kcolbchain PR pipeline. See pipeline docs.

@Pattermesh

Copy link
Copy Markdown

Your PR was selected as the winning submission for this issue — great work! However, it now has merge conflicts with main (from other recently merged PRs). Could you please rebase against main and force-push? We'll merge as soon as the conflicts are resolved. Thank you!

@sanrishi

sanrishi commented Jun 6, 2026

Copy link
Copy Markdown
Author

@Pattermesh you can merge this now and tell where to get 10usdc?

@sanrishi

sanrishi commented Jun 7, 2026

Copy link
Copy Markdown
Author

@Pattermesh Are you gonna doing this something or I can close?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

L0: Add a simple-amm-lp YAML preset

3 participants