Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Commit

Permalink
Adding liquidity pool docs (#564)
Browse files Browse the repository at this point in the history
* WIP -- adding liquidity pool docs

* Fill in the liquidity pool resource examples

* Update accounts and trades for AMMS

* Added liquidity pool effects

* Add docs on liquidity pool deposit/withdraw operations

* WIP placeholder for Glossary: Liquidity Pool

* WIP -- placeholder text for liquidity pools index

* add liquiditypools resource metadata.json

* Update content/api/resources/liquiditypools/list.mdx

Co-authored-by: George <Shaptic@users.noreply.github.com>

* Update content/api/resources/liquiditypools/operations.mdx

Co-authored-by: George <Shaptic@users.noreply.github.com>

* s/total number of records/maximum number of records/g

* Review feedback

* Add /liquidity_pools/{pool_id}/trades endpoint

* make sure trade->price is always strings

Co-authored-by: George <Shaptic@users.noreply.github.com>
  • Loading branch information
Paul Bellamy and Shaptic authored Oct 5, 2021
1 parent 95cd597 commit 03682d4
Show file tree
Hide file tree
Showing 39 changed files with 1,476 additions and 75 deletions.
12 changes: 11 additions & 1 deletion content/api/aggregations/order-books/single.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ When filtering for a specific order book, you must use use all six of these argu

<Endpoint>


| | |
| --- | --- |
| GET | /order_book?selling_asset_type={native,credit_alphanum4,credit_alphanum12}&selling_asset_issuer={:account_id}&selling_asset_code{:asset_code}&buying_asset_type={native,credit_alphanum4,credit_alphanum12}&buying_asset_issuer={:account_id}&buying_asset_code{:asset_code}&limit={1-200} |

</Endpoint>


<AttributeTable>


- ARGUMENT
- REQUIRED
- DESCRIPTION
Expand All @@ -45,12 +48,14 @@ When filtering for a specific order book, you must use use all six of these argu
- The code for the asset being bought (counter asset). Required if the `buying_asset_type` is not `native`.
- limit
- optional
- The total number of records returned. The limit can range from 1 to 200—an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 20 for order books.
- The maximum number of records returned. The limit can range from 1 to 200—an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 20 for order books.

</AttributeTable>


<CodeExample title="Example Request">


```curl
curl "https://horizon.stellar.org/order_book?selling_asset_type=native&buying_asset_type=credit_alphanum4&buying_asset_code=BB1&buying_asset_issuer=GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN&limit=4"
```
Expand Down Expand Up @@ -78,8 +83,10 @@ server

</CodeExample>


<ExampleResponse title="Example Response">


```json
{
"bids": [
Expand Down Expand Up @@ -163,8 +170,10 @@ server

</ExampleResponse>


<CodeExample title="JavaScript Streaming Example">


```js
var StellarSdk = require("stellar-sdk");
var server = new StellarSdk.Server("https://horizon.stellar.org");
Expand All @@ -186,3 +195,4 @@ var es = server
```

</CodeExample>

10 changes: 9 additions & 1 deletion content/api/aggregations/trade-aggregations/list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@ The individual segments are also aligned with multiples of `resolution` since ep

<Endpoint>


| | |
| --- | --- |
| GET | /trade_aggregations?start_time={:start_time}&end_time={:end_time}&resolution={:resolution}&offset={:offset}&base_asset_type={native,credit_alphanum4,credit_alphanum12}&base_asset_issuer={:account_id}&base_asset_code{:asset_code}&counter_asset_type={native,credit_alphanum4,credit_alphanum12}&counter_asset_issuer={:account_id}&counter_asset_code{:asset_code}&order={asc,desc}&limit={1-200} |

</Endpoint>


<AttributeTable>


- ARGUMENT
- REQUIRED
- DESCRIPTION
Expand Down Expand Up @@ -64,12 +67,14 @@ The individual segments are also aligned with multiples of `resolution` since ep
- A designation of the order in which records should appear. Options include `asc`(ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`.
- limit
- optional
- The total number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10.
- The maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10.

</AttributeTable>


<CodeExample title="Example Request">


```curl
curl "https://horizon.stellar.org/trade_aggregations?base_asset_type=native&counter_asset_code=EURT&counter_asset_issuer=GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S&counter_asset_type=credit_alphanum4&resolution=3600000&start_time=1582156800000&end_time=1582178400000"
```
Expand Down Expand Up @@ -101,8 +106,10 @@ server

</CodeExample>


<ExampleResponse title="Example Response">


```json
{
"_links": {
Expand Down Expand Up @@ -178,3 +185,4 @@ server
```

</ExampleResponse>

10 changes: 9 additions & 1 deletion content/api/introduction/pagination/page-arguments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ import { CodeExample } from "components/CodeExample";

<Endpoint>


| | |
| --- | ---------------------------------------------------------------- |
| GET | /{endpoint}?cursor={paging_token}&order={asc,desc}&limit={1-200} |

</Endpoint>


<AttributeTable>


- ARGUMENT
- REQUIRED?
- DESCRIPTION
Expand All @@ -29,12 +32,14 @@ import { CodeExample } from "components/CodeExample";
- A designation of the order in which records should appear. Options include `asc`(ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`.
- limit
- optional
- The total number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10.
- The maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10.

</AttributeTable>


<CodeExample title="Example Request">


```curl
curl "https://horizon.stellar.org/ledgers/26478723/operations?cursor=113725249324879872&limit=5&order=asc"
```
Expand All @@ -60,8 +65,10 @@ server

</CodeExample>


<ExampleResponse title="Example Response">


```json
{
"_links": {
Expand Down Expand Up @@ -268,3 +275,4 @@ server
```

</ExampleResponse>

12 changes: 11 additions & 1 deletion content/api/resources/accounts/effects.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ Streaming mode allows you to listen for new effects for this account as they are

<Endpoint>


| | |
| --- | --- |
| GET | /accounts/:account_id/effects?cursor={paging_token}&order={asc,desc}&limit={1-200} |

</Endpoint>


<AttributeTable>


- ARGUMENT
- REQUIRED
- DESCRIPTION
Expand All @@ -36,12 +39,14 @@ Streaming mode allows you to listen for new effects for this account as they are
- A designation of the order in which records should appear. Options include `asc`(ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`.
- limit
- optional
- The total number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10.
- The maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10.

</AttributeTable>


<CodeExample title="Example Request">


```curl
curl "https://horizon.stellar.org/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/effects?order=desc&limit=4"
```
Expand All @@ -64,8 +69,10 @@ server

</CodeExample>


<ExampleResponse title="Example Response">


```json
{
"_links": {
Expand Down Expand Up @@ -188,8 +195,10 @@ server

</ExampleResponse>


<CodeExample title="JavaScript Streaming Example">


```js
var StellarSdk = require("stellar-sdk");
var server = new StellarSdk.Server("https://horizon.stellar.org");
Expand All @@ -206,3 +215,4 @@ var es = server
```

</CodeExample>

5 changes: 4 additions & 1 deletion content/api/resources/accounts/list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ This endpoint lists accounts by one of three filters: `signer`, `asset`, or `spo
- signer
- string (optional)
- Account ID of the signer. Every account in the response will have the given account ID as a signer.
- liquidity_pool
- string (optional)
- With this parameter, the results will include only accounts which have trustlines to the specified liquidity pool.
- cursor
- string (optional)
- A number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record.
Expand All @@ -43,7 +46,7 @@ This endpoint lists accounts by one of three filters: `signer`, `asset`, or `spo
- A designation of the order in which records should appear. Options include `asc`(ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`.
- limit
- integer (optional)
- The total number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10.
- The maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10.

</AttributeTable>

Expand Down
6 changes: 3 additions & 3 deletions content/api/resources/accounts/object.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@ When Horizon returns information about an account, it uses the following format:
- string
- The number of units of an asset held by this account.
- buying_liabilities
- string
- string (optional)
- The sum of all buy offers owned by this account for this asset.
- selling_liabilities
- string
- string (optional)
- The sum of all sell offers owned by this account for this asset.
- limit
- number (optional)
- The maximum amount of this asset that this account is willing to accept. Specified when opening a trustline.
- asset_type
- string
- Either `native`, `credit_alphanum4`, or `credit_alphanum12`.
- Either `native`, `credit_alphanum4`, `credit_alphanum12`, or `liquidity_pool_shares`.
- asset_code
- string (optional)
- The code for this asset.
Expand Down
12 changes: 11 additions & 1 deletion content/api/resources/accounts/offers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ Streaming mode allows you to listen for new offers for this account as they are

<Endpoint>


| | |
| --- | --- |
| GET | /accounts/:account_id/offers?cursor={paging_token}&order={asc,desc}&limit={1-200} |

</Endpoint>


<AttributeTable>


- ARGUMENT
- REQUIRED
- DESCRIPTION
Expand All @@ -36,12 +39,14 @@ Streaming mode allows you to listen for new offers for this account as they are
- A designation of the order in which records should appear. Options include `asc`(ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`.
- limit
- optional
- The total number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10.
- The maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10.

</AttributeTable>


<CodeExample title="Example Request">


```curl
curl "https://horizon.stellar.org/accounts/GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K/offers"
```
Expand All @@ -64,8 +69,10 @@ server

</CodeExample>


<ExampleResponse title="Example Response">


```json
{
"_links": {
Expand Down Expand Up @@ -146,8 +153,10 @@ server

</ExampleResponse>


<CodeExample title="JavaScript Streaming Example">


```js
var StellarSdk = require("stellar-sdk");
var server = new StellarSdk.Server("https://horizon.stellar.org");
Expand All @@ -164,3 +173,4 @@ var es = server
```

</CodeExample>

12 changes: 11 additions & 1 deletion content/api/resources/accounts/operations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ Streaming mode allows you to listen for new operations for this account as they

<Endpoint>


| | |
| --- | --- |
| GET | /accounts/:account_id/operations?cursor={paging_token}&order={asc,desc}&limit={1-200}&include_failed{true,false}&join={transactions} |

</Endpoint>


<AttributeTable>


- ARGUMENT
- REQUIRED
- DESCRIPTION
Expand All @@ -36,7 +39,7 @@ Streaming mode allows you to listen for new operations for this account as they
- A designation of the order in which records should appear. Options include `asc`(ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`.
- limit
- optional
- The total number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10.
- The maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10.
- include_failed
- optional
- Set to true to include failed operations in results. Options include `true` and `false`.
Expand All @@ -46,8 +49,10 @@ Streaming mode allows you to listen for new operations for this account as they

</AttributeTable>


<CodeExample title="Example Request">


```curl
curl "https://horizon.stellar.org/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/operations?limit=3"
```
Expand All @@ -70,8 +75,10 @@ server

</CodeExample>


<ExampleResponse title="Example Response">


```json
{
"_links": {
Expand Down Expand Up @@ -188,8 +195,10 @@ server

</ExampleResponse>


<CodeExample title="JavaScript Streaming Example">


```js
var StellarSdk = require("stellar-sdk");
var server = new StellarSdk.Server("https://horizon.stellar.org");
Expand All @@ -206,3 +215,4 @@ var es = server
```

</CodeExample>

Loading

0 comments on commit 03682d4

Please sign in to comment.