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

[SPEC] Define Various Solvency Models #739

Open
hellwolf opened this issue Apr 12, 2022 · 1 comment
Open

[SPEC] Define Various Solvency Models #739

hellwolf opened this issue Apr 12, 2022 · 1 comment
Assignees
Labels
Project: PROTOCOL-SPEC Superfluid protocol specification in haskell Type: Enhancement New feature or request
Projects

Comments

@hellwolf
Copy link
Contributor

hellwolf commented Apr 12, 2022

Financial System

In order to define solvency models, we need to first define a financial system model where payment semantics are executed. A minimum financial system functioning on the monetary distribution could formally defined as such:

image

where:

  • MD, monetary distribution (defined in yellow paper)
  • financial contract, an object that has function of fcPred and fcExec.
  • fcSet, set of financial contracts.
  • fcPred, predicate of a execution condition of a financial contract.
  • fcExec, execute the payment semantics encoded in the financial contract.

Solvency Models

There are two orthogonal problems with solvency models:

  1. Solvency risk model of the financial system.
  2. Solvency execution model of the financial system.

Solvency Risk Model

The simplest solvency risk model is a binary fcPred based on flow sender's balance amount, if it is negative, then an associated liquidation contract can be executed by anyone with a profit.

E.g. this financial contract could be translated to "if Bob's balance is negative, then anyone can delete the flow between bob and alice and a X amount of tokens are given to the executor of the contract".

This way, we need not to extend the payment semantics at all.

There may be other overlays of risk model where the cost of execution is part of the model too, so that some negative account. For simplicity, this will not be covered here.

Solvency Execution Models

There are properties of the execution models can vary between designs:

  • Deterministic execution order.
  • Concurrency.
  • Atomicity.

Deterministic & Concurrency

Having both deterministic execution order and concurrency would require fcSet to have a stronger condition, e.g. a poset (partially ordered set). It is particularly unscalable (O(N) time complexity as fcSet grows in size) to implement, unless fcPred itself could be optimized/limited to also poset of fcPred sorted by time.

The alternative is having non-deterministic execution order (then trivially being concurrent, albeit not as helpful). And indeed that is the model the current live system on EVM is using.

Atomicity

Although not directly related to solvency models, the ability to be able to bundle financial contracts together creates new possibilities for native execution-level automation.

Technical Notes

BBS

The EVM-v1 Superfluid protocol is using some sort of BufferBasedSolvecy (BBS) model.

BBS is a solution specialized in the context of crypto-economics where buffer is used both for security guarantees for systematic time delays, and for attackers' economic penalty. Additional modification to the system by introducing more roles in-conjunction with an auction of privilege system called TOGA is also enabled in the EVM-v1 implementation.

Assumptions To Revisit

  • Not all bearers post the same risks to the system. Some could have some negative liquidity so long as it doesn't pose systemic risk?
  • Not all use cases require per block precision, longer time interval may be acceptable in some configuration of the system.
  • In more decentralized model such as UTxO, the risks need not necessarily be shared by everyone.
  • ...

Time Sync Solvency (TSS)?

An often talked about alternative solvency model is a time-keeper to guarantee the advancement of time while tying with its own interest to make sure no liquidity risk in the system.

@hellwolf hellwolf created this issue from a note in PROTO (Backlog) Apr 12, 2022
@hellwolf hellwolf added Type: Enhancement New feature or request Project: PROTOCOL-SPEC Superfluid protocol specification in haskell labels Apr 12, 2022
@hellwolf hellwolf self-assigned this Apr 12, 2022
@hellwolf hellwolf added this to the spec-haskell@0.2.0 milestone Apr 12, 2022
@hellwolf hellwolf moved this from Backlog to In progress in PROTO Sep 19, 2022
@hellwolf
Copy link
Contributor Author

Update:

Financial System

In order to define solvency models, we need to first define a financial system model where payment semantics are executed. A minimum financial system functioning on the monetary distribution could formally defined as such:

image

where:

  • MD, monetary distribution (defined in yellow paper)
  • financial contract, an object that has function of fcPred and fcExec.
  • fcSet, set of financial contracts.
  • fcPred, predicate of a execution condition of a financial contract.
  • fcExec, execute the payment semantics encoded in the financial contract.

Solvency Models

There are two orthogonal problems with solvency models:

  1. Solvency risk model of the financial system.
  2. Solvency execution model of the financial system.

Solvency Risk Model

The simplest solvency risk model is a binary fcPred based on flow sender's balance amount, if it is negative, then an associated liquidation contract can be executed by anyone with a profit.

E.g. this financial contract could be translated to "if Bob's balance is negative, then anyone can delete the flow between bob and alice and a X amount of tokens are given to the executor of the contract".

This way, we need not to extend the payment semantics at all.

There may be other overlays of risk model where the cost of execution is part of the model too, so that some negative account. For simplicity, this will not be covered here.

Solvency Execution Models

There are properties of the execution models can vary between designs:

  • Deterministic execution order.
  • Concurrency.
  • Atomicity.

Deterministic & Concurrency

Having both deterministic execution order and concurrency would require fcSet to have a stronger condition, e.g. a poset (partially ordered set). It is particularly unscalable (O(N) time complexity as fcSet grows in size) to implement, unless fcPred itself could be optimized/limited to also poset of fcPred sorted by time.

The alternative is having non-deterministic execution order (then trivially being concurrent, albeit not as helpful). And indeed that is the model the current live system on EVM is using.

Atomicity

Although not directly related to solvency models, the ability to be able to bundle financial contracts together creates new possibilities for native execution-level automation.

@hellwolf hellwolf moved this from In progress to Backlog in PROTO Nov 21, 2022
@hellwolf hellwolf added the Team: Protocol Protocol Core, Sentinel, Peripherals, Protocol Infrastructure Tools & DevOps label Aug 23, 2023
@hellwolf hellwolf removed the Team: Protocol Protocol Core, Sentinel, Peripherals, Protocol Infrastructure Tools & DevOps label Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Project: PROTOCOL-SPEC Superfluid protocol specification in haskell Type: Enhancement New feature or request
Projects
No open projects
PROTO
  
Backlog
Development

No branches or pull requests

1 participant