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

add spec for x/derivatives #353

Merged
merged 17 commits into from
Mar 24, 2023
Merged

add spec for x/derivatives #353

merged 17 commits into from
Mar 24, 2023

Conversation

taiki1frsh
Copy link
Collaborator

fill spec

@taiki1frsh taiki1frsh changed the title [WIP] add info about DenomMetadata [WIP] add spec for x/derivatives Feb 10, 2023
Base automatically changed from feat/derivatives to newDevelop March 15, 2023 08:21
@taiki1frsh taiki1frsh marked this pull request as ready for review March 17, 2023 06:40
@taiki1frsh
Copy link
Collaborator Author

@kimurayu45z @mkXultra

I wrote down the fundamental features and specifications in a text besides basic data structures.
Please review and teach me if there's a lacking part or a wrong description, or so.


## Liquidity Provider Token
There's no dynamic change of the minting and redemption fee rate at this moment unlike GMX. It's the static rate which is defined in the protocol. But, it can be modified through the governace voting.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified it.
Please check the above line.

The position can be covered by two types of asset as margin, which are the tokens of the trading pair. If you trade 'BTC/USDC' pair, you can deposit BTC or USDC as margin. The profit will be distributed in the same token as the margin if there's some.
The created position cannot be modified except for closing a whole in the current implementation.
And, the liquidation is triggered against each position. The margin of the position cannot be added afterward now. But, this will be supported in the near future.
The max leverate rate is defined in the params of the protocol for all trading pairs equially. This can be modified through the governance voting.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leverate
leverage

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed them.

@taiki1frsh taiki1frsh changed the title [WIP] add spec for x/derivatives add spec for x/derivatives Mar 24, 2023
Copy link
Contributor

@kimurayu45z kimurayu45z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one remaining thing should be added, but others LGTM.


## Liquidity Provider Token
There's dynamic change of the minting and redemption fee rate at this moment. There's the static rate which is defined in the protocol. And, the actual fee rate also consider the difference of asset proportion between target and actual proportion. The static base fee rate can be modified through the governace voting.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plz add something like

mintFeeRate is proportion to max(0, (actualAmountInPool[i] - targetAmount[i]) / targetAmount[i])
redeemFeeRate is proportion to max(0, -(actualAmountInPool[i] - targetAmount[i]) / targetAmount[i])

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, thanks for the content.
Will put it.

By the way, I (and @mkXultra ) are planning to increment those more technical specs hereafter the general spec on text is fixed.

@taiki1frsh taiki1frsh merged commit 055054c into newDevelop Mar 24, 2023
@taiki1frsh taiki1frsh deleted the spec/deriv-taiki branch March 24, 2023 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants