Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Stablecoins as order currencies: check market price against the node's rates, not Yadio

Abierto
#213 0 comentarios 0 reacciones 0 asignados Ver en GitHub

@grunch ya está trabajando en esto.

Desde el 23/10/2026.

  • #214 de @grunch — abierto

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
56/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
rust
Área
backend, cli

Línea de trabajo

Start with execute_new_order in src/cli/new_order.rs and the kind 30078 mostro-rates event format described in the issue; compare the lookup approach with fetch_newest_info_event in src/util/events.rs. Add tests for quoted codes, missing codes, no event, and lowercase input, then update the --fiat-code help and the README and docs/commands.md. Done when market orders use the node's published rates, refusals return an error, and the stablecoin guidance is documented.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement

Problem

MostroP2P/mostro#1081 proposes trading stablecoins as order currencies, each pegged 1:1 to a fiat. USDT, USDC and DOC (all USD) come first, and the design stays open to others such as EURC (EUR). A node that opts in prices a market order from its rate for the coin's fiat, and publishes the coins in its mostro-rates event like any other currency. MostroP2P/app#884 is the app side; this issue is the CLI side.

What already works

  • Fixed-price orders. neworder upper-cases the code and sends it as is, so -c usdt -a 150000 already reaches the node.
  • The order book filter. listorders -c usdt compares codes exactly (src/parser/orders.rs), so it matches.
  • The payment method. -m is a free string, so -m "USDT (Tron)" passes.
  • Amounts. check_fiat_range parses whole units (i64), as the daemon does.

What changes

1. The market-price check asks the node, not Yadio

A market order (-a 0, the default) never leaves the CLI with a stablecoin code. execute_new_order (src/cli/new_order.rs) fetches https://api.yadio.io/currencies and refuses any code missing from that list:

USDT is not present in the fiat market, please specify an amount with -a flag to fix the rate

Yadio lists 145 currencies today, and none of them is USDT, USDC, DOC or EURC. So the order is refused even on a node that quotes the coin.

Yadio's list is no longer the node's list. mostrod prices from several providers (docs/PRICE_PROVIDERS.md), and the rates it actually uses are the ones it publishes: kind 30078, d = mostro-rates, content {"BTC": {"<code>": <price>}}, authored by the node's pubkey.

The check would look the code up in that event instead, newest revision first, as fetch_newest_info_event (src/util/events.rs) does for kind 38385:

  • The event quotes the code: send the order.
  • The event exists but lacks the code: refuse, and say that this node does not quote it at market price, so pass -a to fix the sats amount.
  • No event: send the order and let the node decide. A node may not publish its rates at all (publish_to_nostr = false in [price], or the legacy publish_exchange_rates_to_nostr), or the relays may not have the event.

Two fixes come along:

  • No Yadio call. Today an unreachable Yadio fails every market order with a network error.
  • A refusal returns an error. Today the check ends with process::exit(0), which reports success to a script.
2. Help and docs
  • Help text. --fiat-code (src/cli.rs), docs/commands.md and the README say "fiat currency code". They would also name the stablecoin codes from the protocol book's list.
  • Example. One stablecoin order in the README, with the network in the payment method: mostro-cli neworder -k sell -c usdt -f 100 -m "USDT (Tron)".
  • Tip. A short note to name the network in -m, since a transfer sent on the wrong network can be lost, and to paste the transaction id in the chat. The txid is what a solver checks in a dispute.

Order of work

One PR. It can ship before MostroP2P/mostro#1081:

  • Stablecoins: nothing changes until a node quotes them. A node that publishes rates without them still gets the order refused, now with a clearer message.
  • Fiat codes: they keep working.

Tests

  • The decision is a pure function of the rates event and the code, tested like read_info_tag_from_event:
    • an event with the code allows a market order;
    • an event without it refuses one;
    • no event allows one.
  • The lookup upper-cases the code, so usdt finds USDT.

Out of scope

  • How the node prices the coins: MostroP2P/mostro#1081.
  • Depeg warnings. The node would stop quoting a coin that loses its peg (a follow-up in MostroP2P/mostro#1081). This check already turns that into a refusal.
Lenguaje dominante
Rust
Estrellas
39
Forks
16
Merge medio
4 h 6 min
PR fusionados (30 d)
3

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de MostroP2P/mostro-cli

Todos los issues de MostroP2P/mostro-cli

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.