For AI agents: an LLM-friendly Markdown version of every page is available by appending .md to its URL or by sending an Accept: text/markdown request header. The full documentation index is at https://www.ankr.com/docs/llms.txt
Skip to main content

Stellar — Ledgers, Liquidity pools

API reference for Stellar. All methods ->

GET /ledgers/{sequence}/transactions

Retrieves transactions of a particular ledger.

This endpoint represents successful transactions in a given ledger.

Parameters

  • sequence (integer; path; required): the sequence number of a specific ledger.
  • cursor (integer; query): a number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.
  • order (string; query): 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; query): 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 (boolean; query): set to true to include failed operations in results. Options include true and false.

Returns

{
"_links": {
"self": {
"href": "string",
"templated": true
},
"next": {
"href": "string",
"templated": true
},
"prev": {
"href": "string",
"templated": true
}
},
"_embedded": {
"records": [
{
"memo": "string",
"_links": {
"self": {
"href": "string",
"templated": true
},
"account": {
"href": "string",
"templated": true
},
"ledger": {
"href": "string",
"templated": true
},
"operations": {
"href": "string",
"templated": true
},
"effects": {
"href": "string",
"templated": true
},
"precedes": {
"href": "string",
"templated": true
},
"succeeds": {
"href": "string",
"templated": true
},
"transaction": {
"href": "string",
"templated": true
}
},
"id": "string",
"paging_token": "string",
"successful": true,
"hash": "string",
"ledger": 0,
"created_at": "string",
"source_account": "string",
"account_muxed": "string",
"account_muxed_id": "string",
"source_account_sequence": "string",
"fee_account": "string",
"fee_account_muxed": "string",
"fee_account_muxed_id": "string",
"fee_charged": "string",
"max_fee": "string",
"operation_count": 0,
"envelope_xdr": "string",
"result_xdr": "string",
"result_meta_xdr": "string",
"fee_meta_xdr": "string",
"memo_type": "string",
"signatures": [
"string"
],
"valid_after": "string",
"valid_before": "string",
"preconditions": {
"timebounds": {
"min_time": "string",
"max_time": "string"
},
"ledgerbounds": {
"min_ledger": "string",
"max_ledger": "string"
},
"min_account_sequence": "string",
"min_account_sequence_age": "string",
"min_account_sequence_ledger_gap": 0,
"extra_signers": [
"string"
]
},
"fee_bump_transaction": {
"hash": "string",
"signatures": [
"string"
]
},
"inner_transaction": {
"hash": "string",
"signatures": [
"string"
],
"max_fee": "string"
}
}
]
}
}

Request example

curl https://rpc.ankr.com/http/stellar_horizon/ledgers/{sequence}/transactions{?cursor,order,limit,include_failed}

Response example

{
"_links": {
"self": {
"href": "https://rpc.ankr.com/ledgers/27147222/transactions?cursor=\u0026limit=1\u0026order=asc"
},
"next": {
"href": "https://rpc.ankr.com/ledgers/27147222/transactions?cursor=116596430667255808\u0026limit=1\u0026order=asc"
},
"prev": {
"href": "https://rpc.ankr.com/ledgers/27147222/transactions?cursor=116596430667255808\u0026limit=1\u0026order=desc"
}
},
"_embedded": {
"records": [
{
"memo": "FadBcV0owHrsLQif/V2TxZKGA2YiX+MoifI7oB/UjJM=",
"_links": {
"self": {
"href": "https://rpc.ankr.com/transactions/3a644389bbec63dd2b107a03c16711563fc549daa7b7f56f951a2e470f81f2e0"
},
"account": {
"href": "https://rpc.ankr.com/accounts/GBKTEASNXABG2NC4TY6N3IA5UFC6YW53Y4KTIKY3CUEKQ2W5EIYRMYVB"
},
"ledger": {
"href": "https://rpc.ankr.com/ledgers/27147222"
},
"operations": {
"href": "https://rpc.ankr.com/transactions/3a644389bbec63dd2b107a03c16711563fc549daa7b7f56f951a2e470f81f2e0/operations{?cursor,limit,order}",
"templated": true
},
"effects": {
"href": "https://rpc.ankr.com/transactions/3a644389bbec63dd2b107a03c16711563fc549daa7b7f56f951a2e470f81f2e0/effects{?cursor,limit,order}",
"templated": true
},
"precedes": {
"href": "https://rpc.ankr.com/transactions?order=asc\u0026cursor=116596430667255808"
},
"succeeds": {
"href": "https://rpc.ankr.com/transactions?order=desc\u0026cursor=116596430667255808"
},
"transaction": {
"href": "https://rpc.ankr.com/transactions/3a644389bbec63dd2b107a03c16711563fc549daa7b7f56f951a2e470f81f2e0"
}
},
"id": "3a644389bbec63dd2b107a03c16711563fc549daa7b7f56f951a2e470f81f2e0",
"paging_token": "116596430667255808",
"successful": true,
"hash": "3a644389bbec63dd2b107a03c16711563fc549daa7b7f56f951a2e470f81f2e0",
"ledger": 27147222,
"created_at": "2019-12-06T23:05:38Z",
"source_account": "GBKTEASNXABG2NC4TY6N3IA5UFC6YW53Y4KTIKY3CUEKQ2W5EIYRMYVB",
"source_account_sequence": "113943107245989112",
"fee_account": "GBKTEASNXABG2NC4TY6N3IA5UFC6YW53Y4KTIKY3CUEKQ2W5EIYRMYVB",
"fee_charged": "100",
"max_fee": "100",
"operation_count": 1,
"envelope_xdr": "AAAAAFUyAk24Am00XJ483aAdoUXsW7vHFTQrGxUIqGrdIjEWAAAAZAGUzqcAAFz4AAAAAQAAAAAAAAAAAAAAAAAAAAAAAAADFadBcV0owHrsLQif/V2TxZKGA2YiX+MoifI7oB/UjJMAAAABAAAAAQAAAADhZHiqD/Q3uSTgjYEWGVRfCCHYvFmeqJU12G9SkzJYEQAAAAEAAAAAB77j4CQxLlm5aPrq/PDwFhGNs2ldqbdCZwkSfzXhUhYAAAABTk9ETAAAAAB1jYLXrFzNBOWCoPnZSHI3PJAhHtc1TrCaiPuZwSf5pgAAAAAAAABNAAAAAAAAAALw9Tl2AAAAQLSLnL3XT3F6dq5m2WHZ7tH3HBrK/e+p2G7Hrl3WXQToUsgxKIRH6bhHT/mIWwnrfLZ9nlVjMCFoZPqVKrI2lgLdIjEWAAAAQCrZ9IbjDAB408VgQaqNpwX8hXr/OUsoEexkWGkN9PjcBG2nf4bKWdbjiaqHZ+LrvM+DdmhxtA3L9bzmCie8NgA=",
"result_xdr": "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAA=",
"result_meta_xdr": "AAAAAgAAAAIAAAADAZ471gAAAAAAAAAAVTICTbgCbTRcnjzdoB2hRexbu8cVNCsbFQioat0iMRYAAAAAB5tToAGUzqcAAFz3AAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAZ471gAAAAAAAAAAVTICTbgCbTRcnjzdoB2hRexbu8cVNCsbFQioat0iMRYAAAAAB5tToAGUzqcAAFz4AAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAABAAAAAMBnju+AAAAAQAAAAAHvuPgJDEuWblo+ur88PAWEY2zaV2pt0JnCRJ/NeFSFgAAAAFOT0RMAAAAAHWNgtesXM0E5YKg+dlIcjc8kCEe1zVOsJqI+5nBJ/mmAAAAAAAIP38ASptjhEiAAAAAAAEAAAAAAAAAAAAAAAEBnjvWAAAAAQAAAAAHvuPgJDEuWblo+ur88PAWEY2zaV2pt0JnCRJ/NeFSFgAAAAFOT0RMAAAAAHWNgtesXM0E5YKg+dlIcjc8kCEe1zVOsJqI+5nBJ/mmAAAAAAAIP8wASptjhEiAAAAAAAEAAAAAAAAAAAAAAAMBnjvVAAAAAQAAAADhZHiqD/Q3uSTgjYEWGVRfCCHYvFmeqJU12G9SkzJYEQAAAAFOT0RMAAAAAHWNgtesXM0E5YKg+dlIcjc8kCEe1zVOsJqI+5nBJ/mmAAAALEhqMpZ//////////wAAAAEAAAAAAAAAAAAAAAEBnjvWAAAAAQAAAADhZHiqD/Q3uSTgjYEWGVRfCCHYvFmeqJU12G9SkzJYEQAAAAFOT0RMAAAAAHWNgtesXM0E5YKg+dlIcjc8kCEe1zVOsJqI+5nBJ/mmAAAALEhqMkl//////////wAAAAEAAAAAAAAAAAAAAAA=",
"fee_meta_xdr": "AAAAAgAAAAMBnjvKAAAAAAAAAABVMgJNuAJtNFyePN2gHaFF7Fu7xxU0KxsVCKhq3SIxFgAAAAAHm1QEAZTOpwAAXPcAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEBnjvWAAAAAAAAAABVMgJNuAJtNFyePN2gHaFF7Fu7xxU0KxsVCKhq3SIxFgAAAAAHm1OgAZTOpwAAXPcAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==",
"memo_type": "hash",
"signatures": [
"tIucvddPcXp2rmbZYdnu0fccGsr976nYbseuXdZdBOhSyDEohEfpuEdP+YhbCet8tn2eVWMwIWhk+pUqsjaWAg==",
"Ktn0huMMAHjTxWBBqo2nBfyFev85SygR7GRYaQ30+NwEbad/hspZ1uOJqodn4uu8z4N2aHG0Dcv1vOYKJ7w2AA=="
],
"valid_after": "1970-01-01T00:00:00Z",
"preconditions": {
"timebounds": {
"min_time": "0"
}
}
}
]
}
}

GET /ledgers/{sequence}/operations

Retrieves operations of a particular ledger.

This endpoint returns successful operations in a specific ledger.

Parameters

  • sequence (integer; path; required): the sequence number of a specific ledger.
  • cursor (integer; query): a number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.
  • order (string; query): 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; query): 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 (boolean; query): set to true to include failed operations in results. Options include true and false.
  • join (any; query): set to transactions to include the transactions which created each of the operations in the response.

Returns

{
"_links": {
"effects": {
"href": "string",
"templated": true
},
"precedes": {
"href": "string",
"templated": true
},
"self": {
"href": "string",
"templated": true
},
"succeds": {
"href": "string",
"templated": true
},
"transaction": {
"href": "string",
"templated": true
}
},
"id": "string",
"paging_token": "string",
"type_i": 0,
"type": "create_account"
}

Request example

curl https://rpc.ankr.com/http/stellar_horizon/ledgers/{sequence}/operations{?cursor,order,limit,include_failed,join}

Response example

{
"_links": {
"self": {
"href": "https://rpc.ankr.com/ledgers/27147222/operations?cursor=\u0026limit=1\u0026order=asc"
},
"next": {
"href": "https://rpc.ankr.com/ledgers/27147222/operations?cursor=116596430667255809\u0026limit=1\u0026order=asc"
},
"prev": {
"href": "https://rpc.ankr.com/ledgers/27147222/operations?cursor=116596430667255809\u0026limit=1\u0026order=desc"
}
},
"_embedded": {
"records": [
{
"_links": {
"self": {
"href": "https://rpc.ankr.com/operations/116596430667255809"
},
"transaction": {
"href": "https://rpc.ankr.com/transactions/3a644389bbec63dd2b107a03c16711563fc549daa7b7f56f951a2e470f81f2e0"
},
"effects": {
"href": "https://rpc.ankr.com/operations/116596430667255809/effects"
},
"succeeds": {
"href": "https://rpc.ankr.com/effects?order=desc\u0026cursor=116596430667255809"
},
"precedes": {
"href": "https://rpc.ankr.com/effects?order=asc\u0026cursor=116596430667255809"
}
},
"id": "116596430667255809",
"paging_token": "116596430667255809",
"transaction_successful": true,
"source_account": "GDQWI6FKB72DPOJE4CGYCFQZKRPQQIOYXRMZ5KEVGXMG6UUTGJMBCASH",
"type": "payment",
"type_i": 1,
"created_at": "2019-12-06T23:05:38Z",
"transaction_hash": "3a644389bbec63dd2b107a03c16711563fc549daa7b7f56f951a2e470f81f2e0",
"asset_type": "credit_alphanum4",
"asset_code": "NODL",
"asset_issuer": "GB2Y3AWXVROM2BHFQKQPTWKIOI3TZEBBD3LTKTVQTKEPXGOBE742NODL",
"from": "GDQWI6FKB72DPOJE4CGYCFQZKRPQQIOYXRMZ5KEVGXMG6UUTGJMBCASH",
"to": "GAD35Y7AEQYS4WNZND5OV7HQ6ALBDDNTNFO2TN2CM4ERE7ZV4FJBNXZ6",
"amount": "0.0000077"
}
]
}
}

GET /ledgers/{sequence}/payments

Retrieves payments of a particular ledger.

This endpoint returns all payment-related operations in a specific ledger. Operation types that can be returned by this endpoint include: create_account, payment, path_payment, and account_merge.

Parameters

  • sequence (integer; path; required): the sequence number of a specific ledger.
  • cursor (integer; query): a number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.
  • order (string; query): 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; query): 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 (boolean; query): set to true to include failed operations in results. Options include true and false.
  • join (any; query): set to transactions to include the transactions which created each of the operations in the response.

Returns

{
"_links": {
"self": {
"href": "string",
"templated": true
},
"next": {
"href": "string",
"templated": true
},
"prev": {
"href": "string",
"templated": true
}
},
"_embedded": {
"records": [
{
"_links": {
"self": {
"href": "string",
"templated": true
},
"transaction": {
"href": "string",
"templated": true
},
"effects": {
"href": "string",
"templated": true
},
"succeeds": {
"href": "string",
"templated": true
},
"precedes": {
"href": "string",
"templated": true
}
},
"id": "string",
"paging_token": "string",
"transaction_successful": true,
"source_account": "string",
"type": "payment",
"type_i": "string",
"created_at": "string",
"transaction_hash": "string",
"asset_type": "string",
"asset_issuer": "string",
"from": "string",
"to": "string",
"amount": "string"
}
]
}
}

Request example

curl https://rpc.ankr.com/http/stellar_horizon/ledgers/{sequence}/payments{?cursor,order,limit,include_failed,join}

Response example

{
"_links": {
"self": {
"href": "https://rpc.ankr.com/ledgers/27521176/payments?cursor=\u0026limit=1\u0026order=asc"
},
"next": {
"href": "https://rpc.ankr.com/ledgers/27521176/payments?cursor=118202550867476481\u0026limit=1\u0026order=asc"
},
"prev": {
"href": "https://rpc.ankr.com/ledgers/27521176/payments?cursor=118202550867476481\u0026limit=1\u0026order=desc"
}
},
"_embedded": {
"records": [
{
"_links": {
"self": {
"href": "https://rpc.ankr.com/operations/118202550867476481"
},
"transaction": {
"href": "https://rpc.ankr.com/transactions/971454b84a82baa38afa975e9eb4ff2632821b5a3e7f7993a7e20bbd9d7633ea"
},
"effects": {
"href": "https://rpc.ankr.com/operations/118202550867476481/effects"
},
"succeeds": {
"href": "https://rpc.ankr.com/effects?order=desc\u0026cursor=118202550867476481"
},
"precedes": {
"href": "https://rpc.ankr.com/effects?order=asc\u0026cursor=118202550867476481"
}
},
"id": "118202550867476481",
"paging_token": "118202550867476481",
"transaction_successful": true,
"source_account": "GDQWI6FKB72DPOJE4CGYCFQZKRPQQIOYXRMZ5KEVGXMG6UUTGJMBCASH",
"type": "payment",
"type_i": 1,
"created_at": "2019-12-30T22:35:49Z",
"transaction_hash": "971454b84a82baa38afa975e9eb4ff2632821b5a3e7f7993a7e20bbd9d7633ea",
"asset_type": "credit_alphanum4",
"asset_code": "NODL",
"asset_issuer": "GB2Y3AWXVROM2BHFQKQPTWKIOI3TZEBBD3LTKTVQTKEPXGOBE742NODL",
"from": "GDQWI6FKB72DPOJE4CGYCFQZKRPQQIOYXRMZ5KEVGXMG6UUTGJMBCASH",
"to": "GDGJS7AXAUFDZARIRDVZ5V7CFW6XY47WSBE2OVLCCGCDWOE7INKYN3PS",
"amount": "0.0000017"
}
]
}
}

GET /ledgers/{sequence}/effects

Retrieves all effects of a particular ledger.

This endpoint returns the effects of a specific ledger.

Parameters

  • sequence (integer; path; required): the sequence number of a specific ledger.
  • cursor (integer; query): a number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.
  • order (string; query): 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; query): 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.

Returns

{
"_links": {
"self": {
"href": "string",
"templated": true
},
"next": {
"href": "string",
"templated": true
},
"prev": {
"href": "string",
"templated": true
}
},
"_embedded": {
"records": [
{
"_links": {
"operation": {
"href": "string",
"templated": true
},
"succeeds": {
"href": "string",
"templated": true
},
"precedes": {
"href": "string",
"templated": true
}
},
"id": "string",
"paging_token": "string",
"account": "string",
"type": "Account Created",
"type_i": 1,
"created_at": "string"
}
]
}
}

Request example

curl https://rpc.ankr.com/http/stellar_horizon/ledgers/{sequence}/effects{?cursor,order,limit}

Response example

{
"_links": {
"self": {
"href": "https://rpc.ankr.com/ledgers/0/effects?cursor=\u0026limit=1\u0026order=asc"
},
"next": {
"href": "https://rpc.ankr.com/ledgers/0/effects?cursor=211459450643517441-1\u0026limit=1\u0026order=asc"
},
"prev": {
"href": "https://rpc.ankr.com/ledgers/0/effects?cursor=211459450643517441-1\u0026limit=1\u0026order=desc"
}
},
"_embedded": {
"records": [
{
"_links": {
"operation": {
"href": "https://rpc.ankr.com/operations/211459450643517441"
},
"succeeds": {
"href": "https://rpc.ankr.com/effects?order=desc\u0026cursor=211459450643517441-1"
},
"precedes": {
"href": "https://rpc.ankr.com/effects?order=asc\u0026cursor=211459450643517441-1"
}
},
"id": "0211459450643517441-0000000001",
"paging_token": "211459450643517441-1",
"account": "GCV7NQTKV3ZZGC366FYVH2XOSZBOTQIOTHG7JJFJJP2XKCLGEYUZHRRR",
"type": "account_credited",
"type_i": 2,
"created_at": "2023-11-29T10:37:29Z",
"asset_type": "native",
"amount": "0.0251621"
}
]
}
}

Liquidity pools

Liquidity pools provide a simple, non-interactive way to trade large amounts of capital and enable high volumes of trading.

GET /liquidity_pools

Lists all liquidity pools.

This endpoint lists all available liquidity pools.

Parameters

  • reserves (any; query): a comma-separated list of assets in canonical form (Code:IssuerAccountID), to only include liquidity pools which have reserves matching all listed assets.
  • account (any; query): a Stellar account ID, to only include liquidity pools in which this account is participating in (i.e. holds pool shares to).
  • cursor (integer; query): a number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.
  • order (string; query): 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; query): 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.

Returns

{
"_links": {
"self": {
"href": "string",
"templated": true
},
"next": {
"href": "string",
"templated": true
},
"prev": {
"href": "string",
"templated": true
}
},
"_embedded": {
"records": [
{
"id": "string",
"paging_token": "string",
"fee_bp": 0,
"type": "string",
"total_trustlines": "string",
"total_shares": "string",
"reserves": {
"asset": "string",
"amount": "string"
},
"last_modified_ledger": "string",
"last_modified_time": "string"
}
]
}
}

Request example

curl https://rpc.ankr.com/http/stellar_horizon/liquidity_pools{?reserves,account,curson,order,limit}

Response example

{
"_links": {
"self": {
"href": "https://rpc.ankr.com/liquidity_pools?cursor=\u0026limit=1\u0026order=asc"
},
"next": {
"href": "https://rpc.ankr.com/liquidity_pools?cursor=0000a8198b5e25994c1ca5b0556faeb27325ac746296944144e0a7406d501e8a\u0026limit=1\u0026order=asc"
},
"prev": {
"href": "https://rpc.ankr.com/liquidity_pools?cursor=0000a8198b5e25994c1ca5b0556faeb27325ac746296944144e0a7406d501e8a\u0026limit=1\u0026order=desc"
}
},
"_embedded": {
"records": [
{
"_links": {
"self": {
"href": "https://rpc.ankr.com/liquidity_pools/0000a8198b5e25994c1ca5b0556faeb27325ac746296944144e0a7406d501e8a"
},
"transactions": {
"href": "https://rpc.ankr.com/liquidity_pools/0000a8198b5e25994c1ca5b0556faeb27325ac746296944144e0a7406d501e8a/transactions{?cursor,limit,order}",
"templated": true
},
"operations": {
"href": "https://rpc.ankr.com/liquidity_pools/0000a8198b5e25994c1ca5b0556faeb27325ac746296944144e0a7406d501e8a/operations{?cursor,limit,order}",
"templated": true
}
},
"id": "0000a8198b5e25994c1ca5b0556faeb27325ac746296944144e0a7406d501e8a",
"paging_token": "0000a8198b5e25994c1ca5b0556faeb27325ac746296944144e0a7406d501e8a",
"fee_bp": 30,
"type": "constant_product",
"total_trustlines": "1",
"total_shares": "5494.2144063",
"reserves": [
{
"asset": "native",
"amount": "6.3915888"
},
{
"asset": "GOLDBANK001:GDEUQ2MX3YXMITFOTC3CO3GW5V3XE3IVG7JKLZZAOZ7WFYIN256INDUS",
"amount": "6259562.9445306"
}
],
"last_modified_ledger": 49899809,
"last_modified_time": "2024-01-13T13:23:26Z"
}
]
}
}

GET /liquidity_pools/{liquidity_pool_id}

Retrieves a particular liquidity pool.

The single liquidity pool endpoint provides information on a liquidity pool.

Parameters

  • liquidity_pool_id (any; path; required): a unique identifier for this liquidity pool.

Returns

{
"_links": {
"self": {
"href": "string",
"templated": true
},
"transactions": {
"href": "string",
"templated": true
},
"operations": {
"href": "string",
"templated": true
}
},
"id": "string",
"paging_token": "string",
"fee_bp": 0,
"type": "string",
"total_trustlines": "string",
"total_shares": "string",
"reserves": {
"asset": "string",
"amount": "string"
},
"last_modified_ledger": "string",
"last_modified_time": "string"
}

Request example

curl https://rpc.ankr.com/http/stellar_horizon/liquidity_pools/{liquidity_pool_id}

Response example

{
"_links": {
"self": {
"href": "https://rpc.ankr.com/liquidity_pools/67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9"
},
"effects": {
"href": "https://rpc.ankr.com/liquidity_pools/67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9/effects{?cursor,limit,order}",
"templated": true
},
"operations": {
"href": "https://rpc.ankr.com/liquidity_pools/67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9/operations{?cursor,limit,order}",
"templated": true
},
"transactions": {
"href": "https://rpc.ankr.com/liquidity_pools/67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9/transactions{?cursor,limit,order}",
"templated": true
}
},
"id": "67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9",
"paging_token": "113725249324879873",
"fee_bp": 30,
"type": "constant_product",
"total_trustlines": "300",
"total_shares": "5000",
"reserves": [
{
"amount": "1000.0000005",
"asset": "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S"
},
{
"amount": "2000.0000000",
"asset": "PHP:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S"
}
]
}

GET /liquidity_pools/{liquidity_pool_id}/effects

Retrieves effects of a particular liquidity pool.

This endpoint represents effects referencing a given liquidity pool and can be used in streaming mode. Streaming mode allows you to listen for new effects referencing this liquidity pool as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known effect unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream effects created since your request time.

Parameters

  • liquidity_pool_id (any; path; required): a unique identifier for this liquidity pool.
  • cursor (integer; query): a number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.
  • order (string; query): 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; query): 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.

Returns

{
"_links": {
"self": {
"href": "string",
"templated": true
},
"next": {
"href": "string",
"templated": true
},
"prev": {
"href": "string",
"templated": true
}
},
"_embedded": {
"records": [
{
"_links": {
"operation": {
"href": "string",
"templated": true
},
"succeeds": {
"href": "string",
"templated": true
},
"precedes": {
"href": "string",
"templated": true
}
},
"id": "string",
"paging_token": "string",
"account": "string",
"type": "Account Created",
"type_i": 1,
"created_at": "string"
}
]
}
}

Request example

curl https://rpc.ankr.com/http/stellar_horizon/liquidity_pools/{liquidity_pool_id}/effects{?cursor,order,limit}

Response example

{
"_links": {
"self": {
"href": "https://rpc.ankr.com/liquidity_pools/67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9/effects?cursor=&order=asc"
},
"next": {
"href": "https://rpc.ankr.com/liquidity_pools/67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9/effects?cursor=120192370561220608&order=asc"
},
"prev": {
"href": "https://rpc.ankr.com/liquidity_pools/67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9/effects?cursor=120192344791343104&order=desc"
}
},
"_embedded": {
"records": [
{
"_links": {
"operation": {
"href": "https://rpc.ankr.com/operations/3849085266190337"
},
"succeeds": {
"href": "https://rpc.ankr.com/effects?order=desc&cursor=3849085266190337-1"
},
"precedes": {
"href": "https://rpc.ankr.com/effects?order=asc&cursor=3849085266190337-1"
}
},
"id": "0000000012884905986-0000000001",
"paging_token": "12884905986-2",
"account": "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7",
"type": "liquidity_pool_deposited",
"type_i": 81,
"created_at": "2021-11-18T03:15:54Z",
"liquidity_pool": {
"id": "67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9",
"fee_bp": 30,
"type": "constant_product",
"total_trustlines": "300",
"total_shares": "5000",
"reserves": [
{
"amount": "1000.0000005",
"asset": "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S"
},
{
"amount": "2000.0000000",
"asset": "PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP"
}
]
},
"reserves_deposited": [
{
"asset": "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S",
"amount": "2378.0000005"
},
{
"asset": "PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP",
"amount": "983.0000005"
}
],
"shares_received": "1000"
}
]
}
}

GET /liquidity_pools/{liquidity_pool_id}/trades

Retrieves trades of a particular liquidity pool.

This endpoint represents successful trades fulfilled by the given liquidity pool and can be used in streaming mode. Streaming mode allows you to listen for new trades referencing this liquidity pool as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known trade unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream trade created since your request time.

Parameters

  • liquidity_pool_id (any; path; required): a unique identifier for this liquidity pool.
  • cursor (integer; query): a number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.
  • order (string; query): 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; query): 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.

Returns

{
"_links": {
"self": {
"href": "string",
"templated": true
},
"next": {
"href": "string",
"templated": true
},
"prev": {
"href": "string",
"templated": true
}
},
"_embedded": {
"records": [
{
"_links": {
"self": {
"href": "string",
"templated": true
},
"base": {
"href": "string",
"templated": true
},
"counter": {
"href": "string",
"templated": true
},
"operation": {
"href": "string",
"templated": true
}
},
"id": "string",
"paging_token": "string",
"ledger_close_time": "string",
"offer_id": "string",
"trade_type": "string",
"liquidity_pool_fee_bp": 0,
"base_liquidity_pool_id": "string",
"base_offer_id": "string",
"base_account": "string",
"base_amount": "string",
"base_asset_type": "string",
"base_asset_code": "string",
"base_asset_issuer": "string",
"counter_liquidity_pool_id": "string",
"counter_offer_id": "string",
"counter_account": "string",
"counter_amount": "string",
"counter_asset_type": "string",
"counter_asset_code": "string",
"counter_asset_issuer": "string",
"base_is_seller": true,
"price": {
"n": "string",
"d": "string"
}
}
]
}
}

Request example

curl https://rpc.ankr.com/http/stellar_horizon/liquidity_pools/{liquidity_pool_id}/trades{?cursor,order,limit}

Response example

{
"_links": {
"self": {
"href": "https://rpc.ankr.com/liquidity_pools/3b476aff8a406a6ec3b61d5c038009cef85f2ddfaf616822dc4fec92845149b4/trades?cursor=\u0026limit=1\u0026order=asc"
},
"next": {
"href": "https://rpc.ankr.com/liquidity_pools/3b476aff8a406a6ec3b61d5c038009cef85f2ddfaf616822dc4fec92845149b4/trades?cursor=212026605370699777-0\u0026limit=1\u0026order=asc"
},
"prev": {
"href": "https://rpc.ankr.com/liquidity_pools/3b476aff8a406a6ec3b61d5c038009cef85f2ddfaf616822dc4fec92845149b4/trades?cursor=212026605370699777-0\u0026limit=1\u0026order=desc"
}
},
"_embedded": {
"records": [
{
"_links": {
"self": {
"href": ""
},
"base": {
"href": "https://rpc.ankr.com/accounts/GBEI3CDPMFUKZCJ3EFJNGO7UNQSFTKGGCFH6HUXGHLMJ4ML3H7P4Y7R6"
},
"counter": {
"href": "https://rpc.ankr.com/liquidity_pools/3b476aff8a406a6ec3b61d5c038009cef85f2ddfaf616822dc4fec92845149b4"
},
"operation": {
"href": "https://rpc.ankr.com/operations/212026605370699777"
}
},
"id": "212026605370699777-0",
"paging_token": "212026605370699777-0",
"ledger_close_time": "2023-12-08T09:16:26Z",
"trade_type": "liquidity_pool",
"liquidity_pool_fee_bp": 30,
"base_offer_id": "4823712623798087681",
"base_account": "GBEI3CDPMFUKZCJ3EFJNGO7UNQSFTKGGCFH6HUXGHLMJ4ML3H7P4Y7R6",
"base_amount": "9.9125000",
"base_asset_type": "native",
"counter_liquidity_pool_id": "3b476aff8a406a6ec3b61d5c038009cef85f2ddfaf616822dc4fec92845149b4",
"counter_amount": "1701.5904043",
"counter_asset_type": "credit_alphanum4",
"counter_asset_code": "VZT",
"counter_asset_issuer": "GBENYXZDFFR2J4F4DB3YPBBAM244TXYOTIOOUQI5DBT3OKUU4ZJ2M7NO",
"base_is_seller": false,
"price": {
"n": "17015904043",
"d": "99125000"
}
}
]
}
}