diff --git a/protocol/0097-PAPU-protocol_automated_purchases.md b/protocol/0097-PAPU-protocol_automated_purchases.md index a1cb7c8f3..bdf84d16c 100644 --- a/protocol/0097-PAPU-protocol_automated_purchases.md +++ b/protocol/0097-PAPU-protocol_automated_purchases.md @@ -186,3 +186,148 @@ To ensure a market can only ever support one **active** PAP program: - If an automated purchase order is not filled on auction uncrossing, the order is removed from the book automatically (as it is a GFA order) and all earmarked funds returned to the relevant source account. (0097-PAPU-044). - If an automated purchase order is only partially filled on auction uncrossing, the order is removed from the book automatically (as it is a GFA order), any swapped tokens transferred to the correct to account, and the remaining earmarked funds returned to the relevant source account. (0097-PAPU-045). - If an automated purchase order is fully filled on auction uncrossing, all swapped tokens are transferred to the correct to account. (0097-PAPU-046). + +- The following set of ACs assumes a program where the source token matches the base asset of the relevant market. Prices, sizes, and balances are expressed in there scaled integer form: + + Given the decimals: + + - `oracleDecimals=0` + - `baseAssetDecimals=0` + - `quoteAssetDecimals=0` + - `marketPriceDecimals=0` + - `marketPositionDecimals=0` + + If the latest snapshot earmarked `1000` of the base asset and the latest oracle price was `100`. The program will submit a sell order of size `1000` at `100`. When the auction uncrosses at that price, the to account will be credited with `100000` of the quote asset. (0097-PAPU-047). + + Given the decimals: + + - `oracleDecimals=3` + - `baseAssetDecimals=0` + - `quoteAssetDecimals=0` + - `marketPriceDecimals=0` + - `marketPositionDecimals=0` + + If the latest snapshot earmarked `1000` of the base asset and the latest oracle price was `100000`. The program will submit a sell order of size `1000` at `100`. When the auction uncrosses at that price, the to account will be credited with `100000` of the quote asset. (0097-PAPU-048). + + Given the decimals: + + - `oracleDecimals=0` + - `baseAssetDecimals=0` + - `quoteAssetDecimals=0` + - `marketPriceDecimals=3` + - `marketPositionDecimals=0` + + If the latest snapshot earmarked `1000` of the base asset and the latest oracle price was `100`. The program will submit a sell order of size `1000` at `100000`. When the auction uncrosses at that price, the to account will be credited with `100000` of the quote asset. (0097-PAPU-049). + + Given the decimals: + + - `oracleDecimals=0` + - `baseAssetDecimals=0` + - `quoteAssetDecimals=0` + - `marketPriceDecimals=0` + - `marketPositionDecimals=3` + + If the latest snapshot earmarked `1000` of the base asset and the latest oracle price was `100`. The program will submit a sell order of size `1000000` at `100`. When the auction uncrosses at that price, the to account will be credited with `100000` of the quote asset. (0097-PAPU-050). + + Given the decimals: + + - `oracleDecimals=0` + - `baseAssetDecimals=0` + - `quoteAssetDecimals=0` + - `marketPriceDecimals=0` + - `marketPositionDecimals=-3` + + If the latest snapshot earmarked `1000` of the base asset and the latest oracle price was `100`. The program will submit a sell order of size `1` at `100`. When the auction uncrosses at that price, the to account will be credited with `100000` of the quote asset. (0097-PAPU-051). + + Given the decimals: + + - `oracleDecimals=0` + - `baseAssetDecimals=3` + - `quoteAssetDecimals=0` + - `marketPriceDecimals=0` + - `marketPositionDecimals=0` + + If the from account holds `1000000` of the base asset and the latest oracle price was `100`. The program will submit a sell order of size `1000` at `100`. When the auction uncrosses at that price, the to account will be credited with `100000` of the quote asset. (0097-PAPU-052). + + Given the decimals: + + - `oracleDecimals=0` + - `baseAssetDecimals=0` + - `quoteAssetDecimals=3` + - `marketPriceDecimals=0` + - `marketPositionDecimals=0` + + If the from account holds `1000` of the base asset and the latest oracle price was `100`. The program will submit a sell order of size `1000` at `100`. When the auction uncrosses at that price, the to account will be credited with `100000000` of the quote asset. (0097-PAPU-053). + + +- The following set of ACs assumes a program where the source token matches the base asset of the relevant market. Prices, sizes, and balances are expressed in there scaled integer form: + + Given the decimals: + + - `oracleDecimals=0` + - `baseAssetDecimals=0` + - `quoteAssetDecimals=0` + - `marketPriceDecimals=0` + - `marketPositionDecimals=0` + + If the latest snapshot earmarked `1000` of the quote asset and the latest oracle price was `100`. The program will submit a buy order of size `1000` at `100`. When the auction uncrosses at that price, the to account will be credited with `100000` of the base asset. (0097-PAPU-054). + + Given the decimals: + + - `oracleDecimals=3` + - `baseAssetDecimals=0` + - `quoteAssetDecimals=0` + - `marketPriceDecimals=0` + - `marketPositionDecimals=0` + + If the latest snapshot earmarked `1000` of the quote asset and the latest oracle price was `100000`. The program will submit a buy order of size `1000` at `100`. When the auction uncrosses at that price, the to account will be credited with `100000` of the base asset. (0097-PAPU-055). + + Given the decimals: + + - `oracleDecimals=0` + - `baseAssetDecimals=0` + - `quoteAssetDecimals=0` + - `marketPriceDecimals=3` + - `marketPositionDecimals=0` + + If the latest snapshot earmarked `1000` of the quote asset and the latest oracle price was `100`. The program will submit a buy order of size `1000` at `100000`. When the auction uncrosses at that price, the to account will be credited with `100000` of the base asset. (0097-PAPU-056). + + Given the decimals: + + - `oracleDecimals=0` + - `baseAssetDecimals=0` + - `quoteAssetDecimals=0` + - `marketPriceDecimals=0` + - `marketPositionDecimals=3` + + If the latest snapshot earmarked `1000` of the quote asset and the latest oracle price was `100`. The program will submit a buy order of size `1000000` at `100`. When the auction uncrosses at that price, the to account will be credited with `100000` of the base asset. (0097-PAPU-057). + + Given the decimals: + + - `oracleDecimals=0` + - `baseAssetDecimals=0` + - `quoteAssetDecimals=0` + - `marketPriceDecimals=0` + - `marketPositionDecimals=-3` + + If the latest snapshot earmarked `1000` of the quote asset and the latest oracle price was `100`. The program will submit a buy order of size `1` at `100`. When the auction uncrosses at that price, the to account will be credited with `100000` of the base asset. (0097-PAPU-058). + + Given the decimals: + + - `oracleDecimals=0` + - `baseAssetDecimals=3` + - `quoteAssetDecimals=0` + - `marketPriceDecimals=0` + - `marketPositionDecimals=0` + + If the from account holds `1000000` of the quote asset and the latest oracle price was `100`. The program will submit a buy order of size `1000` at `100`. When the auction uncrosses at that price, the to account will be credited with `100000` of the base asset. (0097-PAPU-059). + + Given the decimals: + + - `oracleDecimals=0` + - `baseAssetDecimals=0` + - `quoteAssetDecimals=3` + - `marketPriceDecimals=0` + - `marketPositionDecimals=0` + + If the from account holds `1000` of the quote asset and the latest oracle price was `100`. The program will submit a buy order of size `1000` at `100`. When the auction uncrosses at that price, the to account will be credited with `100000000` of the base asset. (0097-PAPU-060). diff --git a/protocol/features.json b/protocol/features.json index 0b7099adc..6ad345b7c 100644 --- a/protocol/features.json +++ b/protocol/features.json @@ -832,7 +832,21 @@ "0097-PAPU-043", "0097-PAPU-044", "0097-PAPU-045", - "0097-PAPU-046" + "0097-PAPU-046", + "0097-PAPU-047", + "0097-PAPU-048", + "0097-PAPU-049", + "0097-PAPU-050", + "0097-PAPU-051", + "0097-PAPU-052", + "0097-PAPU-053", + "0097-PAPU-054", + "0097-PAPU-055", + "0097-PAPU-056", + "0097-PAPU-057", + "0097-PAPU-058", + "0097-PAPU-059", + "0097-PAPU-060" ] }, "Cancelling Proposals": {