Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions .bedrock/.terragrunt/04_futures_mm_svc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,32 @@ resource "aws_alb_listener" "futures_mm_int_443_use1" {
)
}

# Public alias in the Hashpower zone. Dev zones live in the workload account.
# LMN writes hashpower.exchange in titanio-net (aws.titanio-net).
resource "aws_route53_record" "futures_mm_int_use1" {
count = var.futures_mm_service.create ? 1 : 0
count = var.futures_mm_service.create && !local.is_lmn ? 1 : 0
provider = aws.use1
zone_id = local.hp_dns["exc"].zone_id
name = "futuresmm.${local.hp_dns["exc"].name}"
type = "A"

alias {
name = aws_alb.futures_mm_int_use1[count.index].dns_name
zone_id = aws_alb.futures_mm_int_use1[count.index].zone_id
name = aws_alb.futures_mm_int_use1[0].dns_name
zone_id = aws_alb.futures_mm_int_use1[0].zone_id
evaluate_target_health = true
}
}

resource "aws_route53_record" "futures_mm_int_lmn" {
count = var.futures_mm_service.create && local.is_lmn ? 1 : 0
provider = aws.titanio-net
zone_id = local.hp_dns["exc"].zone_id
name = "futuresmm.${local.hp_dns["exc"].name}"
type = "A"

alias {
name = aws_alb.futures_mm_int_use1[0].dns_name
zone_id = aws_alb.futures_mm_int_use1[0].zone_id
evaluate_target_health = true
}
}
Expand Down
22 changes: 19 additions & 3 deletions .bedrock/.terragrunt/04_perps_mm_svc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,32 @@ resource "aws_alb_listener" "perps_mm_int_443_use1" {
)
}

# Public alias in the Hashpower zone. Dev zones live in the workload account.
# LMN writes hashpower.exchange in titanio-net (aws.titanio-net).
resource "aws_route53_record" "perps_mm_int_use1" {
count = var.perps_mm_service.create ? 1 : 0
count = var.perps_mm_service.create && !local.is_lmn ? 1 : 0
provider = aws.use1
zone_id = local.hp_dns["exc"].zone_id
name = "perpsmm.${local.hp_dns["exc"].name}"
type = "A"

alias {
name = aws_alb.perps_mm_int_use1[count.index].dns_name
zone_id = aws_alb.perps_mm_int_use1[count.index].zone_id
name = aws_alb.perps_mm_int_use1[0].dns_name
zone_id = aws_alb.perps_mm_int_use1[0].zone_id
evaluate_target_health = true
}
}

resource "aws_route53_record" "perps_mm_int_lmn" {
count = var.perps_mm_service.create && local.is_lmn ? 1 : 0
provider = aws.titanio-net
zone_id = local.hp_dns["exc"].zone_id
name = "perpsmm.${local.hp_dns["exc"].name}"
type = "A"

alias {
name = aws_alb.perps_mm_int_use1[0].dns_name
zone_id = aws_alb.perps_mm_int_use1[0].zone_id
evaluate_target_health = true
}
}
Expand Down
22 changes: 19 additions & 3 deletions .bedrock/.terragrunt/06_col_mar_keeper_svc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,32 @@ resource "aws_alb_listener" "keeper_int_443_use1" {
)
}

# Public alias in the Hashpower zone. Dev zones live in the workload account.
# LMN writes hashpower.exchange in titanio-net (aws.titanio-net).
resource "aws_route53_record" "keeper_int_use1" {
count = var.keeper_service.create ? 1 : 0
count = var.keeper_service.create && !local.is_lmn ? 1 : 0
provider = aws.use1
zone_id = local.hp_dns["exc"].zone_id
name = "keeper.${local.hp_dns["exc"].name}"
type = "A"

alias {
name = aws_alb.keeper_int_use1[count.index].dns_name
zone_id = aws_alb.keeper_int_use1[count.index].zone_id
name = aws_alb.keeper_int_use1[0].dns_name
zone_id = aws_alb.keeper_int_use1[0].zone_id
evaluate_target_health = true
}
}

resource "aws_route53_record" "keeper_int_lmn" {
count = var.keeper_service.create && local.is_lmn ? 1 : 0
provider = aws.titanio-net
zone_id = local.hp_dns["exc"].zone_id
name = "keeper.${local.hp_dns["exc"].name}"
type = "A"

alias {
name = aws_alb.keeper_int_use1[0].dns_name
zone_id = aws_alb.keeper_int_use1[0].zone_id
evaluate_target_health = true
}
}
Expand Down
1 change: 1 addition & 0 deletions config/prd.env
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ LOG_LEVEL=info
# ── Market-maker runtime ───────────────────────────────────────────────────
MAKER_LOG_LEVEL=info
HASHPRICE_ORACLE_SUBGRAPH_URL=https://api.goldsky.com/api/public/project_cmmz5dm4l7ocp01xng61y5nwr/subgraphs/hpow-oracles/lmn-latest/gn
ETH_PRICE_FEED_ADDRESS=0x50015f8b17fb2C290Dde41fDc246ed0dcEE93a8b
3 changes: 1 addition & 2 deletions market-maker/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"yaml.schemas": {
"./schemas/perps.json": "configs/perps.*.yml",
"./schemas/futures.json": "configs/futures.*.yml"
"./schemas/portfolio.json": "configs/portfolio.*.yml"
},
"yaml.format.enable": true,
"yaml.validate": true,
Expand Down
34 changes: 18 additions & 16 deletions market-maker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,35 +125,35 @@ on the book for hot restarts.

## Configuration

Each app ships per-environment YAML configs under `configs/`:
Per-environment YAML configs live under `configs/`. One shared
portfolio config per environment covers perps and every futures expiry
in a single process:

| File | Network |
|---|---|
| `perps.local.yml` / `futures.local.yml` | hardhat |
| `perps.dev.yml` / `futures.dev.yml` | base-sepolia |
| `perps.stg.yml` / `futures.stg.yml` | base-mainnet |
| `perps.prd.yml` / `futures.prd.yml` | base-mainnet |
| `portfolio.local.yml` | hardhat |
| `portfolio.dev.yml` | base-sepolia |
| `portfolio.prd.yml` | base-mainnet |

Pick one with `--config <path>` (CLI flag), `MAKER_CONFIG=<path>` (env
variable), or `MAKER_ENV=<local|dev|stg|prd>` inside the docker
variable), or `MAKER_ENV=<local|dev|prd>` inside the docker
entrypoint. Precedence is `--config` > `MAKER_CONFIG` > docker
`MAKER_ENV` lookup.

The YAMLs are validated against generated JSON Schemas (autocomplete
and type-checking work in any editor with the YAML extension). They
interpolate `${VAR}` tokens from environment variables. On startup
both apps load `.env` from `market-maker/` and from the parent
the app loads `.env` from `market-maker/` and from the parent
`collateral-margin/` (in that priority order); live `process.env`
always wins over file contents.

```bash
pnpm local:perps # node … --config configs/perps.local.yml | pino-pretty
pnpm dev:futures # node … --config configs/futures.dev.yml | pino-pretty
pnpm stg:perps # node … --config configs/perps.stg.yml
pnpm prd:futures # node … --config configs/futures.prd.yml
pnpm local:portfolio # node … --config configs/portfolio.local.yml | pino-pretty
pnpm dev:portfolio # node … --config configs/portfolio.dev.yml | pino-pretty
pnpm prd:portfolio # node … --config configs/portfolio.prd.yml

# One-off / custom path:
node src/apps/perps/main.ts --config /tmp/my-perps.yml
node src/apps/portfolio/main.ts --config /tmp/my-portfolio.yml
```

All operational tuning (sizes, spreads, risk caps, gas budgets,
Expand All @@ -168,13 +168,15 @@ else lives in YAML.
| Variable | Required by | Description |
|---|---|---|
| `PRIVATE_KEY` | all | Hex-encoded private key for the MM wallet |
| `ALCHEMY_API_KEY` | dev / stg / prd | Used by the bundled YAMLs to compose the RPC URL |
| `PERPS_ADDRESS` | perps app | Deployed `HashPowerPerpsDEX` proxy address |
| `FUTURES_ADDRESS` | futures app | Deployed `Futures` proxy address |
| `ALCHEMY_API_KEY` | dev / prd | Used by the bundled YAMLs to compose the RPC URL |
| `PERPS_ADDRESS` | all | Deployed `HashPowerPerpsDEX` proxy address |
| `FUTURES_ADDRESS` | all | Deployed `Futures` proxy address |
| `HASHPRICE_ORACLE_SUBGRAPH_URL` | dev / prd | Hashprice-oracle subgraph, used to backfill the σ window at startup |
| `ETH_PRICE_FEED_ADDRESS` | dev / prd | Chainlink ETH/USD aggregator; required for USD-denominated gas budgets |

Custom YAMLs may reference additional `${VAR}` tokens (e.g. a
non-Alchemy RPC URL, a chain id override). The bundled YAMLs in
`configs/` only reference the four above plus the RPC URL.
`configs/` only reference those above plus the RPC URL.

## Getting started

Expand Down
94 changes: 0 additions & 94 deletions market-maker/configs/futures.dev.yml

This file was deleted.

81 changes: 0 additions & 81 deletions market-maker/configs/futures.local.yml

This file was deleted.

Loading
Loading