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

How to charge closing fees without an order match #909

Closed
luckysori opened this issue Jul 5, 2023 · 6 comments
Closed

How to charge closing fees without an order match #909

luckysori opened this issue Jul 5, 2023 · 6 comments

Comments

@luckysori
Copy link
Contributor

It is an edge-case, but a trader could simply force-close the channel to avoid paying order-matching fees.

Even if there is no force-close, we do currently enforce frequent collaborative closures that I think circumvent the orderbook. This motivated me to leave the following TODO in #863:

// TODO: Should we charge for the order-matching fee if there is no order????

@holzeis
Copy link
Contributor

holzeis commented Jul 5, 2023

It is an edge-case, but a trader could simply force-close the channel to avoid paying order-matching fees.

Can you elaborate on this scenario? How would the user avoid paying the order-matching fees? Also, it looks like this part has nothing to do with the second part.

@luckysori
Copy link
Contributor Author

Can you elaborate on this scenario? How would the user avoid paying the order-matching fees?

An app user could:

  1. Open a position, paying the corresponding order-matching fee invoice.
  2. Force-close the LN-DLC channel (currently not supported, but we have to support it).
  3. Not have to pay an order-matching fee for closing the position, since force-closing doesn't involve creating an order and getting a match.

With a small position this might not be profitable because the transaction fees might be more expensive than the order-matching fee, but this route might become more attractive with large positions.

Also, it looks like this part has nothing to do with the second part.

The point of the second part is to highlight that there is another way in which the app user can end up not paying the order-matching fee: by letting it be collaboratively closed on expiry. Such a scenario is related to the first one because in both cases there is no order-matching happening, which is strange in the context of an orderbook. I left it out of #863, because:

  • I wasn't sure if we actually wanted to charge the order-matching fee in that case.
  • If we do want it, the implementation has to be different because we do not send a trade request from the app to the coordinator (which in the regular flow returns the order-matching fee invoice).

@holzeis
Copy link
Contributor

holzeis commented Jul 6, 2023

Thanks for the explanation, now the second part also makes sense to me why it is added to this ticket. 👍

Well in that case, how about only charging a fee for opening a position, but none when closing a position? We could as well charge twice for opening already covering the fees for closing the position upfront - as there is currently no way to not close the position after the expiry.

We might want to revise that when supporting perpetuals.

@bonomat
Copy link
Contributor

bonomat commented Jul 6, 2023

Let's try to remove the term: close position from our vocabulary and replace it with:

  1. trade: is the act of adding or removing liquidity from the orderbook: i.e. a market order removes liquidity and a limit order (without immediate match) adds liquidity to the orderbook
  2. close DLC channel: this is what is described in this ticket. A channel can either be force-closed or collaboratively closed. The latter one should always involve point 1.

When speaking about order matching fees/orderbook fees we talk about the first point.
If a trader has an open position and force closes his DLC channel, then the coordinator will need to find a replacement or otherwise he accepts unecessary risk. If he finds a replacement, i.e. matches a new trader, who will need to pay order matching fee.

That being said, in this case we would lose out one part of the order matching fee because the coordinator will remove liquidity from the orderbook.

I think there is nothing to do here for now.

@github-actions
Copy link

github-actions bot commented Aug 6, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Aug 6, 2023
@bonomat
Copy link
Contributor

bonomat commented Aug 6, 2023

Quoting myself :)

I think there is nothing to do here for now.

Closed as not planned for now

@bonomat bonomat closed this as completed Aug 6, 2023
@luckysori luckysori closed this as not planned Won't fix, can't repro, duplicate, stale Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants