Skip to content

kcolbchain/meridian

Repository files navigation

meridian

RWA market-making stack — ERC-4626 LP vaults, agent-driven quoting, oracle-adapted pricing, compliance-gated execution. By kcolbchain (est. 2015).

The full on-chain stack: contracts + agent + risk + execution. Built on top of kcolbchain/quoter (the strategy core).

The problem

AMMs designed for liquid token pairs fail on real-world assets:

  • Illiquid — RWA trades are infrequent; CFMM math bleeds against thin flow.
  • Irregular pricing — real-estate, private credit, T-bills don't have second-by-second feeds.
  • Geography-specific — the same asset prices differently across jurisdictions.
  • Compliance-gated — not every counterparty can trade every asset.

Constant-product LPs get destroyed. Spreads are too wide (no fills) or too tight (adverse selection).

What meridian ships

  • ERC-4626 LP vault (MeridianVaultERC4626.sol) — third-party LPs deposit a base asset (e.g. USDC), receive shares, passively earn the agent's quoting profit. High-water-mark performance fee + linearly accruing management fee, both configurable, both safety-capped.
  • Agent-controlled vault (MeridianVault.sol) — circuit-breaker, slippage caps, allow-listed routers. The agent has exclusive trade-execution rights; deposits are isolated from agent keys.
  • Strategy executor + oracle adapter (StrategyExecutor.sol, OracleAdapter.sol) — on-chain hooks for the agent's pricing decisions.
  • Agent runtime (src/agents/) — rwa_market_maker.py, ml_pricing_agent.py, plus the strategies inherited from quoter.
  • EVM connectivity + execution (src/chains/evm/, src/execution/{uniswap_v3,vault_executor}.py) — live + dry-run pathways.
  • Risk manager (src/risk/risk_manager.py) — inventory-time-weighted caps, position-aware throttling.
  • Backtest engine — replay historical or simulated tape against any strategy before going live.
  • Browser simulator (web/) — pick an asset class, choose a strategy, watch quotes / fills / inventory / PnL evolve. Hosted at kcolbchain.com/meridian/.

Architecture

                       ┌──────────────────────────────┐
   LP USDC  ──────────►│   MeridianVaultERC4626       │
                       │   (4626 shares + fees)       │
                       └──────────┬───────────────────┘
                                  │ withdraw/redeem
                                  ▼
                       ┌──────────────────────────────┐
   Agent  ◄────────────┤   MeridianVault              │
   (owner)             │   slippage cap + circuit-bk  │
                       └──────────┬───────────────────┘
                                  │ approved routers
                                  ▼
        Oracle ─► OracleAdapter ─► StrategyExecutor ─► DEX
                                  ▲
                Risk manager ─────┤
                                  ▲
                Strategies (quoter) ──── adaptive / constant / your own

LPs deposit. Agent quotes. Oracle drives fair value. Risk manager throttles. Vault enforces slippage + router allow-list. Strategy from quoter decides the prices.

Quick start

git clone https://github.com/kcolbchain/meridian.git
cd meridian

# Python agent
pip install -r requirements.txt
python -m src.agents.rwa_market_maker --config config/default.yaml --simulate

# Contracts (Hardhat)
npm install
npm run compile
npm run test

# Deploy to testnets
npm run deploy:base-sepolia
npm run deploy:op-sepolia
npm run deploy:fuji

# Browser simulator
python3 -m http.server -d web 8080  # then open http://localhost:8080

Live demo

The browser simulator at kcolbchain.com/meridian/ runs the same conceptual model as the Python agent — pick an asset class, tune the regime, watch quotes evolve.

Where this fits

Status

  • Contracts: written, Hardhat tests passing, testnet deploys configured (Base Sepolia, OP Sepolia, Fuji). Not audited; do not run on mainnet without a formal audit.
  • Agent runtime: simulate mode + risk manager + backtest. Live execution path is wired through vault_executor.py but expects venue config the operator supplies.
  • Browser sim: shipped. Strategy stubs for compliance_gated / geo_priced are tracked as roadmap; not yet wired to on-chain transfer-restriction adapters.

Running the tests

# Python
pytest -q

# Solidity
npm run test

Contributing

See CONTRIBUTING.md and CONTRIBUTORS.md. Issues tagged good-first-issue are great entry points. The MeridianVaultERC4626 invariant + fuzz suite (#31) is the highest-leverage open issue right now.

Working with kcolbchain

We build, deploy, and operate RWA market-making for partner protocols — managed liquidity-on-call, pre-audit, integration, and operational coverage. If you'd like to talk, see kcolbchain.com/work-with-us.

Links

License

MIT — see LICENSE


Founded by Abhishek Krishna • GitHub: @abhicris

About

RWA market-making agent — oracle-driven pricing, geography-aware adaptive spreads, compliance-gated, backtesting engine. For illiquid real-world assets.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors