Files
cross-chain-pmm-lps/docs/04-bot-policy.md
defiQUG 168dba25d9 chore(sim): refresh deployment status, pool matrix, schemas, and scenario scripts
- deployment-status and pool-matrix snapshots aligned with validate-deployment-status.cjs.
- Micro-trade / scorecard docs and run-scenario wiring.

Made-with: Cursor
2026-04-07 22:56:16 -07:00

61 lines
2.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Bot Policy (What It Actually Does)
## Inputs (per pool)
- **Oracle price** `P_oracle(T)` — target peg: 1.00 for USD stables; FX for EUR tokens
- **Pool mid price** `P_pool(T)`
- **Deviation**: `δ = (P_pool - P_oracle) / P_oracle`
- **Inventory imbalance** on cW side (how much of your token remains vs baseline)
- Public chain liquidity/volatility conditions
- Bridge backlog / mint-burn queue status (if available)
## Actions
### 1. Tight-peg maintenance trades
- If `P_pool(T) > P_oracle + band` → bot **sells** `T` into pool (adds T inventory / absorbs quote)
- If `P_pool(T) < P_oracle - band` → bot **buys** `T` from pool (removes T inventory / spends quote)
### 2. Inventory re-centering
- If pool is “too drained” of T (or too full), bot adjusts by:
- Adding/removing single-sided liquidity on T side
- Optionally bridging more T from ChainID 138 or redeeming back
### 3. Cross-pool routing
When multiple quotes exist (USDT/USDC/DAI), the bot routes to the best edge:
- Trade where slippage + fee is lowest
- Optionally rebalance quote asset via existing DEX routes (USDC ↔ USDT ↔ DAI)
### 4. Bridge-aware throttling
- If the bridge is congested or risk flags trip, bot widens bands / reduces exposure
### 5. Gas-budgeted micro-support lane
For selected wrapped USD rails, especially **cWUSDC** and **cWUSDT**, you can reserve a small gas budget for **micro-trades** against **USDC** / **USDT**:
- Prefer matched-quote rails when they exist: `cWUSDC/USDC`, `cWUSDT/USDT`
- Keep each trade tiny relative to `I_T^*`
- Use inventory-aware direction first: sell cW into the pool when inventory is too low; buy cW from the pool when inventory is too high
- If the pool is already near its inventory target, alternate tiny buys/sells only within a separate gas budget
Purpose:
- Give wrappers **observable turnover**
- Tighten route discovery and quote confidence
- Keep the support lane small enough that the PMM remains a **corridor defense tool**, not the primary venue
Important: this improves **tradability and price discovery**, but it does **not** create backing or intrinsic value by itself.
## Peg bands
See [../config/peg-bands.json](../config/peg-bands.json) and [05-oracles.md](05-oracles.md). Summary:
- **USD-pegged**: Normal ±1025 bps; stress ±50150 bps; circuit break >2%
- **EUR-pegged**: Normal ±2550 bps; stress ±100250 bps; anchor via EURUSD oracle
State machine and pseudo-code: [../spec/bot-state-machine.md](../spec/bot-state-machine.md), [../spec/bot-pseudo-code.md](../spec/bot-pseudo-code.md).