Skip to main content

History Trades

PropertyConfiguration
Primary Key(s)
Natural Key(s)history_operation_id, order, ledger_closed_at
Partition Field(s)batch_run_date (MONTH partition)
Clustered Field(s)trade_type, selling_asset_id, buying_asset_id
Documentationdbt docs

Column Details

NameDescriptionData TypeDomain ValuesRequired?Notes
history_operation_idThe operation id associated with the executed trade. The total amount traded in an operation can be broken up into multiple smaller trades spread across multiple orders by multiple partiesintegerYesThere is a many-to-one relationship for history_operation_id with the history_operations table.
orderThe sequential number assigned to the portion of a trade that is executed within an operation. The history_operation_id and order number together represent a unique trade segmentintegerYes
ledger_closed_atThe timestamp in UTC when the ledger with this trade was closedtimestampYes
selling_account_addressThe account address of the selling partystringNo
selling_asset_codeThe 4 or 12 character code of the sold asset within a tradestringNoAsset codes have no guarantees of uniqueness. The combination of asset code, issuer, and type represents a distinct asset
selling_asset_issuerThe account address of the original asset issuer for the sold asset within a tradestringNo
selling_asset_typeThe identifier for type of asset code used for the sold asset within the tradestring
  • credit_alphanum4
  • credit_alphanum12
  • native
YesXLM is the native asset to the network. XLM has no asset code or issuer representation and will instead be displayed with an asset type of 'native'
selling_amountThe amount of sold asset that was moved from the seller account to the buyer account, reported in terms of the sold amountfloatYes
buying_account_addressThe account address of the buying partystringNo
buying_asset_codeThe 4 or 12 character code of the bought asset within a tradestringNoAsset codes have no guarantees of uniqueness. The combination of asset code, issuer, and type represents a distinct asset
buying_asset_issuerThe account address of the original asset issuer for the bought asset within a tradestringNo
buying_asset_typeThe identifier for type of asset code used for the bought asset within the tradestring
  • credit_alphanum4
  • credit_alphanum12
  • native
YesXLM is the native asset to the network. XLM has no asset code or issuer representation and will instead be displayed with an asset type of 'native'
buying_amountThe amount of purchased asset that was moved from the seller account into the buying account, reported in terms of the bought assetfloatYes
price_nThe price ratio of the sold asset: bought asset. When taken with price_d, the price can be calculated by price_n/price_dintegerNo
price_dThe price ratio of the sold asset: bought asset. When taken with price_n, the price can be calculated by price_n/price_dintegerNo
selling_offer_idThe offer ID in the orderbook of the selling offer. If this offer was immediately and fully consumed, this will be a synthetic ID.integerNo
buying_offer_idThe offer ID in the orderbook of the buying offer. If this offer was immediately and fully consumed, this will be a synthetic ID.integerNo
batch_idString representation of the run id for a given DAG in Airflow. Takes the form of "scheduled__<batch_end_date>-<dag_alias>". Batch ids are unique to the batch and help with monitoring and rerun capabilitiesstringNo
batch_run_dateThe start date for the batch interval. When taken with the date in the batch_id, the date represents the interval of ledgers processed. The batch run date can be seen as a proxy of closed_at for a ledger.datetimeNoThe table is partitioned on batch_run_date. It is recommended to always include the batch_run_date in the filter if possible to help reduce query cost.
batch_insert_tsThe timestamp in UTC when a batch of records was inserted into the database. This field can help identify if a batch executed in real time or as part of a backfilltimestampNo
selling_liquidity_pool_idThe unique identifier for a liquidity pool if the trade was executed against a liquidity pool instead of the orderbookstringNo
liquidity_pool_feeThe percentage fee (in basis points) of the total fee collected by the liquidity pool for executing the trade. The fee is pooled and distributed back to liquidity pool shareholders to incentivize users to stake money in the pool.integer30NoLiquidity pool fees can only change with protocol changes to the network itself
trade_typeIndicates whether the trade was executed against the orderbook (decentralized exchange) or liquidity poolinteger
  • 1 - Decentralized Exchange Trade
  • 2 - Liquidity Pool Trade
No
rounding_slippageApplies to liquidity pool trades only. With fractional amounts of an asset traded, the network must round a fraction to the nearest whole number. This can cause the trade to "slip" price by a percentage compared with the original offer. Rounding slippage reports the percentage that dust trades slip before executing.integerNoDefaults to 1. Rounding Slippage is always unprofitable for the trader and is not a valid way to try and extract more value from the network.
seller_is_exactIndicates whether the buying or selling party trade was impacted by rounding slippage. If true, the buyer was impacted. If false, the seller was impactedbooleanNo
selling_asset_idUnique identifier for selling_asset_code, selling_asset_issuerintegerNo
buying_asset_idUnique identifier for buying_asset_code, buying_asset_issuerintegerNo