Skip to content

Commit

Permalink
docs: move price quote data types from zoe to price-authority
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed Mar 22, 2024
1 parent 2d954f3 commit a5ea0a6
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
35 changes: 35 additions & 0 deletions main/reference/zoe-api/price-authority.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,38 @@ const quote = E(PriceAuthority).mutableQuoteWhenLTE(
AmountMath.make(brands.Out, 974n),
);
```

## MutableQuote

A **MutableQuote** represents a statement from a **[PriceAuthority](./price-authority)** as to the
current price level at a particular time. The significant content (prices
and time) is packaged in the **[Amount](/reference/ertp-api/ertp-data-types#amount)**, and repeated
in the **[Payment](/reference/ertp-api/payment)** for veracity.

**MutableQuotes** should be used when you expect to make multiple calls, replacing the trigger
value. If you just need a single quote, and won't change the trigger level, you should use
**PriceQuotes**.

A **MutableQuote** is an **Amount**-**Payment** pair, where the **Amount** is also the current
balance of the **Payment**.

## PriceQuote

A **PriceQuote** represents a statement from a **[PriceAuthority](./price-authority)** as to the
current price level at a particular time. The significant content (prices
and time) is packaged in the **[Amount](/reference/ertp-api/ertp-data-types#amount)** and repeated
in the **[Payment](/reference/ertp-api/payment)** for veracity.
A **PriceQuote** is an **Amount**-**Payment** pair, where the **Amount** is also the current
balance of the **Payment**.

```js
const { quoteAmount, quotePayment } = priceQuote;
```

**PriceQuotes** are returned in two forms:

- **PriceDescription**
- Always includes **amountIn**, **amountOut**, the quote's **Timestamp**,
and the **TimerService** the **Timestamp** is relative to.
- **PriceDescription** wrapped as a **QuoteAuthority** issued payment.
- This lets quotes be shared in a format letting others verify the time and values.
35 changes: 0 additions & 35 deletions main/reference/zoe-api/zoe-data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,45 +87,10 @@ const paymentKeywordRecord = {
};
```

## MutableQuote

A **MutableQuote** represents a statement from a **[PriceAuthority](./price-authority)** as to the
current price level at a particular time. The significant content (prices
and time) is packaged in the **[Amount](/reference/ertp-api/ertp-data-types#amount)**, and repeated
in the **[Payment](/reference/ertp-api/payment)** for veracity.

**MutableQuotes** should be used when you expect to make multiple calls, replacing the trigger
value. If you just need a single quote, and won't change the trigger level, you should use
**PriceQuotes**.

A **MutableQuote** is an **Amount**-**Payment** pair, where the **Amount** is also the current
balance of the **Payment**.

## ParsableNumber

A **ParsableNumber** is defined as a **bigint**, **number**, or **string**.

## PriceQuote

A **PriceQuote** represents a statement from a **[PriceAuthority](./price-authority)** as to the
current price level at a particular time. The significant content (prices
and time) is packaged in the **[Amount](/reference/ertp-api/ertp-data-types#amount)** and repeated
in the **[Payment](/reference/ertp-api/payment)** for veracity.
A **PriceQuote** is an **Amount**-**Payment** pair, where the **Amount** is also the current
balance of the **Payment**.

```js
const { quoteAmount, quotePayment } = priceQuote;
```

**PriceQuotes** are returned in two forms:

- **PriceDescription**
- Always includes **amountIn**, **amountOut**, the quote's **Timestamp**,
and the **TimerService** the **Timestamp** is relative to.
- **PriceDescription** wrapped as a **QuoteAuthority** issued payment.
- This lets quotes be shared in a format letting others verify the time and values.

## Ratio

**Ratios** are pass-by-value records that consist of a
Expand Down

0 comments on commit a5ea0a6

Please sign in to comment.