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

feat: add ACs to cover market order collateral check for spot market #2260

Merged
merged 7 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions protocol/0080-SPOT-product_builtin_spot.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ Price-monitoring auctions are still required and should be implemented following
1. If a "sell" order does not trade immediately (or only trades in part), an amount of the base_asset should be transferred to a holding_account to cover the remaining size of the order for the base_asset.(<a name="0080-SPOT-009" href="#0080-SPOT-009">0080-SPOT-009</a>)
1. If a "sell" order incurs fees through trading, the required amount of the quote_asset to cover the fees will be deducted from the total quote_asset resulting from the sale of the base_asset.(<a name="0080-SPOT-010" href="#0080-SPOT-010">0080-SPOT-010</a>)
1. For a "buy" order to be considered valid during continuous trading, the party must have a sufficient amount of the `quote_asset` in the `general_account` to cover the value of the trade as well as any possible fees incurred as a result of the order trading immediately (the aggressor).(<a name="0080-SPOT-012" href="#0080-SPOT-012">0080-SPOT-012</a>)
1. For a "buy" market order to be considered valid during continuous trading, the party must have a sufficient amount of the `quote_asset` in the `general_account` to cover the value of the trade as well as any possible fees incurred as a result of the order trading immediately (the aggressor).(<a name="0080-SPOT-024" href="#0080-SPOT-024">0080-SPOT-024</a>)
1. For a "sell" market order to be considered valid during continuous trading, the party must have a sufficient amount of the `base_asset` in the `general_account` to cover the value of the trade as well as any possible fees incurred as a result of the order trading immediately (the aggressor).(<a name="0080-SPOT-025" href="#0080-SPOT-025">0080-SPOT-025</a>)
Jiajia-Cui marked this conversation as resolved.
Show resolved Hide resolved
1. amending order should be rejected when an order is amended such that would trade immediately and the party can't afford none/some of the trades(<a name="0080-SPOT-026" href="#0080-SPOT-026">0080-SPOT-026</a>)
1. order should be rejected when submit a limit order, partly matched, party can't afford the trades.(<a name="0080-SPOT-027" href="#0080-SPOT-027">0080-SPOT-027</a>)
Jiajia-Cui marked this conversation as resolved.
Show resolved Hide resolved
1. order should be rejected when submit a limit order, no match, added to the book, party can't cover the amount that needs to be transferred to the holding account.(<a name="0080-SPOT-028" href="#0080-SPOT-028">0080-SPOT-028</a>)
1. If a "buy" order does not trade immediately (or only trades in part), only the necessary amount of the quote_asset to cover the remaining size of the order should be transferred to a holding_account for the quote_asset.(<a name="0080-SPOT-013" href="#0080-SPOT-013">0080-SPOT-013</a>).
1. If the order is cancelled, funds should be released from the `holding_account` and returned to the `general_account`.(<a name="0080-SPOT-007" href="#0080-SPOT-007">0080-SPOT-007</a>)
1. If the order's size is reduced through an order amendment, funds should be released from the `holding_account` and returned to the `general_account`.(<a name="0080-SPOT-015" href="#0080-SPOT-015">0080-SPOT-015</a>)
Expand Down
7 changes: 6 additions & 1 deletion protocol/features.json
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,12 @@
"0079-TGAP-006",
"0079-TGAP-007",
"0028-GOVE-186",
"0028-GOVE-187"
"0028-GOVE-187",
"0080-SPOT-024",
"0080-SPOT-025",
"0080-SPOT-026",
"0080-SPOT-027",
"0080-SPOT-028"
cdummett marked this conversation as resolved.
Show resolved Hide resolved
]
},
"Spot stop orders": {
Expand Down
Loading