Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

limit negative price rate spread #1376

Open
ZZiigguurraatt opened this issue Feb 11, 2025 · 0 comments
Open

limit negative price rate spread #1376

ZZiigguurraatt opened this issue Feb 11, 2025 · 0 comments
Labels
bug Something isn't working needs triage

Comments

@ZZiigguurraatt
Copy link

For rational economics, a node runner should want their asset buy price rate to be higher than their asset sell price rate. An asset buy price rate represents the number of BTC we need to pay for each asset purchased (the units are assets/BTC). Therefor, we always want to buy more assets for selling less BTC, hence the higher buy price rate. An asset sell price is the opposite. We want to sell less assets and buy more BTC since the units are still assets/BTC. So, we want a lower sell price rate.

Our absolute price rate spread can be represented as

PriceRateSpread=BuyPriceRate-SellPriceRate

and the relative price rate spread can be represented as

PriceRateSpread=(BuyPriceRate-SellPriceRate)/SellPriceRate

For rational economics, the PriceRateSpread should always be positive. However, right now in tapd and the price oracle server, we have the freedom to have a positive and negative price spread. A negative spread means the node will be trading at a net loss over time.

There are cases in the normal lightning network where one may want negative fees on the inbound side of a channel (https://docs.lightning.engineering/lightning-network-tools/lnd/inbound-channel-fees). However, these use cases seem only relevant to routing nodes. Right now, taproot asset nodes likely we be functioning as "edge nodes", so I'm not sure if there is a meaningful use case for a negative spread.

At the bare minimum, I think we should give a warning if someone is using a negative spread. Realistically, we should probably also require them to enable an allownegativepricespread option to allow this. We may just not want to make it an option at all though and not allow anyone to have a negative spread, this is up for debate. I'm not sure if this should be enforced in tapd or the price oracle, that is also up for debate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant