The Trade Object
When Horizon returns information about a trade, it uses the following format:
ATTRIBUTEDATA TYPE
DESCRIPTION
idstring
A unique identifier for this trade.
paging_tokennumber
A cursor value for use in pagination.
ledger_close_timestring
An ISO 8601 formatted string of when the ledger with this trade was closed.
base_accountstring (optional)
The account ID of the base party for this trade.
base_offer_idstring (optional)
The base offer ID. If this offer was immediately and fully consumed, this will be a synethic ID.
base_liquidity_pool_idstring (optional)
The base liquidity pool ID. If this trade was executed against a liquidity pool.
base_amountstring
The amount of the base asset that was moved from
base_account
tocounter_account
.base_asset_typestring
The type for the base asset. Either
native
,credit_alphanum4
, orcredit_alphanum12
.base_asset_codestring
The code for the base asset.
base_asset_issuerstring
The Stellar address of the base asset’s issuer.
counter_accountstring (optional)
The account ID of the base party for this trade.
counter_offer_idstring (optional)
The counter offer ID. If this offer was immediately and fully consumed, this will be a synethic ID.
counter_liquidity_pool_idstring (optional)
The counter liquidity pool ID. If this trade was executed against a liquidity pool.
counter_amountstring
The amount of the counter asset that was moved from
counter_account
tobase_account
.counter_asset_typestring
The type for the counter asset. Either
native
,credit_alphanum4
, orcredit_alphanum12
.counter_asset_codestring
The code for the counter asset.
counter_asset_issuerstring
The Stellar address of the counter asset’s issuer.
priceobject
An object of a number numerator and number denominator that represents the original offer price. To derive the price, divide
n
byd
.n
andd
are represented as strings because they might be 64-bit integers.Show child attributes
nstring
The numerator.
dstring
The denominator.
base_is_sellerboolean
Indicates with party is the seller.