This beta release adds support for Automated Market Makers. For details, you can refer to CAP-38 for XDR changes and this document for detailed changes to the Horizon API. Install it via yarn upgrade stellar-sdk@beta.
Add
-
Introduced a
LiquidityPoolCallBuilderto make calls to a new endpoint: -
Expanded the
TransactionCallBuilder,OperationCallBuilder, andEffectsCallBuilders to apply to specific liquidity pools (#689). This corresponds to the following new endpoints:/liquidity_pools/:id/transactions/liquidity_pools/:id/operations/liquidity_pools/:id/effects
-
Expanded the
TradesCallBuilderto support fetching liquidity pool trades and accepts a newtrade_typefilter (#685):/trades?trade_type={orderbook,liquidity_pools}- A liquidity pool trade contains the following fields:
liquidity_pool_fee_bp: LP fee expressed in basis points, and eitherbase_liquidity_pool_idorcounter_liquidity_pool_id
-
Added new effects related to liquidity pools (#690):
DepositLiquidityEffectWithdrawLiquidityEffectLiquidityPoolTradeEffectLiquidityPoolCreatedEffectLiquidityPoolRemovedEffectLiquidityPoolRevokedEffect
-
Added new responses related to liquidity pool operations (#692):
DepositLiquidityOperationResponseWithdrawLiquidityOperationResponse
Updates
-
Updated the underlying
stellar-baselibrary to v6.0.1 to include CAP-38 changes (#681). -
Updated various developer dependencies to secure versions (#671).
-
Updated
AccountResponseto include liquidity pool shares in itsbalancesfield (#688). -
Updated
AccountCallBuilderto allow filtering based on participation in a certain liquidity pool (#688), corresponding to the following new filter:/accounts?reserves=[...list of assets...]
-
Updated
RevokeSponsorshipOperationResponseto contain an optional attributetrustline_liquidity_pool_id, for when a liquidity pool trustline is revoked (#690).
Breaking changes
-
A
TradeRecordcan now correspond to two different types of trades and has changed (#685):Orderbook(the existing structure)counter_offer_idandbase_offer_idonly show up in these records- the redundant
offer_idfield was removed; it matchesbase_offer_id
LiquidityPool(new)base_accountxorcounter_accountwill appear in these records
pricefields changed fromnumbers tostrings- The links to
baseandcountercan now point to either an account or a liquidity pool
-
An account's
balancesarray can now include a new type (#688):asset_typecan now beliquidity_pool_shares- The following fields are not included in pool share balances:
buying_liabilitiesselling_liabilitiesasset_codeasset_issue
-
The
ChangeTrustOperationResponsehas changed (#688, #692):asset_typecan now beliquidity_pool_sharesasset_code,asset_issuer, andtrusteeare now optionalliquidity_pool_idis a new optional field
-
The trustline effects (
TrustlineCreated,TrustlineUpdated,TrustlineRevoked) have changed (#690):- the asset type can now be
liquidity_pool_shares - they can optionally include a
liquidity_pool_id
- the asset type can now be
-
Trustline sponsorship effects (
TrustlineSponsorshipCreated,TrustlineSponsorshipUpdated,TrustlineSponsorshipRemoved) have been updated (#690):- the
assetfield is now optional, and is replaced by - the
liquidity_pool_idfield for liquidity pools
- the