Skip to content
This repository has been archived by the owner on May 28, 2021. It is now read-only.

Pre-Collateralization (try to avoid "on-the-fly" collateralization) #1146

Closed
kilrau opened this issue May 21, 2020 · 4 comments
Closed

Pre-Collateralization (try to avoid "on-the-fly" collateralization) #1146

kilrau opened this issue May 21, 2020 · 4 comments
Labels
wontfix Wont fix this

Comments

@kilrau
Copy link

kilrau commented May 21, 2020

Is your feature request related to a problem? Please describe.
Apart from the technical issues that we had with "on-the-fly" collateralization, we don't believe it is a good long-term approach since it relies on getting a transaction into the next block. There are times where the chain will be highly congested and latest then this approach will fail or result in very high gas costs.

Describe the solution you'd like
Allocate collateral to a channel with a client based on certain parameters. In times when gas prices are low (below a certain threshold or e.g. moving average).

  • how much fees the sender/receiver paid to have
  • how much was paid for liquidity fee (see RFC: Node Fee Policy #1139)
  • transfer history (e.g. most transfers going from node -> client , x transfers per time)
  • I bet we can come up with some more, but the basic trade-off I see is "opportunity costs for capital locked" vs. "next block gas price"

Exposing this as API and letting an external service take care (#802) is great, are you guys also planning to implement this service yourself (#796 suggests so)?

@kilrau kilrau added the Needs Triage Needs to be looked at and prioritized. label May 21, 2020
@ArjunBhuptani
Copy link
Member

ArjunBhuptani commented May 22, 2020

Exposing this as API and letting an external service take care (#802) is great, are you guys also planning to implement this service yourself (#796 suggests so)?

Yep, we're planning to implement this ourselves. Right now collateralization has 3 tiers of "prioritization", along with an automated override for larger transfers. Every time an application is uninstalled, the node will look up a profile for a given channel and rebalance based on the following logic:

  1. The node will check to see if an externally-provided profile is available via the Collateral Management Service you mentioned above in [tracker] Collateral Management Service #802. We have yet to finish setting this up, but this will be a plug in API configured on setup that gets access via an auth key served from the node. This service is closed source for now, but will intelligently analyze a channel's behavioral data to optimize on the tradeoff between collateral cost vs gas cost of rebalancing.
  2. If not, the node will check to see if an internally-provided profile is available. Setting up an internally-provided profile can be done using an admin auth key from the node and calling an addProfile nats endpoint.
  3. If nothing else is available, the rebalancing logic will default to the node's base collateralization schema found in config.service.ts

In all cases, if a transfer that is greater than collateral volume comes through, the node will attempt to collateralize it "just in time".

@ArjunBhuptani
Copy link
Member

Gonna tag prioritization on this as a wontfix just because there isn't an action item yet beyond whats in the other issues, but happy to continue a long form discussion here.

@ArjunBhuptani ArjunBhuptani added wontfix Wont fix this and removed Needs Triage Needs to be looked at and prioritized. labels May 22, 2020
@kilrau
Copy link
Author

kilrau commented May 22, 2020

Great to see that most of it is already in the works. Thanks!

  • how much fees the sender/receiver paid to have

  • how much was paid for liduiditiy fee (see RFC: Node Fee Policy #1139)

  • transfer history (e.g. most transfers going from node -> client , x transfers per time)

  • I bet we can come up with some more, but the basic trade-off I see is "opportunity costs for capital locked" vs. "next block gas price"

Maybe we can make this an issue about defining metrics for the collateralization profile? Can you link me to the current state of profiles (or describe) so I can see how it looks like?

@kilrau kilrau changed the title RFC: Smart Collateral RFC: Smart Collateralization May 26, 2020
@kilrau kilrau changed the title RFC: Smart Collateralization Pre-Collateralization (avoiding "on-the-fly" collateralization to the best degree possible) Aug 27, 2020
@kilrau kilrau changed the title Pre-Collateralization (avoiding "on-the-fly" collateralization to the best degree possible) Pre-Collateralization (try to avoid "on-the-fly" collateralization) Aug 27, 2020
@kilrau
Copy link
Author

kilrau commented Aug 27, 2020

Closing here in favor of #1405

@kilrau kilrau closed this as completed Aug 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wontfix Wont fix this
Projects
None yet
Development

No branches or pull requests

2 participants