Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PIP details a design to achieve leveraged positions within PegNet, based on the proposed "Burn and Mint" mechanism and a flat fee structure. The design detailed in this PIP enables "short" and "long" positions to be made using a user's pAssets with a selectable leverage multiplier.
A leveraged position is entered into by locking pAssets as collateral, defining a leverage multiplier and position direction, and opening the position. By doing so there is now a set liquidation price, whereby if the asset goes against the traders position by a certain amount, less fees, the collateral is burned in a liquidation event. If not liquidated, upon a decision to close the position by the trader, a profit or loss is determined and for a loss that portion of collateral is burned, and for a gain the protocol mints that amount of additional tokens to reward the trade in the same way that current conversions function within the protocol.
Taking a leveraged position in PegNet is similar to any other conversion in PegNet, but the rate at which a trader loses or gains on that position has leverage applied to it. If the leveraged position is profitable, the protocol mints the profit back to the position holder upon closing just as if the user engaged in and exited a traditional long margin trade, only the profit comes from the protocol rather than a counterparty. Conversely, if the leveraged position holder’s position is losing, the protocol burns through the collateral in the trade at a faster rate, and depending on the final design for leverage within PegNet, can burn the entire collateral when a liquidation price is hit.
Please see https://github.com/drkatz/pips/blob/pip-0017/pip-0017.mediawiki for the complete PIP