diff --git a/README.md b/README.md index c7a359d..03bd927 100644 --- a/README.md +++ b/README.md @@ -23,14 +23,13 @@ stellar: ``` ### Resources: +- Learn more about Stellar's [Hubble dataset](https://developers.stellar.org/docs/data/hubble) - Learn more about dbt [in the docs](https://docs.getdbt.com/docs/introduction) - Check out [Discourse](https://discourse.getdbt.com/) for commonly asked questions and answers - Join the [chat](https://community.getdbt.com/) on Slack for live discussions and support - Find [dbt events](https://events.getdbt.com) near you - Check out [the blog](https://blog.getdbt.com/) for the latest news on dbt's development and best practices -- Check out [the blog](https://blog.getdbt.com/) for the latest news on dbt's development and best practices - ## Applying Model Tags ### Database / Schema level tags @@ -63,12 +62,12 @@ To add/update a model's snowflake tags, add/modify the `meta` model property und By default, model tags are not pushed to snowflake on each load. You can push a tag update for a model by specifying the `UPDATE_SNOWFLAKE_TAGS` project variable during a run. ``` -dbt run --var '{"UPDATE_SNOWFLAKE_TAGS":True}' -s models/core/core__fact_swaps.sql +dbt run --var '{"UPDATE_SNOWFLAKE_TAGS":True}' -s models/core/core__fact_trades.sql ``` ### Querying for existing tags on a model in snowflake ``` select * -from table(stellar.information_schema.tag_references('stellar.core.fact_blocks', 'table')); +from table(stellar.information_schema.tag_references('stellar.core.fact_ledgers', 'table')); ``` \ No newline at end of file diff --git a/models/descriptions/__overview__.md b/models/descriptions/__overview__.md new file mode 100644 index 0000000..fef8fd9 --- /dev/null +++ b/models/descriptions/__overview__.md @@ -0,0 +1,75 @@ +{% docs __overview__ %} + +# Welcome to the Flipside Crypto's Stellar Models Documentation + +## **What does this documentation cover?** +The documentation included here details the design of Stellar tables and views available via [Flipside Crypto.](https://flipsidecrypto.xyz/) For more information on how these models are built, please see [the github repository.](https://github.com/flipsideCrypto/stellar-models/) + +## **How do I use these docs?** +The easiest way to navigate this documentation is to use the Quick Links below. These links will take you to the documentation for each table, which contains a description, a list of the columns, and other helpful information. + +If you are experienced with dbt docs, feel free to use the sidebar to navigate the documentation, as well as explore the relationships between tables and the logic building them. + +There is more information on how to use dbt docs in the last section of this document. + +## **Quick Links to Table Documentation** + +**Click on the links below to jump to the documentation for each schema.** + +### Core Tables (`stellar`.`CORE`.``) + +**Dimension Tables:** +- [core.dim_assets](https://flipsidecrypto.github.io/stellar-models/#!/model/model.stellar_models.core__dim_assets) + +**Fact Tables:** +- [core.fact_accounts](https://flipsidecrypto.github.io/stellar-models/#!/model/model.stellar_models.core__fact_accounts) +- [core.fact_ledgers](https://flipsidecrypto.github.io/stellar-models/#!/model/model.stellar_models.core__fact_ledgers) +- [core.fact_operations](https://flipsidecrypto.github.io/stellar-models/#!/model/model.stellar_models.core__fact_operations) +- [core.fact_transactions](https://flipsidecrypto.github.io/stellar-models/#!/model/model.stellar_models.core__fact_transactions) + +### DeFi Tables (`stellar`.`DEFI`.``) + +**Fact Tables:** +- [defi.fact_liquidity_pools](https://flipsidecrypto.github.io/stellar-models/#!/model/model.stellar_models.defi__fact_liquidity_pools) +- [defi.fact_trades](https://flipsidecrypto.github.io/stellar-models/#!/model/model.stellar_models.defi__fact_trades) + +## **Data Model Overview** + +These Stellar models are built a few different ways, but the core fact tables are built using three layers of sql models: **bronze, silver, and gold (or core).** + +- Bronze: Data is loaded in from the source as a view +- Silver: All necessary parsing, filtering, de-duping, and other transformations are done here +- Gold (or core): Final views and tables that are available publicly + +The dimension tables are sourced from a variety of on-chain and off-chain sources. + +Convenience views (denoted ez_) are a combination of different fact and dimension tables. These views are built to make it easier to query the data. + +## **Using dbt docs** +### Navigation + +You can use the ```Project``` and ```Database``` navigation tabs on the left side of the window to explore the models in the project. + +### Database Tab + +This view shows relations (tables and views) grouped into database schemas. Note that ephemeral models are *not* shown in this interface, as they do not exist in the database. + +### Graph Exploration + +You can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models. + +On model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the Expand button at the top-right of this lineage pane, you'll be able to see all of the models that are used to build, or are built from, the model you're exploring. + +Once expanded, you'll be able to use the ```--models``` and ```--exclude``` model selection syntax to filter the models in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax). + +Note that you can also right-click on models to interactively filter and explore the graph. + + +### **More information** +- [Flipside](https://flipsidecrypto.xyz/) +- [Velocity](https://app.flipsidecrypto.com/velocity?nav=Discover) +- [Tutorials](https://docs.flipsidecrypto.com/our-data/tutorials) +- [Github](https://github.com/FlipsideCrypto/stellar-models) +- [What is dbt?](https://docs.getdbt.com/docs/introduction) + +{% enddocs %} \ No newline at end of file diff --git a/models/descriptions/account.md b/models/descriptions/account.md new file mode 100644 index 0000000..9bd63a0 --- /dev/null +++ b/models/descriptions/account.md @@ -0,0 +1,3 @@ +{% docs account %} +The account involved in the operation. +{% enddocs %} diff --git a/models/descriptions/account_id.md b/models/descriptions/account_id.md new file mode 100644 index 0000000..e27c922 --- /dev/null +++ b/models/descriptions/account_id.md @@ -0,0 +1,3 @@ +{% docs account_id %} +The address of the account. The address is the account's public key encoded in base32. All account addresses start with a 'G'. +{% enddocs %} diff --git a/models/descriptions/account_muxed.md b/models/descriptions/account_muxed.md new file mode 100644 index 0000000..006ae07 --- /dev/null +++ b/models/descriptions/account_muxed.md @@ -0,0 +1,3 @@ +{% docs account_muxed %} +Muxed account identifier. +{% enddocs %} diff --git a/models/descriptions/account_sequence.md b/models/descriptions/account_sequence.md new file mode 100644 index 0000000..ad14cd3 --- /dev/null +++ b/models/descriptions/account_sequence.md @@ -0,0 +1,3 @@ +{% docs account_sequence %} +Sequence number for the account. +{% enddocs %} diff --git a/models/descriptions/address.md b/models/descriptions/address.md new file mode 100644 index 0000000..ff88479 --- /dev/null +++ b/models/descriptions/address.md @@ -0,0 +1,3 @@ +{% docs address %} +Address for Soroban contract creation. +{% enddocs %} diff --git a/models/descriptions/amount.md b/models/descriptions/amount.md new file mode 100644 index 0000000..307b711 --- /dev/null +++ b/models/descriptions/amount.md @@ -0,0 +1,3 @@ +{% docs amount %} +Float representation of the amount of an asset sent/offered/etc. +{% enddocs %} diff --git a/models/descriptions/asset_a_amount.md b/models/descriptions/asset_a_amount.md new file mode 100644 index 0000000..ead0cf5 --- /dev/null +++ b/models/descriptions/asset_a_amount.md @@ -0,0 +1,3 @@ +{% docs asset_a_amount %} +The raw number of tokens locked in the pool for one of the two asset pairs in the liquidity pool. +{% enddocs %} diff --git a/models/descriptions/asset_b_amount.md b/models/descriptions/asset_b_amount.md new file mode 100644 index 0000000..763a701 --- /dev/null +++ b/models/descriptions/asset_b_amount.md @@ -0,0 +1,3 @@ +{% docs asset_b_amount %} +The raw number of tokens locked in the pool for one of the two asset pairs in the liquidity pool. +{% enddocs %} diff --git a/models/descriptions/asset_balance_changes.md b/models/descriptions/asset_balance_changes.md new file mode 100644 index 0000000..f0eb090 --- /dev/null +++ b/models/descriptions/asset_balance_changes.md @@ -0,0 +1,3 @@ +{% docs asset_balance_changes %} +Changes in asset balances. +{% enddocs %} diff --git a/models/descriptions/asset_code.md b/models/descriptions/asset_code.md new file mode 100644 index 0000000..97c5ca1 --- /dev/null +++ b/models/descriptions/asset_code.md @@ -0,0 +1,3 @@ +{% docs asset_code %} +The 4 or 12 character code representation of the asset on the network. +{% enddocs %} diff --git a/models/descriptions/asset_id.md b/models/descriptions/asset_id.md new file mode 100644 index 0000000..7d67706 --- /dev/null +++ b/models/descriptions/asset_id.md @@ -0,0 +1,3 @@ +{% docs asset_id %} +The Farm Hash encoding of Asset Code + Asset Issuer + Asset Type. This field is optimized for cross table joins since integer joins are less expensive than the original asset id components. +{% enddocs %} diff --git a/models/descriptions/asset_issuer.md b/models/descriptions/asset_issuer.md new file mode 100644 index 0000000..3e6a99b --- /dev/null +++ b/models/descriptions/asset_issuer.md @@ -0,0 +1,3 @@ +{% docs asset_issuer %} +The account address of the original asset issuer that created the asset. +{% enddocs %} diff --git a/models/descriptions/asset_type.md b/models/descriptions/asset_type.md new file mode 100644 index 0000000..3f89c97 --- /dev/null +++ b/models/descriptions/asset_type.md @@ -0,0 +1,3 @@ +{% docs asset_type %} +The identifier for type of asset code, can be an alphanumeric with 4 characters, 12 characters or the native asset to the network, XLM. +{% enddocs %} diff --git a/models/descriptions/authorize.md b/models/descriptions/authorize.md new file mode 100644 index 0000000..c6d63e5 --- /dev/null +++ b/models/descriptions/authorize.md @@ -0,0 +1,3 @@ +{% docs authorize %} +Indicates whether the trustline is authorized. +{% enddocs %} diff --git a/models/descriptions/authorize_to_maintain_liabilities.md b/models/descriptions/authorize_to_maintain_liabilities.md new file mode 100644 index 0000000..df2f7ec --- /dev/null +++ b/models/descriptions/authorize_to_maintain_liabilities.md @@ -0,0 +1,3 @@ +{% docs authorize_to_maintain_liabilities %} +Indicates whether the trustline is authorized for maintaining liabilities. +{% enddocs %} diff --git a/models/descriptions/balance.md b/models/descriptions/balance.md new file mode 100644 index 0000000..4d6b30f --- /dev/null +++ b/models/descriptions/balance.md @@ -0,0 +1,3 @@ +{% docs balance %} +The number of units of XLM held by the account. +{% enddocs %} diff --git a/models/descriptions/balance_id.md b/models/descriptions/balance_id.md new file mode 100644 index 0000000..85de2b9 --- /dev/null +++ b/models/descriptions/balance_id.md @@ -0,0 +1,3 @@ +{% docs balance_id %} +The balance id of the claimable balance. +{% enddocs %} diff --git a/models/descriptions/base_fee.md b/models/descriptions/base_fee.md new file mode 100644 index 0000000..2c86a90 --- /dev/null +++ b/models/descriptions/base_fee.md @@ -0,0 +1,3 @@ +{% docs base_fee %} +The fee (in stroops) the network charges per operation in a transaction for the given ledger. The minimum base fee is 100, with the ability to increase if transaction demand exceeds ledger capacity. When this occurs, the ledger enters surge pricing. +{% enddocs %} diff --git a/models/descriptions/base_reserve.md b/models/descriptions/base_reserve.md new file mode 100644 index 0000000..c746d37 --- /dev/null +++ b/models/descriptions/base_reserve.md @@ -0,0 +1,3 @@ +{% docs base_reserve %} +The reserve (in stroops) the network requires an account to retain as a minimum balance in order to be a valid account on the network. The current minimum reserve is 10 XLM. +{% enddocs %} diff --git a/models/descriptions/batch_id.md b/models/descriptions/batch_id.md new file mode 100644 index 0000000..eae83c1 --- /dev/null +++ b/models/descriptions/batch_id.md @@ -0,0 +1,3 @@ +{% docs batch_id %} +String representation of the run id for a given DAG in Airflow. Takes the form of "scheduled__-". Batch ids are unique to the batch and help with monitoring and rerun capabilities. +{% enddocs %} diff --git a/models/descriptions/batch_insert_ts.md b/models/descriptions/batch_insert_ts.md new file mode 100644 index 0000000..2b44a74 --- /dev/null +++ b/models/descriptions/batch_insert_ts.md @@ -0,0 +1,3 @@ +{% docs batch_insert_ts %} +The 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 backfill. The timestamp should not be used during ad hoc analysis and is useful for data engineering purposes. +{% enddocs %} diff --git a/models/descriptions/batch_run_date.md b/models/descriptions/batch_run_date.md new file mode 100644 index 0000000..ea14290 --- /dev/null +++ b/models/descriptions/batch_run_date.md @@ -0,0 +1,3 @@ +{% docs batch_run_date %} +The 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. +{% enddocs %} diff --git a/models/descriptions/begin_sponsor.md b/models/descriptions/begin_sponsor.md new file mode 100644 index 0000000..19a382d --- /dev/null +++ b/models/descriptions/begin_sponsor.md @@ -0,0 +1,3 @@ +{% docs begin_sponsor %} +The account address that initiated the sponsorship. +{% enddocs %} diff --git a/models/descriptions/bump_to.md b/models/descriptions/bump_to.md new file mode 100644 index 0000000..7370805 --- /dev/null +++ b/models/descriptions/bump_to.md @@ -0,0 +1,3 @@ +{% docs bump_to %} +The new desired value of the source account's sequence number. +{% enddocs %} diff --git a/models/descriptions/buying_account_address.md b/models/descriptions/buying_account_address.md new file mode 100644 index 0000000..6b53b44 --- /dev/null +++ b/models/descriptions/buying_account_address.md @@ -0,0 +1,3 @@ +{% docs buying_account_address %} +The account address of the buying party. +{% enddocs %} diff --git a/models/descriptions/buying_amount.md b/models/descriptions/buying_amount.md new file mode 100644 index 0000000..753aef9 --- /dev/null +++ b/models/descriptions/buying_amount.md @@ -0,0 +1,3 @@ +{% docs buying_amount %} +The amount of purchased asset that was moved from the seller account into the buying account, reported in terms of the bought asset. +{% enddocs %} diff --git a/models/descriptions/buying_asset_code.md b/models/descriptions/buying_asset_code.md new file mode 100644 index 0000000..3ea4ea5 --- /dev/null +++ b/models/descriptions/buying_asset_code.md @@ -0,0 +1,3 @@ +{% docs buying_asset_code %} +The 4 or 12 character code representation of the asset being bought. +{% enddocs %} diff --git a/models/descriptions/buying_asset_id.md b/models/descriptions/buying_asset_id.md new file mode 100644 index 0000000..d918973 --- /dev/null +++ b/models/descriptions/buying_asset_id.md @@ -0,0 +1,3 @@ +{% docs buying_asset_id %} +The identifier of the asset being bought. +{% enddocs %} diff --git a/models/descriptions/buying_asset_issuer.md b/models/descriptions/buying_asset_issuer.md new file mode 100644 index 0000000..4cc0c82 --- /dev/null +++ b/models/descriptions/buying_asset_issuer.md @@ -0,0 +1,3 @@ +{% docs buying_asset_issuer %} +The account address of the original asset issuer for the buying asset. +{% enddocs %} diff --git a/models/descriptions/buying_asset_type.md b/models/descriptions/buying_asset_type.md new file mode 100644 index 0000000..0946699 --- /dev/null +++ b/models/descriptions/buying_asset_type.md @@ -0,0 +1,3 @@ +{% docs buying_asset_type %} +The identifier for type of buying asset code. +{% enddocs %} diff --git a/models/descriptions/buying_liabilities.md b/models/descriptions/buying_liabilities.md new file mode 100644 index 0000000..e818905 --- /dev/null +++ b/models/descriptions/buying_liabilities.md @@ -0,0 +1,3 @@ +{% docs buying_liabilities %} +The sum of all buy offers owned by this account for XLM only. +{% enddocs %} diff --git a/models/descriptions/buying_offer_id.md b/models/descriptions/buying_offer_id.md new file mode 100644 index 0000000..ef2d01b --- /dev/null +++ b/models/descriptions/buying_offer_id.md @@ -0,0 +1,3 @@ +{% docs buying_offer_id %} +The offer ID in the orderbook of the buying offer. If this offer was immediately and fully consumed, this will be a synthetic ID. +{% enddocs %} diff --git a/models/descriptions/clawback_enabled.md b/models/descriptions/clawback_enabled.md new file mode 100644 index 0000000..437f61f --- /dev/null +++ b/models/descriptions/clawback_enabled.md @@ -0,0 +1,3 @@ +{% docs clawback_enabled %} +Indicates whether the asset can be clawed back by the issuer. +{% enddocs %} diff --git a/models/descriptions/clear_flags.md b/models/descriptions/clear_flags.md new file mode 100644 index 0000000..24381b0 --- /dev/null +++ b/models/descriptions/clear_flags.md @@ -0,0 +1,3 @@ +{% docs clear_flags %} +Array of numeric values of flags cleared for a trustline. +{% enddocs %} diff --git a/models/descriptions/clear_flags_s.md b/models/descriptions/clear_flags_s.md new file mode 100644 index 0000000..2ad5d8a --- /dev/null +++ b/models/descriptions/clear_flags_s.md @@ -0,0 +1,3 @@ +{% docs clear_flags_s %} +Array of string values of flags cleared for a trustline. +{% enddocs %} diff --git a/models/descriptions/closed_at.md b/models/descriptions/closed_at.md new file mode 100644 index 0000000..057d018 --- /dev/null +++ b/models/descriptions/closed_at.md @@ -0,0 +1,3 @@ +{% docs closed_at %} +Timestamp when the ledger was closed and committed to the network. Ledgers are expected to close ~every 5 seconds. +{% enddocs %} diff --git a/models/descriptions/contract_code_hash.md b/models/descriptions/contract_code_hash.md new file mode 100644 index 0000000..27eb0d1 --- /dev/null +++ b/models/descriptions/contract_code_hash.md @@ -0,0 +1,3 @@ +{% docs contract_code_hash %} +Hash of Soroban contract code. +{% enddocs %} diff --git a/models/descriptions/contract_id.md b/models/descriptions/contract_id.md new file mode 100644 index 0000000..9506d76 --- /dev/null +++ b/models/descriptions/contract_id.md @@ -0,0 +1,3 @@ +{% docs contract_id %} +Soroban contract identifier. +{% enddocs %} diff --git a/models/descriptions/core_accounts_id.md b/models/descriptions/core_accounts_id.md new file mode 100644 index 0000000..2074cfc --- /dev/null +++ b/models/descriptions/core_accounts_id.md @@ -0,0 +1,3 @@ +{% docs core_accounts_id %} +Unique identifier for this record +{% enddocs %} diff --git a/models/descriptions/d.md b/models/descriptions/d.md new file mode 100644 index 0000000..1ed94d7 --- /dev/null +++ b/models/descriptions/d.md @@ -0,0 +1,3 @@ +{% docs d %} +Denominator in price ratio calculations. +{% enddocs %} diff --git a/models/descriptions/deleted.md b/models/descriptions/deleted.md new file mode 100644 index 0000000..5a061ce --- /dev/null +++ b/models/descriptions/deleted.md @@ -0,0 +1,3 @@ +{% docs deleted %} +Indicates whether the ledger entry (account, claimable balance, trust line, offer, liquidity pool) has been deleted or not. Once an entry is deleted, it cannot be recovered. +{% enddocs %} diff --git a/models/descriptions/destination_min.md b/models/descriptions/destination_min.md new file mode 100644 index 0000000..6de3d1d --- /dev/null +++ b/models/descriptions/destination_min.md @@ -0,0 +1,3 @@ +{% docs destination_min %} +The minimum amount to be received in destination asset. +{% enddocs %} diff --git a/models/descriptions/details_json.md b/models/descriptions/details_json.md new file mode 100644 index 0000000..bd04826 --- /dev/null +++ b/models/descriptions/details_json.md @@ -0,0 +1,3 @@ +{% docs details_json %} +JSON record containing operation-specific details. +{% enddocs %} diff --git a/models/descriptions/extend_to.md b/models/descriptions/extend_to.md new file mode 100644 index 0000000..da92034 --- /dev/null +++ b/models/descriptions/extend_to.md @@ -0,0 +1,3 @@ +{% docs extend_to %} +Ledger extension target. +{% enddocs %} diff --git a/models/descriptions/extra_signers.md b/models/descriptions/extra_signers.md new file mode 100644 index 0000000..468c0dc --- /dev/null +++ b/models/descriptions/extra_signers.md @@ -0,0 +1,3 @@ +{% docs extra_signers %} +Additional transaction signers. +{% enddocs %} diff --git a/models/descriptions/failed_transaction_count.md b/models/descriptions/failed_transaction_count.md new file mode 100644 index 0000000..bd57339 --- /dev/null +++ b/models/descriptions/failed_transaction_count.md @@ -0,0 +1,3 @@ +{% docs failed_transaction_count %} +The number of failed transactions submitted to the network in this ledger. The transaction was still paid for but contained an error that prevented it from executing +{% enddocs %} diff --git a/models/descriptions/fee.md b/models/descriptions/fee.md new file mode 100644 index 0000000..51a7073 --- /dev/null +++ b/models/descriptions/fee.md @@ -0,0 +1,3 @@ +{% docs fee %} +The number of basis points charged as a percentage of the trade in order to complete the transaction. The fees earned on all trades are divided amongst pool shareholders and distributed as an incentive to keep money in the pools. +{% enddocs %} diff --git a/models/descriptions/fee_account.md b/models/descriptions/fee_account.md new file mode 100644 index 0000000..b01c758 --- /dev/null +++ b/models/descriptions/fee_account.md @@ -0,0 +1,3 @@ +{% docs fee_account %} +Account charged the fee. +{% enddocs %} diff --git a/models/descriptions/fee_account_muxed.md b/models/descriptions/fee_account_muxed.md new file mode 100644 index 0000000..93e5501 --- /dev/null +++ b/models/descriptions/fee_account_muxed.md @@ -0,0 +1,3 @@ +{% docs fee_account_muxed %} +Muxed fee account identifier. +{% enddocs %} diff --git a/models/descriptions/fee_charged.md b/models/descriptions/fee_charged.md new file mode 100644 index 0000000..4b0912c --- /dev/null +++ b/models/descriptions/fee_charged.md @@ -0,0 +1,3 @@ +{% docs fee_charged %} +Actual fee charged for the operation. +{% enddocs %} diff --git a/models/descriptions/fee_pool.md b/models/descriptions/fee_pool.md new file mode 100644 index 0000000..461745f --- /dev/null +++ b/models/descriptions/fee_pool.md @@ -0,0 +1,3 @@ +{% docs fee_pool %} +The sum of all transaction fees +{% enddocs %} diff --git a/models/descriptions/flags.md b/models/descriptions/flags.md new file mode 100644 index 0000000..0382deb --- /dev/null +++ b/models/descriptions/flags.md @@ -0,0 +1,3 @@ +{% docs flags %} +Denotes the enabling and disabling of certain asset issuer privileges. +{% enddocs %} diff --git a/models/descriptions/from.md b/models/descriptions/from.md new file mode 100644 index 0000000..6bdec3e --- /dev/null +++ b/models/descriptions/from.md @@ -0,0 +1,3 @@ +{% docs from %} +The account address from which the payment/contract originates. +{% enddocs %} diff --git a/models/descriptions/function.md b/models/descriptions/function.md new file mode 100644 index 0000000..ca558ec --- /dev/null +++ b/models/descriptions/function.md @@ -0,0 +1,3 @@ +{% docs function %} +Function type for invoke_host_function. +{% enddocs %} diff --git a/models/descriptions/funder.md b/models/descriptions/funder.md new file mode 100644 index 0000000..9d3f938 --- /dev/null +++ b/models/descriptions/funder.md @@ -0,0 +1,3 @@ +{% docs funder %} +The account address that funds a new account. +{% enddocs %} diff --git a/models/descriptions/history_operation_id.md b/models/descriptions/history_operation_id.md new file mode 100644 index 0000000..27e36d8 --- /dev/null +++ b/models/descriptions/history_operation_id.md @@ -0,0 +1,3 @@ +{% docs history_operation_id %} +The 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 parties. +{% enddocs %} diff --git a/models/descriptions/home_domain.md b/models/descriptions/home_domain.md new file mode 100644 index 0000000..fdc5a42 --- /dev/null +++ b/models/descriptions/home_domain.md @@ -0,0 +1,3 @@ +{% docs home_domain %} +The domain that hosts this account's stellar.toml file. +{% enddocs %} diff --git a/models/descriptions/id.md b/models/descriptions/id.md new file mode 100644 index 0000000..596c7b0 --- /dev/null +++ b/models/descriptions/id.md @@ -0,0 +1,3 @@ +{% docs id %} +Unique identifier for the ledger +{% enddocs %} diff --git a/models/descriptions/inclusion_fee_bid.md b/models/descriptions/inclusion_fee_bid.md new file mode 100644 index 0000000..03ee95c --- /dev/null +++ b/models/descriptions/inclusion_fee_bid.md @@ -0,0 +1,3 @@ +{% docs inclusion_fee_bid %} +Bid for inclusion fee. +{% enddocs %} diff --git a/models/descriptions/inclusion_fee_charged.md b/models/descriptions/inclusion_fee_charged.md new file mode 100644 index 0000000..781b974 --- /dev/null +++ b/models/descriptions/inclusion_fee_charged.md @@ -0,0 +1,3 @@ +{% docs inclusion_fee_charged %} +Actual inclusion fee charged. +{% enddocs %} diff --git a/models/descriptions/inflation_destination.md b/models/descriptions/inflation_destination.md new file mode 100644 index 0000000..d2f1df1 --- /dev/null +++ b/models/descriptions/inflation_destination.md @@ -0,0 +1,3 @@ +{% docs inflation_destination %} +Deprecated: The account address to receive an inflation payment when they are disbursed on the network. +{% enddocs %} diff --git a/models/descriptions/inner_transaction_hash.md b/models/descriptions/inner_transaction_hash.md new file mode 100644 index 0000000..6bd6f1d --- /dev/null +++ b/models/descriptions/inner_transaction_hash.md @@ -0,0 +1,3 @@ +{% docs inner_transaction_hash %} +A transaction hash of a transaction wrapped with its signatures for fee-bump transactions +{% enddocs %} diff --git a/models/descriptions/inserted_timestamp.md b/models/descriptions/inserted_timestamp.md new file mode 100644 index 0000000..1e64555 --- /dev/null +++ b/models/descriptions/inserted_timestamp.md @@ -0,0 +1,3 @@ +{% docs inserted_timestamp %} +Timestamp when this record was inserted. +{% enddocs %} diff --git a/models/descriptions/into.md b/models/descriptions/into.md new file mode 100644 index 0000000..ea69b18 --- /dev/null +++ b/models/descriptions/into.md @@ -0,0 +1,3 @@ +{% docs into %} +The account address receiving the deleted account's lumens. +{% enddocs %} diff --git a/models/descriptions/invocation_id.md b/models/descriptions/invocation_id.md new file mode 100644 index 0000000..c03f2d7 --- /dev/null +++ b/models/descriptions/invocation_id.md @@ -0,0 +1,3 @@ +{% docs invocation_id %} +Unique identifier of the dbt job that inserted or modified this record. +{% enddocs %} diff --git a/models/descriptions/last_modified_ledger.md b/models/descriptions/last_modified_ledger.md new file mode 100644 index 0000000..8c19824 --- /dev/null +++ b/models/descriptions/last_modified_ledger.md @@ -0,0 +1,3 @@ +{% docs last_modified_ledger %} +The ledger sequence number when the ledger entry was last modified. Deletions do not count as a modification and will report the prior modification sequence number. +{% enddocs %} diff --git a/models/descriptions/ledger_bounds.md b/models/descriptions/ledger_bounds.md new file mode 100644 index 0000000..5075d5a --- /dev/null +++ b/models/descriptions/ledger_bounds.md @@ -0,0 +1,3 @@ +{% docs ledger_bounds %} +Bounds of the ledger. +{% enddocs %} diff --git a/models/descriptions/ledger_entry_change.md b/models/descriptions/ledger_entry_change.md new file mode 100644 index 0000000..45e1721 --- /dev/null +++ b/models/descriptions/ledger_entry_change.md @@ -0,0 +1,3 @@ +{% docs ledger_entry_change %} +Code that describes the ledger entry change type that was applied to the ledger entry. +{% enddocs %} diff --git a/models/descriptions/ledger_hash.md b/models/descriptions/ledger_hash.md new file mode 100644 index 0000000..52676e3 --- /dev/null +++ b/models/descriptions/ledger_hash.md @@ -0,0 +1,3 @@ +{% docs ledger_hash %} +The hex-encoded SHA-256 hash that represents the ledger's XDR-encoded form. +{% enddocs %} diff --git a/models/descriptions/ledger_header.md b/models/descriptions/ledger_header.md new file mode 100644 index 0000000..10d490b --- /dev/null +++ b/models/descriptions/ledger_header.md @@ -0,0 +1,3 @@ +{% docs ledger_header %} +A base64-encoded string of the raw LedgerHeader xdr struct for this ledger +{% enddocs %} diff --git a/models/descriptions/ledger_operation_count.md b/models/descriptions/ledger_operation_count.md new file mode 100644 index 0000000..eeff53a --- /dev/null +++ b/models/descriptions/ledger_operation_count.md @@ -0,0 +1,3 @@ +{% docs ledger_operation_count %} +Number of operations in the ledger. +{% enddocs %} diff --git a/models/descriptions/ledger_sequence.md b/models/descriptions/ledger_sequence.md new file mode 100644 index 0000000..fe5686b --- /dev/null +++ b/models/descriptions/ledger_sequence.md @@ -0,0 +1,3 @@ +{% docs ledger_sequence %} +The sequence number of the ledger. +{% enddocs %} diff --git a/models/descriptions/limit.md b/models/descriptions/limit.md new file mode 100644 index 0000000..3b93696 --- /dev/null +++ b/models/descriptions/limit.md @@ -0,0 +1,3 @@ +{% docs limit %} +The upper bound amount of an asset that an account can hold. +{% enddocs %} diff --git a/models/descriptions/liquidity_pool_fee.md b/models/descriptions/liquidity_pool_fee.md new file mode 100644 index 0000000..d5cdb2e --- /dev/null +++ b/models/descriptions/liquidity_pool_fee.md @@ -0,0 +1,3 @@ +{% docs liquidity_pool_fee %} +The percentage fee (in basis points) of the total fee collected by the liquidity pool for executing the trade. +{% enddocs %} diff --git a/models/descriptions/liquidity_pool_id.md b/models/descriptions/liquidity_pool_id.md new file mode 100644 index 0000000..a92ea95 --- /dev/null +++ b/models/descriptions/liquidity_pool_id.md @@ -0,0 +1,3 @@ +{% docs liquidity_pool_id %} +Unique identifier for a liquidity pool. There cannot be duplicate pools for the same asset pair. Once a pool has been created for the asset pair, another cannot be created. +{% enddocs %} diff --git a/models/descriptions/liquidity_pools_id.md b/models/descriptions/liquidity_pools_id.md new file mode 100644 index 0000000..ee0b3e4 --- /dev/null +++ b/models/descriptions/liquidity_pools_id.md @@ -0,0 +1,3 @@ +{% docs liquidity_pools_id %} +Unique identifier for the liquidity pool record. +{% enddocs %} diff --git a/models/descriptions/master_weight.md b/models/descriptions/master_weight.md new file mode 100644 index 0000000..d702840 --- /dev/null +++ b/models/descriptions/master_weight.md @@ -0,0 +1,3 @@ +{% docs master_weight %} +The weight of the master key, which is the private key for this account. If a master key is '0', the account is locked and cannot be used. +{% enddocs %} diff --git a/models/descriptions/max_fee.md b/models/descriptions/max_fee.md new file mode 100644 index 0000000..54f856b --- /dev/null +++ b/models/descriptions/max_fee.md @@ -0,0 +1,3 @@ +{% docs max_fee %} +Maximum fee for the transaction. +{% enddocs %} diff --git a/models/descriptions/max_price.md b/models/descriptions/max_price.md new file mode 100644 index 0000000..bab0d4f --- /dev/null +++ b/models/descriptions/max_price.md @@ -0,0 +1,3 @@ +{% docs max_price %} +Maximum exchange rate for deposit operation. +{% enddocs %} diff --git a/models/descriptions/max_price_r.md b/models/descriptions/max_price_r.md new file mode 100644 index 0000000..aabe4b7 --- /dev/null +++ b/models/descriptions/max_price_r.md @@ -0,0 +1,3 @@ +{% docs max_price_r %} +A fractional representation of the prices of the two assets in a pool. The n is the numerator (value of asset a) and the d is the denominator (value of asset b). +{% enddocs %} diff --git a/models/descriptions/max_tx_set_size.md b/models/descriptions/max_tx_set_size.md new file mode 100644 index 0000000..9cf7f99 --- /dev/null +++ b/models/descriptions/max_tx_set_size.md @@ -0,0 +1,3 @@ +{% docs max_tx_set_size %} +The maximum number of operations that Stellar validator nodes have agreed to process in a given ledger. Since Protocol 11, ledger capacity has been measured in operations rather than transactions. +{% enddocs %} diff --git a/models/descriptions/memo.md b/models/descriptions/memo.md new file mode 100644 index 0000000..e8546f6 --- /dev/null +++ b/models/descriptions/memo.md @@ -0,0 +1,3 @@ +{% docs memo %} +Memo content of the transaction. +{% enddocs %} diff --git a/models/descriptions/memo_type.md b/models/descriptions/memo_type.md new file mode 100644 index 0000000..498f6c7 --- /dev/null +++ b/models/descriptions/memo_type.md @@ -0,0 +1,3 @@ +{% docs memo_type %} +Type of memo attached to transaction. +{% enddocs %} diff --git a/models/descriptions/min_account_sequence.md b/models/descriptions/min_account_sequence.md new file mode 100644 index 0000000..042f725 --- /dev/null +++ b/models/descriptions/min_account_sequence.md @@ -0,0 +1,3 @@ +{% docs min_account_sequence %} +Minimum account sequence number. +{% enddocs %} diff --git a/models/descriptions/min_account_sequence_age.md b/models/descriptions/min_account_sequence_age.md new file mode 100644 index 0000000..6a5b774 --- /dev/null +++ b/models/descriptions/min_account_sequence_age.md @@ -0,0 +1,3 @@ +{% docs min_account_sequence_age %} +Minimum age of account sequence. +{% enddocs %} diff --git a/models/descriptions/min_account_sequence_ledger_gap.md b/models/descriptions/min_account_sequence_ledger_gap.md new file mode 100644 index 0000000..e684340 --- /dev/null +++ b/models/descriptions/min_account_sequence_ledger_gap.md @@ -0,0 +1,3 @@ +{% docs min_account_sequence_ledger_gap %} +Minimum gap in ledger sequences. +{% enddocs %} diff --git a/models/descriptions/min_price.md b/models/descriptions/min_price.md new file mode 100644 index 0000000..853d76f --- /dev/null +++ b/models/descriptions/min_price.md @@ -0,0 +1,3 @@ +{% docs min_price %} +Minimum exchange rate for deposit operation. +{% enddocs %} diff --git a/models/descriptions/min_price_r.md b/models/descriptions/min_price_r.md new file mode 100644 index 0000000..219f354 --- /dev/null +++ b/models/descriptions/min_price_r.md @@ -0,0 +1,3 @@ +{% docs min_price_r %} +A fractional representation of the prices of the two assets in a pool. The n is the numerator (value of asset a) and the d is the denominator (value of asset b). +{% enddocs %} diff --git a/models/descriptions/modified_timestamp.md b/models/descriptions/modified_timestamp.md new file mode 100644 index 0000000..84ef0f3 --- /dev/null +++ b/models/descriptions/modified_timestamp.md @@ -0,0 +1,3 @@ +{% docs modified_timestamp %} +Timestamp when this record was last modified. +{% enddocs %} diff --git a/models/descriptions/n.md b/models/descriptions/n.md new file mode 100644 index 0000000..34e3393 --- /dev/null +++ b/models/descriptions/n.md @@ -0,0 +1,3 @@ +{% docs n %} +Numerator in price ratio calculations. +{% enddocs %} diff --git a/models/descriptions/name.md b/models/descriptions/name.md new file mode 100644 index 0000000..4c6cee7 --- /dev/null +++ b/models/descriptions/name.md @@ -0,0 +1,3 @@ +{% docs name %} +The key for a data entry in manage data operations. +{% enddocs %} diff --git a/models/descriptions/new_max_fee.md b/models/descriptions/new_max_fee.md new file mode 100644 index 0000000..f43c90f --- /dev/null +++ b/models/descriptions/new_max_fee.md @@ -0,0 +1,3 @@ +{% docs new_max_fee %} +Updated maximum fee. +{% enddocs %} diff --git a/models/descriptions/node_id.md b/models/descriptions/node_id.md new file mode 100644 index 0000000..4059004 --- /dev/null +++ b/models/descriptions/node_id.md @@ -0,0 +1,3 @@ +{% docs node_id %} +The id of winning validator node which is allowed to write transaction set to the network. The winning validator is decided by the network. +{% enddocs %} diff --git a/models/descriptions/non_refundable_resource_fee_charged.md b/models/descriptions/non_refundable_resource_fee_charged.md new file mode 100644 index 0000000..98510d1 --- /dev/null +++ b/models/descriptions/non_refundable_resource_fee_charged.md @@ -0,0 +1,3 @@ +{% docs non_refundable_resource_fee_charged %} +The amount of the resource fee charged for the transaction that is non-refundable. +{% enddocs %} diff --git a/models/descriptions/num_sponsored.md b/models/descriptions/num_sponsored.md new file mode 100644 index 0000000..852531c --- /dev/null +++ b/models/descriptions/num_sponsored.md @@ -0,0 +1,3 @@ +{% docs num_sponsored %} +The number of reserves sponsored for this account (meaning another account is paying for the minimum balance). Sponsored entries do not incur any reserve requirement on the account that owns the entry. +{% enddocs %} diff --git a/models/descriptions/num_sponsoring.md b/models/descriptions/num_sponsoring.md new file mode 100644 index 0000000..d8fb71e --- /dev/null +++ b/models/descriptions/num_sponsoring.md @@ -0,0 +1,3 @@ +{% docs num_sponsoring %} +The number of reserves sponsored by this account. Entries sponsored by this account incur a reserve requirement. +{% enddocs %} diff --git a/models/descriptions/num_subentries.md b/models/descriptions/num_subentries.md new file mode 100644 index 0000000..132a166 --- /dev/null +++ b/models/descriptions/num_subentries.md @@ -0,0 +1,3 @@ +{% docs num_subentries %} +The total number of ledger entries connected to this account. Ledger entries include: trustlines, offers, signers, and data entries. (Claimable balances are counted under sponsoring entries, not subentries). Any newly created trustline, offer, signer or data entry will increase the number of subentries by 1. Accounts may have up to 1,000 subentries. +{% enddocs %} diff --git a/models/descriptions/offer_id.md b/models/descriptions/offer_id.md new file mode 100644 index 0000000..f0aa8e7 --- /dev/null +++ b/models/descriptions/offer_id.md @@ -0,0 +1,3 @@ +{% docs offer_id %} +The unique id for the offer. +{% enddocs %} diff --git a/models/descriptions/op_application_order.md b/models/descriptions/op_application_order.md new file mode 100644 index 0000000..32582ef --- /dev/null +++ b/models/descriptions/op_application_order.md @@ -0,0 +1,3 @@ +{% docs op_application_order %} +Order of operation application. +{% enddocs %} diff --git a/models/descriptions/op_id.md b/models/descriptions/op_id.md new file mode 100644 index 0000000..730990c --- /dev/null +++ b/models/descriptions/op_id.md @@ -0,0 +1,3 @@ +{% docs op_id %} +Unique identifier for the operation. +{% enddocs %} diff --git a/models/descriptions/op_source_account.md b/models/descriptions/op_source_account.md new file mode 100644 index 0000000..e2bb620 --- /dev/null +++ b/models/descriptions/op_source_account.md @@ -0,0 +1,3 @@ +{% docs op_source_account %} +Source account for the operation. +{% enddocs %} diff --git a/models/descriptions/op_source_account_muxed.md b/models/descriptions/op_source_account_muxed.md new file mode 100644 index 0000000..95e5520 --- /dev/null +++ b/models/descriptions/op_source_account_muxed.md @@ -0,0 +1,3 @@ +{% docs op_source_account_muxed %} +Muxed source account for the operation. +{% enddocs %} diff --git a/models/descriptions/operation_count.md b/models/descriptions/operation_count.md new file mode 100644 index 0000000..2cb105f --- /dev/null +++ b/models/descriptions/operation_count.md @@ -0,0 +1,3 @@ +{% docs operation_count %} +The total number of successful operations applied to this ledger. +{% enddocs %} diff --git a/models/descriptions/operation_result_code.md b/models/descriptions/operation_result_code.md new file mode 100644 index 0000000..0e52c0f --- /dev/null +++ b/models/descriptions/operation_result_code.md @@ -0,0 +1,3 @@ +{% docs operation_result_code %} +Result code of the operation. +{% enddocs %} diff --git a/models/descriptions/operation_trace_code.md b/models/descriptions/operation_trace_code.md new file mode 100644 index 0000000..b2a086d --- /dev/null +++ b/models/descriptions/operation_trace_code.md @@ -0,0 +1,3 @@ +{% docs operation_trace_code %} +Trace code of the operation. +{% enddocs %} diff --git a/models/descriptions/operations_id.md b/models/descriptions/operations_id.md new file mode 100644 index 0000000..ddc9198 --- /dev/null +++ b/models/descriptions/operations_id.md @@ -0,0 +1,3 @@ +{% docs operations_id %} +Unique identifier for the operation record. +{% enddocs %} diff --git a/models/descriptions/order.md b/models/descriptions/order.md new file mode 100644 index 0000000..7ef54bc --- /dev/null +++ b/models/descriptions/order.md @@ -0,0 +1,3 @@ +{% docs order %} +The sequential number assigned the portion of a trade that is executed within a operation. The history_operation_id and order number together represent a unique trade segment. +{% enddocs %} diff --git a/models/descriptions/parameters.md b/models/descriptions/parameters.md new file mode 100644 index 0000000..a9dc2d5 --- /dev/null +++ b/models/descriptions/parameters.md @@ -0,0 +1,3 @@ +{% docs parameters %} +Parameters for contract function calls. +{% enddocs %} diff --git a/models/descriptions/parameters_decoded.md b/models/descriptions/parameters_decoded.md new file mode 100644 index 0000000..b96942a --- /dev/null +++ b/models/descriptions/parameters_decoded.md @@ -0,0 +1,3 @@ +{% docs parameters_decoded %} +Decoded contract parameters. +{% enddocs %} diff --git a/models/descriptions/partition_id.md b/models/descriptions/partition_id.md new file mode 100644 index 0000000..ed55a12 --- /dev/null +++ b/models/descriptions/partition_id.md @@ -0,0 +1,3 @@ +{% docs partition_id %} +Partition identifier for the record. +{% enddocs %} diff --git a/models/descriptions/path.md b/models/descriptions/path.md new file mode 100644 index 0000000..4905fef --- /dev/null +++ b/models/descriptions/path.md @@ -0,0 +1,3 @@ +{% docs path %} +Path for path payment operations. +{% enddocs %} diff --git a/models/descriptions/pk.md b/models/descriptions/pk.md new file mode 100644 index 0000000..616c61f --- /dev/null +++ b/models/descriptions/pk.md @@ -0,0 +1,3 @@ +{% docs pk %} +Unique primary key for the dimension table, used as the main identifier for each record. +{% enddocs %} diff --git a/models/descriptions/pool_share_count.md b/models/descriptions/pool_share_count.md new file mode 100644 index 0000000..50df701 --- /dev/null +++ b/models/descriptions/pool_share_count.md @@ -0,0 +1,3 @@ +{% docs pool_share_count %} +Participation in a liquidity pool is represented by a pool share. +{% enddocs %} diff --git a/models/descriptions/previous_ledger_hash.md b/models/descriptions/previous_ledger_hash.md new file mode 100644 index 0000000..1019b24 --- /dev/null +++ b/models/descriptions/previous_ledger_hash.md @@ -0,0 +1,3 @@ +{% docs previous_ledger_hash %} +The hex-encoded SHA-256 hash of the ledger that immediately precedes this ledger. +{% enddocs %} diff --git a/models/descriptions/price.md b/models/descriptions/price.md new file mode 100644 index 0000000..7a54373 --- /dev/null +++ b/models/descriptions/price.md @@ -0,0 +1,3 @@ +{% docs price %} +The ratio of selling asset to buying asset. +{% enddocs %} diff --git a/models/descriptions/price_d.md b/models/descriptions/price_d.md new file mode 100644 index 0000000..baf606c --- /dev/null +++ b/models/descriptions/price_d.md @@ -0,0 +1,3 @@ +{% docs price_d %} +The price ratio of the sold asset: bought asset. When taken with price_n, the price can be calculated by price_n/price_d. +{% enddocs %} diff --git a/models/descriptions/price_n.md b/models/descriptions/price_n.md new file mode 100644 index 0000000..2db4e20 --- /dev/null +++ b/models/descriptions/price_n.md @@ -0,0 +1,3 @@ +{% docs price_n %} +The price ratio of the sold asset: bought asset. When taken with price_d, the price can be calculated by price_n/price_d. +{% enddocs %} diff --git a/models/descriptions/protocol_version.md b/models/descriptions/protocol_version.md new file mode 100644 index 0000000..8ca9d36 --- /dev/null +++ b/models/descriptions/protocol_version.md @@ -0,0 +1,3 @@ +{% docs protocol_version %} +The protocol verstion that the Stellar network was running when this ledger was committed. Protocol versions are released ~every 6 months. +{% enddocs %} diff --git a/models/descriptions/refundable_fee.md b/models/descriptions/refundable_fee.md new file mode 100644 index 0000000..a4343c6 --- /dev/null +++ b/models/descriptions/refundable_fee.md @@ -0,0 +1,3 @@ +{% docs refundable_fee %} +The portion of the transaction fee that is refundable under certain conditions. +{% enddocs %} diff --git a/models/descriptions/refundable_resource_fee_charged.md b/models/descriptions/refundable_resource_fee_charged.md new file mode 100644 index 0000000..3f8c025 --- /dev/null +++ b/models/descriptions/refundable_resource_fee_charged.md @@ -0,0 +1,3 @@ +{% docs refundable_resource_fee_charged %} +The amount of the resource fee charged for the transaction that is refundable. +{% enddocs %} diff --git a/models/descriptions/rent_fee_charged.md b/models/descriptions/rent_fee_charged.md new file mode 100644 index 0000000..7a5eaaf --- /dev/null +++ b/models/descriptions/rent_fee_charged.md @@ -0,0 +1,3 @@ +{% docs rent_fee_charged %} +The fee charged for renting resources on the network, such as storage space for data. +{% enddocs %} diff --git a/models/descriptions/reserve_a_asset_code.md b/models/descriptions/reserve_a_asset_code.md new file mode 100644 index 0000000..233b2cc --- /dev/null +++ b/models/descriptions/reserve_a_asset_code.md @@ -0,0 +1,3 @@ +{% docs reserve_a_asset_code %} +The code of the first reserve asset. +{% enddocs %} diff --git a/models/descriptions/reserve_a_asset_id.md b/models/descriptions/reserve_a_asset_id.md new file mode 100644 index 0000000..9b10b73 --- /dev/null +++ b/models/descriptions/reserve_a_asset_id.md @@ -0,0 +1,3 @@ +{% docs reserve_a_asset_id %} +The identifier of the first reserve asset. +{% enddocs %} diff --git a/models/descriptions/reserve_a_asset_issuer.md b/models/descriptions/reserve_a_asset_issuer.md new file mode 100644 index 0000000..95a986c --- /dev/null +++ b/models/descriptions/reserve_a_asset_issuer.md @@ -0,0 +1,3 @@ +{% docs reserve_a_asset_issuer %} +The issuer of the first reserve asset. +{% enddocs %} diff --git a/models/descriptions/reserve_a_asset_type.md b/models/descriptions/reserve_a_asset_type.md new file mode 100644 index 0000000..8eaa936 --- /dev/null +++ b/models/descriptions/reserve_a_asset_type.md @@ -0,0 +1,3 @@ +{% docs reserve_a_asset_type %} +The type of the first reserve asset. +{% enddocs %} diff --git a/models/descriptions/reserve_a_deposit_amount.md b/models/descriptions/reserve_a_deposit_amount.md new file mode 100644 index 0000000..5c841de --- /dev/null +++ b/models/descriptions/reserve_a_deposit_amount.md @@ -0,0 +1,3 @@ +{% docs reserve_a_deposit_amount %} +Actual amount deposited for first reserve asset. +{% enddocs %} diff --git a/models/descriptions/reserve_a_max_amount.md b/models/descriptions/reserve_a_max_amount.md new file mode 100644 index 0000000..f8db6ca --- /dev/null +++ b/models/descriptions/reserve_a_max_amount.md @@ -0,0 +1,3 @@ +{% docs reserve_a_max_amount %} +Maximum amount for first reserve asset deposit. +{% enddocs %} diff --git a/models/descriptions/reserve_a_min_amount.md b/models/descriptions/reserve_a_min_amount.md new file mode 100644 index 0000000..3a0b918 --- /dev/null +++ b/models/descriptions/reserve_a_min_amount.md @@ -0,0 +1,3 @@ +{% docs reserve_a_min_amount %} +Minimum withdrawal amount for first reserve asset. +{% enddocs %} diff --git a/models/descriptions/reserve_a_withdraw_amount.md b/models/descriptions/reserve_a_withdraw_amount.md new file mode 100644 index 0000000..4321cb0 --- /dev/null +++ b/models/descriptions/reserve_a_withdraw_amount.md @@ -0,0 +1,3 @@ +{% docs reserve_a_withdraw_amount %} +Actual withdrawal amount for first reserve asset. +{% enddocs %} diff --git a/models/descriptions/reserve_b_asset_code.md b/models/descriptions/reserve_b_asset_code.md new file mode 100644 index 0000000..5c8413c --- /dev/null +++ b/models/descriptions/reserve_b_asset_code.md @@ -0,0 +1,3 @@ +{% docs reserve_b_asset_code %} +The code of the second reserve asset. +{% enddocs %} diff --git a/models/descriptions/reserve_b_asset_id.md b/models/descriptions/reserve_b_asset_id.md new file mode 100644 index 0000000..b3f9acf --- /dev/null +++ b/models/descriptions/reserve_b_asset_id.md @@ -0,0 +1,3 @@ +{% docs reserve_b_asset_id %} +The identifier of the second reserve asset. +{% enddocs %} diff --git a/models/descriptions/reserve_b_asset_issuer.md b/models/descriptions/reserve_b_asset_issuer.md new file mode 100644 index 0000000..fdab38d --- /dev/null +++ b/models/descriptions/reserve_b_asset_issuer.md @@ -0,0 +1,3 @@ +{% docs reserve_b_asset_issuer %} +The issuer of the second reserve asset. +{% enddocs %} diff --git a/models/descriptions/reserve_b_asset_type.md b/models/descriptions/reserve_b_asset_type.md new file mode 100644 index 0000000..b342f6c --- /dev/null +++ b/models/descriptions/reserve_b_asset_type.md @@ -0,0 +1,3 @@ +{% docs reserve_b_asset_type %} +The type of the second reserve asset. +{% enddocs %} diff --git a/models/descriptions/reserve_b_deposit_amount.md b/models/descriptions/reserve_b_deposit_amount.md new file mode 100644 index 0000000..20d0fd0 --- /dev/null +++ b/models/descriptions/reserve_b_deposit_amount.md @@ -0,0 +1,3 @@ +{% docs reserve_b_deposit_amount %} +Actual amount deposited for second reserve asset. +{% enddocs %} diff --git a/models/descriptions/reserve_b_max_amount.md b/models/descriptions/reserve_b_max_amount.md new file mode 100644 index 0000000..c3f14f6 --- /dev/null +++ b/models/descriptions/reserve_b_max_amount.md @@ -0,0 +1,3 @@ +{% docs reserve_b_max_amount %} +Maximum amount for second reserve asset deposit. +{% enddocs %} diff --git a/models/descriptions/reserve_b_min_amount.md b/models/descriptions/reserve_b_min_amount.md new file mode 100644 index 0000000..6fc6dc2 --- /dev/null +++ b/models/descriptions/reserve_b_min_amount.md @@ -0,0 +1,3 @@ +{% docs reserve_b_min_amount %} +Minimum withdrawal amount for second reserve asset. +{% enddocs %} diff --git a/models/descriptions/reserve_b_withdraw_amount.md b/models/descriptions/reserve_b_withdraw_amount.md new file mode 100644 index 0000000..a15ec4a --- /dev/null +++ b/models/descriptions/reserve_b_withdraw_amount.md @@ -0,0 +1,3 @@ +{% docs reserve_b_withdraw_amount %} +Actual withdrawal amount for second reserve asset. +{% enddocs %} diff --git a/models/descriptions/resource_fee.md b/models/descriptions/resource_fee.md new file mode 100644 index 0000000..f236e69 --- /dev/null +++ b/models/descriptions/resource_fee.md @@ -0,0 +1,3 @@ +{% docs resource_fee %} +Fee for resource usage. +{% enddocs %} diff --git a/models/descriptions/resource_fee_refund.md b/models/descriptions/resource_fee_refund.md new file mode 100644 index 0000000..738251c --- /dev/null +++ b/models/descriptions/resource_fee_refund.md @@ -0,0 +1,3 @@ +{% docs resource_fee_refund %} +Refund of resource fee. +{% enddocs %} diff --git a/models/descriptions/rounding_slippage.md b/models/descriptions/rounding_slippage.md new file mode 100644 index 0000000..aac5b5a --- /dev/null +++ b/models/descriptions/rounding_slippage.md @@ -0,0 +1,3 @@ +{% docs rounding_slippage %} +Applies 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. +{% enddocs %} diff --git a/models/descriptions/seller_is_exact.md b/models/descriptions/seller_is_exact.md new file mode 100644 index 0000000..b8a61d0 --- /dev/null +++ b/models/descriptions/seller_is_exact.md @@ -0,0 +1,3 @@ +{% docs seller_is_exact %} +Indicates whether the buying or selling party trade was impacted by rounding slippage. If true, the buyer was impacted. If false, the seller was impacted. +{% enddocs %} diff --git a/models/descriptions/selling_account_address.md b/models/descriptions/selling_account_address.md new file mode 100644 index 0000000..548f641 --- /dev/null +++ b/models/descriptions/selling_account_address.md @@ -0,0 +1,3 @@ +{% docs selling_account_address %} +The account address of the selling party. +{% enddocs %} diff --git a/models/descriptions/selling_amount.md b/models/descriptions/selling_amount.md new file mode 100644 index 0000000..6dbf251 --- /dev/null +++ b/models/descriptions/selling_amount.md @@ -0,0 +1,3 @@ +{% docs selling_amount %} +The amount of sold asset that was moved from the seller account to the buyer account, reported in terms of the sold amount. +{% enddocs %} diff --git a/models/descriptions/selling_asset_code.md b/models/descriptions/selling_asset_code.md new file mode 100644 index 0000000..692959f --- /dev/null +++ b/models/descriptions/selling_asset_code.md @@ -0,0 +1,3 @@ +{% docs selling_asset_code %} +The 4 or 12 character code representation of the asset being sold. +{% enddocs %} diff --git a/models/descriptions/selling_asset_id.md b/models/descriptions/selling_asset_id.md new file mode 100644 index 0000000..af6bf07 --- /dev/null +++ b/models/descriptions/selling_asset_id.md @@ -0,0 +1,3 @@ +{% docs selling_asset_id %} +The identifier of the asset being sold. +{% enddocs %} diff --git a/models/descriptions/selling_asset_issuer.md b/models/descriptions/selling_asset_issuer.md new file mode 100644 index 0000000..1493227 --- /dev/null +++ b/models/descriptions/selling_asset_issuer.md @@ -0,0 +1,3 @@ +{% docs selling_asset_issuer %} +The account address of the original asset issuer for the selling asset. +{% enddocs %} diff --git a/models/descriptions/selling_asset_type.md b/models/descriptions/selling_asset_type.md new file mode 100644 index 0000000..399c46d --- /dev/null +++ b/models/descriptions/selling_asset_type.md @@ -0,0 +1,3 @@ +{% docs selling_asset_type %} +The identifier for type of selling asset code. +{% enddocs %} diff --git a/models/descriptions/selling_liabilities.md b/models/descriptions/selling_liabilities.md new file mode 100644 index 0000000..5b6f114 --- /dev/null +++ b/models/descriptions/selling_liabilities.md @@ -0,0 +1,3 @@ +{% docs selling_liabilities %} +The sum of all sell offers owned by this account for XLM only. +{% enddocs %} diff --git a/models/descriptions/selling_liquidity_pool_id.md b/models/descriptions/selling_liquidity_pool_id.md new file mode 100644 index 0000000..27d1d00 --- /dev/null +++ b/models/descriptions/selling_liquidity_pool_id.md @@ -0,0 +1,3 @@ +{% docs selling_liquidity_pool_id %} +The unique identifier for a liquidity pool if the trade was executed against a liquidity pool instead of the orderbook. +{% enddocs %} diff --git a/models/descriptions/selling_offer_id.md b/models/descriptions/selling_offer_id.md new file mode 100644 index 0000000..e7180c7 --- /dev/null +++ b/models/descriptions/selling_offer_id.md @@ -0,0 +1,3 @@ +{% docs selling_offer_id %} +The offer ID in the orderbook of the selling offer. If this offer was immediately and fully consumed, this will be a synthetic ID. +{% enddocs %} diff --git a/models/descriptions/sequence.md b/models/descriptions/sequence.md new file mode 100644 index 0000000..530665b --- /dev/null +++ b/models/descriptions/sequence.md @@ -0,0 +1,3 @@ +{% docs sequence %} +The sequence number that corresponds to the individual ledgers. As ledgers are written to the network, the sequence is incremented by 1 +{% enddocs %} diff --git a/models/descriptions/sequence_ledger.md b/models/descriptions/sequence_ledger.md new file mode 100644 index 0000000..4a41c52 --- /dev/null +++ b/models/descriptions/sequence_ledger.md @@ -0,0 +1,3 @@ +{% docs sequence_ledger %} +The unsigned 32-bit ledger number of the sequence number's age. +{% enddocs %} diff --git a/models/descriptions/sequence_number.md b/models/descriptions/sequence_number.md new file mode 100644 index 0000000..c45653e --- /dev/null +++ b/models/descriptions/sequence_number.md @@ -0,0 +1,3 @@ +{% docs sequence_number %} +The account's current sequence number. The sequence number controls operations applied to an account. Operations must submit a unique sequence number that is incremented by 1 in order to apply the operation to the account so that account changes will not collide within a ledger. +{% enddocs %} diff --git a/models/descriptions/sequence_time.md b/models/descriptions/sequence_time.md new file mode 100644 index 0000000..0557ec5 --- /dev/null +++ b/models/descriptions/sequence_time.md @@ -0,0 +1,3 @@ +{% docs sequence_time %} +The UNIX timestamp of the sequence number's age. +{% enddocs %} diff --git a/models/descriptions/set_flags.md b/models/descriptions/set_flags.md new file mode 100644 index 0000000..0fb90c5 --- /dev/null +++ b/models/descriptions/set_flags.md @@ -0,0 +1,3 @@ +{% docs set_flags %} +Array of numeric values of flags set for a trustline. +{% enddocs %} diff --git a/models/descriptions/set_flags_s.md b/models/descriptions/set_flags_s.md new file mode 100644 index 0000000..9bc1b6b --- /dev/null +++ b/models/descriptions/set_flags_s.md @@ -0,0 +1,3 @@ +{% docs set_flags_s %} +Array of string values of flags set for a trustline. +{% enddocs %} diff --git a/models/descriptions/shares.md b/models/descriptions/shares.md new file mode 100644 index 0000000..b94f9e5 --- /dev/null +++ b/models/descriptions/shares.md @@ -0,0 +1,3 @@ +{% docs shares %} +Number of shares withdrawn from pool. +{% enddocs %} diff --git a/models/descriptions/shares_received.md b/models/descriptions/shares_received.md new file mode 100644 index 0000000..4de7331 --- /dev/null +++ b/models/descriptions/shares_received.md @@ -0,0 +1,3 @@ +{% docs shares_received %} +Number of pool shares received for deposit. +{% enddocs %} diff --git a/models/descriptions/signature.md b/models/descriptions/signature.md new file mode 100644 index 0000000..dd28e2a --- /dev/null +++ b/models/descriptions/signature.md @@ -0,0 +1,3 @@ +{% docs signature %} +The signing hash of the validator node which writes the transaction set to the network.This signature ensures the integrity and authenticity of the ledger, confirming that it has not been tampered with. +{% enddocs %} diff --git a/models/descriptions/signer_key.md b/models/descriptions/signer_key.md new file mode 100644 index 0000000..83e00f3 --- /dev/null +++ b/models/descriptions/signer_key.md @@ -0,0 +1,3 @@ +{% docs signer_key %} +The address of the signer. +{% enddocs %} diff --git a/models/descriptions/signer_weight.md b/models/descriptions/signer_weight.md new file mode 100644 index 0000000..34c5c6c --- /dev/null +++ b/models/descriptions/signer_weight.md @@ -0,0 +1,3 @@ +{% docs signer_weight %} +The weight of the new signer. +{% enddocs %} diff --git a/models/descriptions/soroban_fee_write_1kb.md b/models/descriptions/soroban_fee_write_1kb.md new file mode 100644 index 0000000..215e3d7 --- /dev/null +++ b/models/descriptions/soroban_fee_write_1kb.md @@ -0,0 +1,3 @@ +{% docs soroban_fee_write_1kb %} +The fee associated with writing 1KB of data to the Soroban ledger.The write fee is dynamic fee that grows linearly with the size of the ledger. The write fee for a given ledger is recorded in the ledger header and has a direct relationship to the bucketlist size of the ledger db. +{% enddocs %} diff --git a/models/descriptions/soroban_operation_type.md b/models/descriptions/soroban_operation_type.md new file mode 100644 index 0000000..f1c9a06 --- /dev/null +++ b/models/descriptions/soroban_operation_type.md @@ -0,0 +1,3 @@ +{% docs soroban_operation_type %} +Type of Soroban operation. +{% enddocs %} diff --git a/models/descriptions/soroban_resources_instructions.md b/models/descriptions/soroban_resources_instructions.md new file mode 100644 index 0000000..aa46afc --- /dev/null +++ b/models/descriptions/soroban_resources_instructions.md @@ -0,0 +1,3 @@ +{% docs soroban_resources_instructions %} +Instructions for Soroban resources. +{% enddocs %} diff --git a/models/descriptions/soroban_resources_read_bytes.md b/models/descriptions/soroban_resources_read_bytes.md new file mode 100644 index 0000000..32c399e --- /dev/null +++ b/models/descriptions/soroban_resources_read_bytes.md @@ -0,0 +1,3 @@ +{% docs soroban_resources_read_bytes %} +Bytes read by Soroban resources. +{% enddocs %} diff --git a/models/descriptions/soroban_resources_write_bytes.md b/models/descriptions/soroban_resources_write_bytes.md new file mode 100644 index 0000000..4a8fd76 --- /dev/null +++ b/models/descriptions/soroban_resources_write_bytes.md @@ -0,0 +1,3 @@ +{% docs soroban_resources_write_bytes %} +Bytes written by Soroban resources. +{% enddocs %} diff --git a/models/descriptions/source_amount.md b/models/descriptions/source_amount.md new file mode 100644 index 0000000..61d6266 --- /dev/null +++ b/models/descriptions/source_amount.md @@ -0,0 +1,3 @@ +{% docs source_amount %} +The originating amount sent designated in the source asset. +{% enddocs %} diff --git a/models/descriptions/source_asset_code.md b/models/descriptions/source_asset_code.md new file mode 100644 index 0000000..5b723e9 --- /dev/null +++ b/models/descriptions/source_asset_code.md @@ -0,0 +1,3 @@ +{% docs source_asset_code %} +The 4 or 12 character code representation of the source asset. +{% enddocs %} diff --git a/models/descriptions/source_asset_id.md b/models/descriptions/source_asset_id.md new file mode 100644 index 0000000..0749a9d --- /dev/null +++ b/models/descriptions/source_asset_id.md @@ -0,0 +1,3 @@ +{% docs source_asset_id %} +The identifier of the source asset. +{% enddocs %} diff --git a/models/descriptions/source_asset_issuer.md b/models/descriptions/source_asset_issuer.md new file mode 100644 index 0000000..7391eb3 --- /dev/null +++ b/models/descriptions/source_asset_issuer.md @@ -0,0 +1,3 @@ +{% docs source_asset_issuer %} +The account address of the original source asset issuer. +{% enddocs %} diff --git a/models/descriptions/source_asset_type.md b/models/descriptions/source_asset_type.md new file mode 100644 index 0000000..c1283d5 --- /dev/null +++ b/models/descriptions/source_asset_type.md @@ -0,0 +1,3 @@ +{% docs source_asset_type %} +The identifier for type of source asset code. +{% enddocs %} diff --git a/models/descriptions/source_max.md b/models/descriptions/source_max.md new file mode 100644 index 0000000..72d85ef --- /dev/null +++ b/models/descriptions/source_max.md @@ -0,0 +1,3 @@ +{% docs source_max %} +The maximum amount to be sent in source asset. +{% enddocs %} diff --git a/models/descriptions/sponsor.md b/models/descriptions/sponsor.md new file mode 100644 index 0000000..003194f --- /dev/null +++ b/models/descriptions/sponsor.md @@ -0,0 +1,3 @@ +{% docs sponsor %} +The account address of the sponsor who is paying the reserves for this ledger entry. +{% enddocs %} diff --git a/models/descriptions/sponsored_id.md b/models/descriptions/sponsored_id.md new file mode 100644 index 0000000..5c8a50a --- /dev/null +++ b/models/descriptions/sponsored_id.md @@ -0,0 +1,3 @@ +{% docs sponsored_id %} +The account address of the account being sponsored. +{% enddocs %} diff --git a/models/descriptions/starting_balance.md b/models/descriptions/starting_balance.md new file mode 100644 index 0000000..2f359c2 --- /dev/null +++ b/models/descriptions/starting_balance.md @@ -0,0 +1,3 @@ +{% docs starting_balance %} +The amount of XLM sent to newly created account. +{% enddocs %} diff --git a/models/descriptions/successful.md b/models/descriptions/successful.md new file mode 100644 index 0000000..fd67009 --- /dev/null +++ b/models/descriptions/successful.md @@ -0,0 +1,3 @@ +{% docs successful %} +Whether the operation was successful. +{% enddocs %} diff --git a/models/descriptions/successful_transaction_count.md b/models/descriptions/successful_transaction_count.md new file mode 100644 index 0000000..c615ff1 --- /dev/null +++ b/models/descriptions/successful_transaction_count.md @@ -0,0 +1,3 @@ +{% docs successful_transaction_count %} +The number of successful transactions submitted and completed by the network in this ledger +{% enddocs %} diff --git a/models/descriptions/threshold_high.md b/models/descriptions/threshold_high.md new file mode 100644 index 0000000..cf87ebc --- /dev/null +++ b/models/descriptions/threshold_high.md @@ -0,0 +1,3 @@ +{% docs threshold_high %} +The sum of the weight of all signatures that sign a transaction for the high threshold operation. The weight must exceed the set threshold for the operation to succeed. +{% enddocs %} diff --git a/models/descriptions/threshold_low.md b/models/descriptions/threshold_low.md new file mode 100644 index 0000000..85cb35e --- /dev/null +++ b/models/descriptions/threshold_low.md @@ -0,0 +1,3 @@ +{% docs threshold_low %} +The sum of the weight of all signatures that sign a transaction for the low threshold operation. The weight must exceed the set threshold for the operation to succeed. +{% enddocs %} diff --git a/models/descriptions/threshold_medium.md b/models/descriptions/threshold_medium.md new file mode 100644 index 0000000..085e497 --- /dev/null +++ b/models/descriptions/threshold_medium.md @@ -0,0 +1,3 @@ +{% docs threshold_medium %} +The sum of the weight of all signatures that sign a transaction for the medium threshold operation. The weight must exceed the set threshold for the operation to succeed. +{% enddocs %} diff --git a/models/descriptions/time_bounds.md b/models/descriptions/time_bounds.md new file mode 100644 index 0000000..ebc1f54 --- /dev/null +++ b/models/descriptions/time_bounds.md @@ -0,0 +1,3 @@ +{% docs time_bounds %} +Time bounds for transaction validity. +{% enddocs %} diff --git a/models/descriptions/to.md b/models/descriptions/to.md new file mode 100644 index 0000000..88dcc64 --- /dev/null +++ b/models/descriptions/to.md @@ -0,0 +1,3 @@ +{% docs to %} +The address of the account receiving payment funds. +{% enddocs %} diff --git a/models/descriptions/total_byte_size_of_bucket_list.md b/models/descriptions/total_byte_size_of_bucket_list.md new file mode 100644 index 0000000..3cc0577 --- /dev/null +++ b/models/descriptions/total_byte_size_of_bucket_list.md @@ -0,0 +1,3 @@ +{% docs total_byte_size_of_bucket_list %} +Total size in bytes of the bucket list +{% enddocs %} diff --git a/models/descriptions/total_coins.md b/models/descriptions/total_coins.md new file mode 100644 index 0000000..a815cff --- /dev/null +++ b/models/descriptions/total_coins.md @@ -0,0 +1,3 @@ +{% docs total_coins %} +Total number of lumens in circulation +{% enddocs %} diff --git a/models/descriptions/trade_type.md b/models/descriptions/trade_type.md new file mode 100644 index 0000000..3631188 --- /dev/null +++ b/models/descriptions/trade_type.md @@ -0,0 +1,3 @@ +{% docs trade_type %} +Indicates whether the trade was executed against the orderbook (decentralized exchange) or liquidity pool. +{% enddocs %} diff --git a/models/descriptions/trades_id.md b/models/descriptions/trades_id.md new file mode 100644 index 0000000..3e06544 --- /dev/null +++ b/models/descriptions/trades_id.md @@ -0,0 +1,3 @@ +{% docs trades_id %} +Surrogate key generated from history_operation_id and order. +{% enddocs %} diff --git a/models/descriptions/transaction_count.md b/models/descriptions/transaction_count.md new file mode 100644 index 0000000..6b097a3 --- /dev/null +++ b/models/descriptions/transaction_count.md @@ -0,0 +1,3 @@ +{% docs transaction_count %} +The number of successful transactions submitted and completed by the network in this ledger. +{% enddocs %} diff --git a/models/descriptions/transaction_hash.md b/models/descriptions/transaction_hash.md new file mode 100644 index 0000000..4f987a3 --- /dev/null +++ b/models/descriptions/transaction_hash.md @@ -0,0 +1,3 @@ +{% docs transaction_hash %} +Hash of the transaction. +{% enddocs %} diff --git a/models/descriptions/transaction_id.md b/models/descriptions/transaction_id.md new file mode 100644 index 0000000..e51aead --- /dev/null +++ b/models/descriptions/transaction_id.md @@ -0,0 +1,3 @@ +{% docs transaction_id %} +The transaction identifier containing this operation. +{% enddocs %} diff --git a/models/descriptions/transaction_result_code.md b/models/descriptions/transaction_result_code.md new file mode 100644 index 0000000..1cbe989 --- /dev/null +++ b/models/descriptions/transaction_result_code.md @@ -0,0 +1,3 @@ +{% docs transaction_result_code %} +Result code of the transaction. +{% enddocs %} diff --git a/models/descriptions/trustee.md b/models/descriptions/trustee.md new file mode 100644 index 0000000..5284a4b --- /dev/null +++ b/models/descriptions/trustee.md @@ -0,0 +1,3 @@ +{% docs trustee %} +The issuing account address. +{% enddocs %} diff --git a/models/descriptions/trustline_asset.md b/models/descriptions/trustline_asset.md new file mode 100644 index 0000000..6318e1b --- /dev/null +++ b/models/descriptions/trustline_asset.md @@ -0,0 +1,3 @@ +{% docs trustline_asset %} +The asset of the trustline. +{% enddocs %} diff --git a/models/descriptions/trustline_count.md b/models/descriptions/trustline_count.md new file mode 100644 index 0000000..e4a961c --- /dev/null +++ b/models/descriptions/trustline_count.md @@ -0,0 +1,3 @@ +{% docs trustline_count %} +Total number of accounts with trustlines authorized to the pool. To create a trustline, an account must trust both base assets before trusting a pool with the asset pair. +{% enddocs %} diff --git a/models/descriptions/trustor.md b/models/descriptions/trustor.md new file mode 100644 index 0000000..9032e83 --- /dev/null +++ b/models/descriptions/trustor.md @@ -0,0 +1,3 @@ +{% docs trustor %} +The trusting account address. +{% enddocs %} diff --git a/models/descriptions/tx_envelope.md b/models/descriptions/tx_envelope.md new file mode 100644 index 0000000..4dd4892 --- /dev/null +++ b/models/descriptions/tx_envelope.md @@ -0,0 +1,3 @@ +{% docs tx_envelope %} +A base-64 encoded XDR blob of the tx envelope (transaction and its signatures) +{% enddocs %} diff --git a/models/descriptions/tx_fee_meta.md b/models/descriptions/tx_fee_meta.md new file mode 100644 index 0000000..c55b734 --- /dev/null +++ b/models/descriptions/tx_fee_meta.md @@ -0,0 +1,3 @@ +{% docs tx_fee_meta %} +A base-64 encoded XDR blob of the tx fee meta +{% enddocs %} diff --git a/models/descriptions/tx_meta.md b/models/descriptions/tx_meta.md new file mode 100644 index 0000000..75349c1 --- /dev/null +++ b/models/descriptions/tx_meta.md @@ -0,0 +1,3 @@ +{% docs tx_meta %} +A base-64 encoded XDR blob of the tx meta +{% enddocs %} diff --git a/models/descriptions/tx_result.md b/models/descriptions/tx_result.md new file mode 100644 index 0000000..dc37ac8 --- /dev/null +++ b/models/descriptions/tx_result.md @@ -0,0 +1,3 @@ +{% docs tx_result %} +A base-64 encoded XDR blob of the tx result +{% enddocs %} diff --git a/models/descriptions/tx_set_operation_count.md b/models/descriptions/tx_set_operation_count.md new file mode 100644 index 0000000..e8095ea --- /dev/null +++ b/models/descriptions/tx_set_operation_count.md @@ -0,0 +1,3 @@ +{% docs tx_set_operation_count %} +The total number of operations in the transaction set for this ledger, including failed transactions. +{% enddocs %} diff --git a/models/descriptions/tx_signers.md b/models/descriptions/tx_signers.md new file mode 100644 index 0000000..ee6fc00 --- /dev/null +++ b/models/descriptions/tx_signers.md @@ -0,0 +1,3 @@ +{% docs tx_signers %} +The public keys of the signers who authorized the transaction. +{% enddocs %} diff --git a/models/descriptions/txn_account.md b/models/descriptions/txn_account.md new file mode 100644 index 0000000..4f54f4a --- /dev/null +++ b/models/descriptions/txn_account.md @@ -0,0 +1,3 @@ +{% docs txn_account %} +Account executing the transaction. +{% enddocs %} diff --git a/models/descriptions/txn_application_order.md b/models/descriptions/txn_application_order.md new file mode 100644 index 0000000..b69bc52 --- /dev/null +++ b/models/descriptions/txn_application_order.md @@ -0,0 +1,3 @@ +{% docs txn_application_order %} +Order of transaction application. +{% enddocs %} diff --git a/models/descriptions/txn_created_at.md b/models/descriptions/txn_created_at.md new file mode 100644 index 0000000..6c13de6 --- /dev/null +++ b/models/descriptions/txn_created_at.md @@ -0,0 +1,3 @@ +{% docs txn_created_at %} +Creation timestamp of the transaction. +{% enddocs %} diff --git a/models/descriptions/txn_operation_count.md b/models/descriptions/txn_operation_count.md new file mode 100644 index 0000000..09c94bf --- /dev/null +++ b/models/descriptions/txn_operation_count.md @@ -0,0 +1,3 @@ +{% docs txn_operation_count %} +Number of operations in the transaction. +{% enddocs %} diff --git a/models/descriptions/type.md b/models/descriptions/type.md new file mode 100644 index 0000000..2a7b5a5 --- /dev/null +++ b/models/descriptions/type.md @@ -0,0 +1,3 @@ +{% docs type %} +The mechanism that calculates pricing and division of shares for the pool. With the initial AMM rollout, the only type of liquidity pool allowed to be created is a constant product pool. +{% enddocs %} diff --git a/models/descriptions/value.md b/models/descriptions/value.md new file mode 100644 index 0000000..8a990c3 --- /dev/null +++ b/models/descriptions/value.md @@ -0,0 +1,3 @@ +{% docs value %} +The value for a data entry in manage data operations. +{% enddocs %} diff --git a/models/gold/core/core__dim_assets.sql b/models/gold/core/core__dim_assets.sql new file mode 100644 index 0000000..aa184bb --- /dev/null +++ b/models/gold/core/core__dim_assets.sql @@ -0,0 +1,34 @@ +-- depends_on: {{ ref('silver__assets') }} +{{ config( + materialized = 'incremental', + unique_key = ['asset_id'], + incremental_strategy = 'merge', + merge_exclude_columns = ['inserted_timestamp'], + post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(asset_code,asset_issuer,asset_id);", + tags = ['scheduled_core'] +) }} + +SELECT + asset_id, + asset_type, + asset_code, + asset_issuer, + id, + {{ dbt_utils.generate_surrogate_key( + ['asset_id'] + ) }} AS dim_assets_id, + SYSDATE() AS inserted_timestamp, + SYSDATE() AS modified_timestamp, + '{{ invocation_id }}' AS _invocation_id +FROM + {{ ref('silver__assets') }} + +{% if is_incremental() %} +WHERE + modified_timestamp >= ( + SELECT + MAX(modified_timestamp) + FROM + {{ this }} + ) +{% endif %} diff --git a/models/gold/core/core__dim_assets.yml b/models/gold/core/core__dim_assets.yml new file mode 100644 index 0000000..320428f --- /dev/null +++ b/models/gold/core/core__dim_assets.yml @@ -0,0 +1,54 @@ +version: 2 + +models: + - name: core__dim_assets + description: Dimension table containing information about assets on the network. + columns: + - name: ID + description: '{{ doc("id") }}' + tests: + - dbt_expectations.expect_column_to_exist + + - name: ASSET_TYPE + description: '{{ doc("asset_type") }}' + tests: + - dbt_expectations.expect_column_to_exist + - not_null + + - name: ASSET_CODE + description: '{{ doc("asset_code") }}' + tests: + - dbt_expectations.expect_column_to_exist + + - name: ASSET_ISSUER + description: '{{ doc("asset_issuer") }}' + tests: + - dbt_expectations.expect_column_to_exist + + - name: ASSET_ID + description: '{{ doc("asset_id") }}' + tests: + - dbt_expectations.expect_column_to_exist + - not_null + - unique + + - name: DIM_ASSETS_ID + description: '{{ doc("pk") }}' + tests: + - unique + - not_null + + - name: INSERTED_TIMESTAMP + description: '{{ doc("inserted_timestamp") }}' + tests: + - not_null + + - name: MODIFIED_TIMESTAMP + description: '{{ doc("modified_timestamp") }}' + tests: + - not_null + + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - asset_id diff --git a/models/gold/core/core__fact_accounts.sql b/models/gold/core/core__fact_accounts.sql new file mode 100644 index 0000000..9c4dac6 --- /dev/null +++ b/models/gold/core/core__fact_accounts.sql @@ -0,0 +1,52 @@ +-- depends_on: {{ ref('silver__accounts') }} +{{ config( + materialized = 'incremental', + unique_key = ["account_id","closed_at"], + incremental_predicates = ["dynamic_range_predicate", "block_timestamp::date"], + merge_exclude_columns = ["inserted_timestamp"], + cluster_by = ['block_timestamp::DATE','closed_at::DATE'], + post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(account_id);", + tags = ['scheduled_core'] +) }} + +SELECT + account_id, + balance, + buying_liabilities, + selling_liabilities, + sequence_number, + num_subentries, + inflation_destination, + flags, + home_domain, + master_weight, + threshold_low, + threshold_medium, + threshold_high, + last_modified_ledger, + ledger_entry_change, + deleted, + sponsor, + num_sponsored, + num_sponsoring, + sequence_ledger, + sequence_time, + closed_at, + closed_at AS block_timestamp, + ledger_sequence, + {{ dbt_utils.generate_surrogate_key(['account_id', 'closed_at']) }} AS fact_accounts_id, + SYSDATE() AS inserted_timestamp, + SYSDATE() AS modified_timestamp, + '{{ invocation_id }}' AS _invocation_id +FROM + {{ ref('silver__accounts') }} + +{% if is_incremental() %} +WHERE + modified_timestamp >= ( + SELECT + MAX(modified_timestamp) + FROM + {{ this }} + ) +{% endif %} diff --git a/models/gold/core/core__fact_accounts.yml b/models/gold/core/core__fact_accounts.yml new file mode 100644 index 0000000..fe3e733 --- /dev/null +++ b/models/gold/core/core__fact_accounts.yml @@ -0,0 +1,145 @@ +version: 2 + +models: + - name: core__fact_accounts + description: Core fact table containing all Stellar account information and their current states + columns: + - name: ACCOUNT_ID + description: "{{ doc('account_id') }}" + tests: + - not_null + + - name: BALANCE + description: '{{ doc("balance") }}' + tests: + - not_null + + - name: BUYING_LIABILITIES + description: '{{ doc("buying_liabilities") }}' + tests: + - not_null + + - name: SELLING_LIABILITIES + description: '{{ doc("selling_liabilities") }}' + tests: + - not_null + + - name: SEQUENCE_NUMBER + description: '{{ doc("sequence_number") }}' + tests: + - not_null + + - name: NUM_SUBENTRIES + description: '{{ doc("num_subentries") }}' + tests: + - not_null + + - name: INFLATION_DESTINATION + description: '{{ doc("inflation_destination") }}' + + - name: FLAGS + description: '{{ doc("flags") }}' + tests: + - not_null + + - name: HOME_DOMAIN + description: '{{ doc("home_domain") }}' + + - name: MASTER_WEIGHT + description: '{{ doc("master_weight") }}' + tests: + - not_null + + - name: THRESHOLD_LOW + description: '{{ doc("threshold_low") }}' + tests: + - not_null + + - name: THRESHOLD_MEDIUM + description: '{{ doc("threshold_medium") }}' + tests: + - not_null + + - name: THRESHOLD_HIGH + description: '{{ doc("threshold_high") }}' + tests: + - not_null + + - name: LAST_MODIFIED_LEDGER + description: '{{ doc("last_modified_ledger") }}' + tests: + - not_null + + - name: LEDGER_ENTRY_CHANGE + description: '{{ doc("ledger_entry_change") }}' + tests: + - not_null + + - name: DELETED + description: '{{ doc("deleted") }}' + tests: + - not_null + + - name: BATCH_ID + description: '{{ doc("batch_id") }}' + + - name: BATCH_RUN_DATE + description: '{{ doc("batch_run_date") }}' + + - name: BATCH_INSERT_TS + description: '{{ doc("batch_insert_ts") }}' + + - name: SPONSOR + description: '{{ doc("sponsor") }}' + + - name: NUM_SPONSORED + description: '{{ doc("num_sponsored") }}' + tests: + - not_null + + - name: NUM_SPONSORING + description: '{{ doc("num_sponsoring") }}' + tests: + - not_null + + - name: SEQUENCE_LEDGER + description: '{{ doc("sequence_ledger") }}' + tests: + - not_null + + - name: SEQUENCE_TIME + description: '{{ doc("sequence_time") }}' + tests: + - not_null + + - name: CLOSED_AT + description: '{{ doc("closed_at") }}' + tests: + - not_null + + - name: LEDGER_SEQUENCE + description: '{{ doc("ledger_sequence") }}' + tests: + - not_null + + - name: FACT_ACCOUNTS_ID + description: '{{ doc("pk") }}' + tests: + - unique + - not_null + + - name: INSERTED_TIMESTAMP + description: '{{ doc("inserted_timestamp") }}' + tests: + - not_null + + - name: MODIFIED_TIMESTAMP + description: '{{ doc("modified_timestamp") }}' + tests: + - not_null + + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - ACCOUNT_ID + - CLOSED_AT \ No newline at end of file diff --git a/models/gold/core/core__fact_ledgers.sql b/models/gold/core/core__fact_ledgers.sql new file mode 100644 index 0000000..3611586 --- /dev/null +++ b/models/gold/core/core__fact_ledgers.sql @@ -0,0 +1,53 @@ +-- depends_on: {{ ref('silver__ledgers') }} +{{ config( + materialized = 'incremental', + unique_key = ['sequence'], + incremental_predicates = ["dynamic_range_predicate", "block_timestamp::date"], + cluster_by = ['block_timestamp::DATE','closed_at::DATE'], + merge_exclude_columns = ['inserted_timestamp'], + tags = ['scheduled_core'] +) }} + +SELECT + SEQUENCE, + ledger_hash, + previous_ledger_hash, + transaction_count, + operation_count, + closed_at, + closed_at AS block_timestamp, + id, + total_coins, + fee_pool, + base_fee, + base_reserve, + max_tx_set_size, + protocol_version, + successful_transaction_count, + failed_transaction_count, + tx_set_operation_count, + batch_id, + batch_run_date, + batch_insert_ts, + soroban_fee_write_1kb, + node_id, + signature, + total_byte_size_of_bucket_list, + {{ dbt_utils.generate_surrogate_key( + ['sequence'] + ) }} AS fact_ledgers_id, + SYSDATE() AS inserted_timestamp, + SYSDATE() AS modified_timestamp, + '{{ invocation_id }}' AS _invocation_id +FROM + {{ ref('silver__ledgers') }} + +{% if is_incremental() %} +WHERE + modified_timestamp >= ( + SELECT + MAX(modified_timestamp) + FROM + {{ this }} + ) +{% endif %} diff --git a/models/gold/core/core__fact_ledgers.yml b/models/gold/core/core__fact_ledgers.yml new file mode 100644 index 0000000..d4c8993 --- /dev/null +++ b/models/gold/core/core__fact_ledgers.yml @@ -0,0 +1,142 @@ +version: 2 + +models: + - name: core__fact_ledgers + description: Fact table containing information about ledgers on the Stellar network. + columns: + - name: SEQUENCE + description: '{{ doc("sequence") }}' + tests: + - dbt_expectations.expect_column_to_exist + - not_null + - unique + + - name: LEDGER_HASH + description: '{{ doc("ledger_hash") }}' + tests: + - dbt_expectations.expect_column_to_exist + - not_null + + - name: PREVIOUS_LEDGER_HASH + description: '{{ doc("previous_ledger_hash") }}' + tests: + - dbt_expectations.expect_column_to_exist + + - name: TRANSACTION_COUNT + description: '{{ doc("transaction_count") }}' + tests: + - dbt_expectations.expect_column_to_exist + + - name: OPERATION_COUNT + description: '{{ doc("operation_count") }}' + tests: + - dbt_expectations.expect_column_to_exist + + - name: CLOSED_AT + description: '{{ doc("closed_at") }}' + tests: + - dbt_expectations.expect_column_to_exist + - not_null + - dbt_expectations.expect_row_values_to_have_recent_data: + datepart: day + interval: 1 + + - name: ID + description: '{{ doc("id") }}' + tests: + - dbt_expectations.expect_column_to_exist + - not_null + + - name: TOTAL_COINS + description: '{{ doc("total_coins") }}' + tests: + - dbt_expectations.expect_column_to_exist + + - name: FEE_POOL + description: '{{ doc("fee_pool") }}' + tests: + - dbt_expectations.expect_column_to_exist + + - name: BASE_FEE + description: '{{ doc("base_fee") }}' + tests: + - dbt_expectations.expect_column_to_exist + + - name: BASE_RESERVE + description: '{{ doc("base_reserve") }}' + tests: + - dbt_expectations.expect_column_to_exist + + - name: MAX_TX_SET_SIZE + description: '{{ doc("max_tx_set_size") }}' + tests: + - dbt_expectations.expect_column_to_exist + + - name: PROTOCOL_VERSION + description: '{{ doc("protocol_version") }}' + tests: + - dbt_expectations.expect_column_to_exist + + # - name: LEDGER_HEADER + # description: '{{ doc("ledger_header") }}' + # tests: + # - dbt_expectations.expect_column_to_exist + + - name: SUCCESSFUL_TRANSACTION_COUNT + description: '{{ doc("successful_transaction_count") }}' + tests: + - dbt_expectations.expect_column_to_exist + + - name: FAILED_TRANSACTION_COUNT + description: '{{ doc("failed_transaction_count") }}' + tests: + - dbt_expectations.expect_column_to_exist + + - name: TX_SET_OPERATION_COUNT + description: '{{ doc("tx_set_operation_count") }}' + tests: + - dbt_expectations.expect_column_to_exist + + - name: SOROBAN_FEE_WRITE_1KB + description: '{{ doc("soroban_fee_write_1kb") }}' + tests: + - dbt_expectations.expect_column_to_exist + + - name: NODE_ID + description: '{{ doc("node_id") }}' + tests: + - dbt_expectations.expect_column_to_exist + + - name: SIGNATURE + description: '{{ doc("signature") }}' + tests: + - dbt_expectations.expect_column_to_exist + + - name: TOTAL_BYTE_SIZE_OF_BUCKET_LIST + description: '{{ doc("total_byte_size_of_bucket_list") }}' + tests: + - dbt_expectations.expect_column_to_exist + + - name: FACT_LEDGERS_ID + description: '{{ doc("pk") }}' + tests: + - unique + - not_null + + - name: INSERTED_TIMESTAMP + description: '{{ doc("inserted_timestamp") }}' + tests: + - not_null + + - name: MODIFIED_TIMESTAMP + description: '{{ doc("modified_timestamp") }}' + tests: + - not_null + + - name: _INVOCATION_ID + description: '{{ doc("invocation_id") }}' + + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - SEQUENCE diff --git a/models/gold/core/core__fact_operations.sql b/models/gold/core/core__fact_operations.sql new file mode 100644 index 0000000..2e380e3 --- /dev/null +++ b/models/gold/core/core__fact_operations.sql @@ -0,0 +1,161 @@ +-- depends_on: {{ ref('silver__operations') }} +{{ config( + materialized = 'incremental', + unique_key = ["id"], + incremental_predicates = ["dynamic_range_predicate", "block_timestamp::date"], + merge_exclude_columns = ["inserted_timestamp"], + cluster_by = ['block_timestamp::DATE','closed_at::DATE','type_string'], + post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(source_account,asset,asset_code,asset_issuer,buying_asset_code,buying_asset_issuer,selling_asset_code,selling_asset_issuer);", + tags = ['scheduled_core'] +) }} + +SELECT + id, + closed_at, + closed_at AS block_timestamp, + account, + amount, + asset, + asset_code, + asset_issuer, + asset_type, + asset_id, + authorize, + balance_id, + buying_asset_code, + buying_asset_issuer, + buying_asset_type, + buying_asset_id, + "from" AS from_account, + funder, + high_threshold, + home_domain, + inflation_dest, + "into" into_account, + "limit" AS limit_amount, + low_threshold, + master_key_weight, + med_threshold, + NAME, + offer_id, + path, + price, + price_r, + selling_asset_code, + selling_asset_issuer, + selling_asset_type, + selling_asset_id, + set_flags, + set_flags_s, + signer_account_id, + signer_key, + signer_weight, + source_amount, + source_asset_code, + source_asset_issuer, + source_asset_type, + source_asset_id, + source_max, + starting_balance, + "to" AS to_account, + trustee, + trustor, + trustline_asset, + VALUE, + clear_flags, + clear_flags_s, + destination_min, + bump_to, + sponsor, + sponsored_id, + begin_sponsor, + authorize_to_maintain_liabilities, + clawback_enabled, + liquidity_pool_id, + reserve_a_asset_type, + reserve_a_asset_id, + reserve_a_asset_code, + reserve_a_asset_issuer, + reserve_a_max_amount, + reserve_a_deposit_amount, + reserve_b_asset_type, + reserve_b_asset_id, + reserve_b_asset_code, + reserve_b_asset_issuer, + reserve_b_max_amount, + reserve_b_deposit_amount, + min_price, + min_price_r, + max_price, + max_price_r, + shares_received, + reserve_a_min_amount, + reserve_b_min_amount, + shares, + reserve_a_withdraw_amount, + reserve_b_withdraw_amount, + source_account, + op_source_account_muxed, + transaction_id, + TYPE, + type_string, + ledger_sequence, + op_account_muxed, + op_account_muxed_id, + ledger_key_hash, + batch_id, + batch_run_date, + batch_insert_ts, + asset_balance_changes, + PARAMETERS, + parameters_decoded, + FUNCTION, + address, + soroban_operation_type, + extend_to, + contract_id, + contract_code_hash, + operation_result_code, + operation_trace_code, + begin_sponsor_muxed, + begin_sponsor_muxed_id, + claimable_balance_id, + claimant, + claimants, + claimant_muxed, + claimant_muxed_id, + data_account_id, + data_name, + details_json, + from_muxed, + from_muxed_id, + funder_muxed, + funder_muxed_id, + into_muxed, + into_muxed_id, + ledgers_to_expire, + op_account_id, + to_muxed, + to_muxed_id, + trustee_muxed, + trustee_muxed_id, + trustline_account_id, + trustor_muxed, + trustor_muxed_id, + _inserted_timestamp, + {{ dbt_utils.generate_surrogate_key(['id']) }} AS fact_operations_id, + SYSDATE() AS inserted_timestamp, + SYSDATE() AS modified_timestamp, + '{{ invocation_id }}' AS _invocation_id +FROM + {{ ref('silver__operations') }} + +{% if is_incremental() %} +WHERE + modified_timestamp >= ( + SELECT + MAX(modified_timestamp) + FROM + {{ this }} + ) +{% endif %} diff --git a/models/gold/core/core__fact_operations.yml b/models/gold/core/core__fact_operations.yml new file mode 100644 index 0000000..2a567ec --- /dev/null +++ b/models/gold/core/core__fact_operations.yml @@ -0,0 +1,449 @@ +version: 2 + +models: + - name: core__fact_operations + description: A comprehensive view of all operations executed on the Stellar network, including transaction details, operation types, and their outcomes. + columns: + - name: ID + description: '{{ doc("op_id") }}' + tests: + - unique + - not_null + + - name: ACCOUNT + description: '{{ doc("account") }}' + + - name: AMOUNT + description: '{{ doc("amount") }}' + + - name: ASSET_CODE + description: '{{ doc("asset_code") }}' + + - name: ASSET_ISSUER + description: '{{ doc("asset_issuer") }}' + + - name: ASSET_TYPE + description: '{{ doc("asset_type") }}' + + - name: ASSET_ID + description: '{{ doc("asset_id") }}' + + - name: AUTHORIZE + description: '{{ doc("authorize") }}' + + - name: BALANCE_ID + description: '{{ doc("balance_id") }}' + + - name: BUYING_ASSET_CODE + description: '{{ doc("buying_asset_code") }}' + + - name: BUYING_ASSET_ISSUER + description: '{{ doc("buying_asset_issuer") }}' + + - name: BUYING_ASSET_TYPE + description: '{{ doc("buying_asset_type") }}' + + - name: BUYING_ASSET_ID + description: '{{ doc("buying_asset_id") }}' + + - name: FROM_ACCOUNT + description: '{{ doc("from") }}' + + - name: FUNDER + description: '{{ doc("funder") }}' + + - name: HIGH_THRESHOLD + description: '{{ doc("threshold_high") }}' + + - name: HOME_DOMAIN + description: '{{ doc("home_domain") }}' + + - name: INFLATION_DEST + description: '{{ doc("inflation_destination") }}' + + - name: INTO_ACCOUNT + description: '{{ doc("into") }}' + + - name: LIMIT_AMOUNT + description: '{{ doc("limit") }}' + + - name: LOW_THRESHOLD + description: '{{ doc("threshold_low") }}' + + - name: MASTER_KEY_WEIGHT + description: '{{ doc("master_weight") }}' + + - name: MED_THRESHOLD + description: '{{ doc("threshold_medium") }}' + + - name: NAME + description: '{{ doc("name") }}' + + - name: OFFER_ID + description: '{{ doc("offer_id") }}' + + - name: PATH + description: '{{ doc("path") }}' + + - name: PRICE + description: '{{ doc("price") }}' + + - name: D + description: '{{ doc("d") }}' + + - name: N + description: '{{ doc("n") }}' + + - name: SELLING_ASSET_CODE + description: '{{ doc("selling_asset_code") }}' + + - name: SELLING_ASSET_ISSUER + description: '{{ doc("selling_asset_issuer") }}' + + - name: SELLING_ASSET_TYPE + description: '{{ doc("selling_asset_type") }}' + + - name: SELLING_ASSET_ID + description: '{{ doc("selling_asset_id") }}' + + - name: SET_FLAGS + description: '{{ doc("set_flags") }}' + + - name: SET_FLAGS_S + description: '{{ doc("set_flags_s") }}' + + - name: SIGNER_KEY + description: '{{ doc("signer_key") }}' + + - name: SIGNER_WEIGHT + description: '{{ doc("signer_weight") }}' + + - name: SOURCE_AMOUNT + description: '{{ doc("source_amount") }}' + + - name: SOURCE_ASSET_CODE + description: '{{ doc("source_asset_code") }}' + + - name: SOURCE_ASSET_ISSUER + description: '{{ doc("source_asset_issuer") }}' + + - name: SOURCE_ASSET_TYPE + description: '{{ doc("source_asset_type") }}' + + - name: SOURCE_ASSET_ID + description: '{{ doc("source_asset_id") }}' + + - name: SOURCE_MAX + description: '{{ doc("source_max") }}' + + - name: STARTING_BALANCE + description: '{{ doc("starting_balance") }}' + + - name: TO_ACCOUNT + description: '{{ doc("to") }}' + + - name: TRUSTEE + description: '{{ doc("trustee") }}' + + - name: TRUSTOR + description: '{{ doc("trustor") }}' + + - name: TRUSTLINE_ASSET + description: '{{ doc("trustline_asset") }}' + + - name: VALUE + description: '{{ doc("value") }}' + + - name: CLEAR_FLAGS + description: '{{ doc("clear_flags") }}' + + - name: CLEAR_FLAGS_S + description: '{{ doc("clear_flags_s") }}' + + - name: DESTINATION_MIN + description: '{{ doc("destination_min") }}' + + - name: BUMP_TO + description: '{{ doc("bump_to") }}' + + - name: SPONSOR + description: '{{ doc("sponsor") }}' + + - name: SPONSORED_ID + description: '{{ doc("sponsored_id") }}' + + - name: BEGIN_SPONSOR + description: '{{ doc("begin_sponsor") }}' + + - name: AUTHORIZE_TO_MAINTAIN_LIABILITIES + description: '{{ doc("authorize_to_maintain_liabilities") }}' + + - name: CLAWBACK_ENABLED + description: '{{ doc("clawback_enabled") }}' + + - name: LIQUIDITY_POOL_ID + description: '{{ doc("liquidity_pool_id") }}' + + - name: RESERVE_A_ASSET_TYPE + description: '{{ doc("reserve_a_asset_type") }}' + + - name: RESERVE_A_ASSET_ID + description: '{{ doc("reserve_a_asset_id") }}' + + - name: RESERVE_A_ASSET_CODE + description: '{{ doc("reserve_a_asset_code") }}' + + - name: RESERVE_A_ASSET_ISSUER + description: '{{ doc("reserve_a_asset_issuer") }}' + + - name: RESERVE_A_MAX_AMOUNT + description: '{{ doc("reserve_a_max_amount") }}' + + - name: RESERVE_A_DEPOSIT_AMOUNT + description: '{{ doc("reserve_a_deposit_amount") }}' + + - name: RESERVE_B_ASSET_TYPE + description: '{{ doc("reserve_b_asset_type") }}' + + - name: RESERVE_B_ASSET_ID + description: '{{ doc("reserve_b_asset_id") }}' + + - name: RESERVE_B_ASSET_CODE + description: '{{ doc("reserve_b_asset_code") }}' + + - name: RESERVE_B_ASSET_ISSUER + description: '{{ doc("reserve_b_asset_issuer") }}' + + - name: RESERVE_B_MAX_AMOUNT + description: '{{ doc("reserve_b_max_amount") }}' + + - name: RESERVE_B_DEPOSIT_AMOUNT + description: '{{ doc("reserve_b_deposit_amount") }}' + + - name: MIN_PRICE_R + description: '{{ doc("min_price_r") }}' + + - name: MAX_PRICE_R + description: '{{ doc("max_price_r") }}' + + - name: SHARES_RECEIVED + description: '{{ doc("shares_received") }}' + + - name: RESERVE_A_MIN_AMOUNT + description: '{{ doc("reserve_a_min_amount") }}' + + - name: RESERVE_B_MIN_AMOUNT + description: '{{ doc("reserve_b_min_amount") }}' + + - name: SHARES + description: '{{ doc("shares") }}' + + - name: RESERVE_A_WITHDRAW_AMOUNT + description: '{{ doc("reserve_a_withdraw_amount") }}' + + - name: RESERVE_B_WITHDRAW_AMOUNT + description: '{{ doc("reserve_b_withdraw_amount") }}' + + - name: OP_SOURCE_ACCOUNT + description: '{{ doc("op_source_account") }}' + + - name: OP_SOURCE_ACCOUNT_MUXED + description: '{{ doc("op_source_account_muxed") }}' + + - name: TRANSACTION_ID + description: '{{ doc("transaction_id") }}' + + - name: TYPE + description: '{{ doc("type") }}' + + - name: TRANSACTION_HASH + description: '{{ doc("transaction_hash") }}' + + - name: LEDGER_SEQUENCE + description: '{{ doc("ledger_sequence") }}' + + - name: TXN_ACCOUNT + description: '{{ doc("txn_account") }}' + + - name: ACCOUNT_SEQUENCE + description: '{{ doc("account_sequence") }}' + + - name: MAX_FEE + description: '{{ doc("max_fee") }}' + + - name: TXN_OPERATION_COUNT + description: '{{ doc("txn_operation_count") }}' + + - name: TXN_CREATED_AT + description: '{{ doc("txn_created_at") }}' + + - name: MEMO_TYPE + description: '{{ doc("memo_type") }}' + + - name: MEMO + description: '{{ doc("memo") }}' + + - name: TIME_BOUNDS + description: '{{ doc("time_bounds") }}' + + - name: SUCCESSFUL + description: '{{ doc("successful") }}' + + - name: FEE_CHARGED + description: '{{ doc("fee_charged") }}' + + - name: FEE_ACCOUNT + description: '{{ doc("fee_account") }}' + + - name: NEW_MAX_FEE + description: '{{ doc("new_max_fee") }}' + + - name: ACCOUNT_MUXED + description: '{{ doc("account_muxed") }}' + + - name: FEE_ACCOUNT_MUXED + description: '{{ doc("fee_account_muxed") }}' + + - name: LEDGER_HASH + description: '{{ doc("ledger_hash") }}' + + - name: PREVIOUS_LEDGER_HASH + description: '{{ doc("previous_ledger_hash") }}' + + - name: TRANSACTION_COUNT + description: '{{ doc("transaction_count") }}' + + - name: LEDGER_OPERATION_COUNT + description: '{{ doc("ledger_operation_count") }}' + + - name: CLOSED_AT + description: '{{ doc("closed_at") }}' + + - name: TOTAL_COINS + description: '{{ doc("total_coins") }}' + + - name: FEE_POOL + description: '{{ doc("fee_pool") }}' + + - name: BASE_FEE + description: '{{ doc("base_fee") }}' + + - name: BASE_RESERVE + description: '{{ doc("base_reserve") }}' + + - name: MAX_TX_SET_SIZE + description: '{{ doc("max_tx_set_size") }}' + + - name: PROTOCOL_VERSION + description: '{{ doc("protocol_version") }}' + + - name: SUCCESSFUL_TRANSACTION_COUNT + description: '{{ doc("successful_transaction_count") }}' + + - name: FAILED_TRANSACTION_COUNT + description: '{{ doc("failed_transaction_count") }}' + + - name: BATCH_ID + description: '{{ doc("batch_id") }}' + + - name: BATCH_RUN_DATE + description: '{{ doc("batch_run_date") }}' + + - name: BATCH_INSERT_TS + description: '{{ doc("batch_insert_ts") }}' + + - name: LEDGER_BOUNDS + description: '{{ doc("ledger_bounds") }}' + + - name: MIN_ACCOUNT_SEQUENCE + description: '{{ doc("min_account_sequence") }}' + + - name: MIN_ACCOUNT_SEQUENCE_AGE + description: '{{ doc("min_account_sequence_age") }}' + + - name: MIN_ACCOUNT_SEQUENCE_LEDGER_GAP + description: '{{ doc("min_account_sequence_ledger_gap") }}' + + - name: EXTRA_SIGNERS + description: '{{ doc("extra_signers") }}' + + - name: ASSET_BALANCE_CHANGES + description: '{{ doc("asset_balance_changes") }}' + + - name: PARAMETERS + description: '{{ doc("parameters") }}' + + - name: PARAMETERS_DECODED + description: '{{ doc("parameters_decoded") }}' + + - name: FUNCTION + description: '{{ doc("function") }}' + + - name: ADDRESS + description: '{{ doc("address") }}' + + - name: SOROBAN_OPERATION_TYPE + description: '{{ doc("soroban_operation_type") }}' + + - name: EXTEND_TO + description: '{{ doc("extend_to") }}' + + - name: CONTRACT_ID + description: '{{ doc("contract_id") }}' + + - name: CONTRACT_CODE_HASH + description: '{{ doc("contract_code_hash") }}' + + - name: RESOURCE_FEE + description: '{{ doc("resource_fee") }}' + + - name: SOROBAN_RESOURCES_INSTRUCTIONS + description: '{{ doc("soroban_resources_instructions") }}' + + - name: SOROBAN_RESOURCES_READ_BYTES + description: '{{ doc("soroban_resources_read_bytes") }}' + + - name: SOROBAN_RESOURCES_WRITE_BYTES + description: '{{ doc("soroban_resources_write_bytes") }}' + + - name: TRANSACTION_RESULT_CODE + description: '{{ doc("transaction_result_code") }}' + + - name: INCLUSION_FEE_BID + description: '{{ doc("inclusion_fee_bid") }}' + + - name: INCLUSION_FEE_CHARGED + description: '{{ doc("inclusion_fee_charged") }}' + + - name: RESOURCE_FEE_REFUND + description: '{{ doc("resource_fee_refund") }}' + + - name: OPERATION_RESULT_CODE + description: '{{ doc("operation_result_code") }}' + + - name: OPERATION_TRACE_CODE + description: '{{ doc("operation_trace_code") }}' + + - name: OP_APPLICATION_ORDER + description: '{{ doc("op_application_order") }}' + + - name: TXN_APPLICATION_ORDER + description: '{{ doc("txn_application_order") }}' + + - name: _INSERTED_TIMESTAMP + description: '{{ doc("inserted_timestamp") }}' + + - name: FACT_OPERATIONS_ID + description: '{{ doc("pk") }}' + + - name: INSERTED_TIMESTAMP + description: '{{ doc("inserted_timestamp") }}' + + - name: MODIFIED_TIMESTAMP + description: '{{ doc("modified_timestamp") }}' + + - name: _INVOCATION_ID + description: '{{ doc("invocation_id") }}' + + - name: DETAILS_JSON + description: '{{ doc("details_json") }}' \ No newline at end of file diff --git a/models/gold/core/core__fact_transactions.sql b/models/gold/core/core__fact_transactions.sql new file mode 100644 index 0000000..ae0c375 --- /dev/null +++ b/models/gold/core/core__fact_transactions.sql @@ -0,0 +1,76 @@ +-- depends_on: {{ ref('silver__transactions') }} +{{ config( + materialized = 'incremental', + unique_key = ["id"], + incremental_predicates = ["dynamic_range_predicate", "block_timestamp::date"], + merge_exclude_columns = ["inserted_timestamp"], + cluster_by = ['block_timestamp::DATE','closed_at::DATE'], + post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(id,transaction_hash,account);", + tags = ['scheduled_core'] +) }} + +SELECT + id, + transaction_hash, + ledger_sequence, + closed_at, + closed_at AS block_timestamp, + account, + account_sequence, + max_fee, + operation_count, + created_at, + memo_type, + memo, + time_bounds, + SUCCESSFUL, + fee_charged, + inner_transaction_hash, + fee_account, + new_max_fee, + account_muxed, + fee_account_muxed, + batch_id, + batch_run_date, + batch_insert_ts, + ledger_bounds, + min_account_sequence, + min_account_sequence_age, + min_account_sequence_ledger_gap, + tx_envelope, + tx_result, + tx_meta, + tx_fee_meta, + extra_signers, + resource_fee, + soroban_resources_instructions, + soroban_resources_read_bytes, + soroban_resources_write_bytes, + transaction_result_code, + inclusion_fee_bid, + inclusion_fee_charged, + resource_fee_refund, + non_refundable_resource_fee_charged, + refundable_resource_fee_charged, + rent_fee_charged, + tx_signers, + refundable_fee, + _inserted_timestamp, + {{ dbt_utils.generate_surrogate_key( + ['id'] + ) }} AS fact_transactions_id, + SYSDATE() AS inserted_timestamp, + SYSDATE() AS modified_timestamp, + '{{ invocation_id }}' AS _invocation_id +FROM + {{ ref('silver__transactions') }} + +{% if is_incremental() %} +WHERE + modified_timestamp >= ( + SELECT + MAX(modified_timestamp) + FROM + {{ this }} + ) +{% endif %} diff --git a/models/gold/core/core__fact_transactions.yml b/models/gold/core/core__fact_transactions.yml new file mode 100644 index 0000000..b3c5fb0 --- /dev/null +++ b/models/gold/core/core__fact_transactions.yml @@ -0,0 +1,193 @@ +version: 2 + +models: + - name: core__fact_transactions + description: Fact table containing transaction details from the Stellar network. + columns: + # - name: id + # description: '{{ doc("pk") }}' + # tests: + # - unique + # - not_null + + - name: id + description: Unique identifier for the transaction + tests: + - not_null + - unique + + - name: transaction_hash + description: '{{ doc("transaction_hash") }}' + tests: + - not_null + + - name: ledger_sequence + description: '{{ doc("ledger_sequence") }}' + tests: + - not_null + + - name: account + description: '{{ doc("account") }}' + tests: + - not_null + + - name: account_sequence + description: '{{ doc("account_sequence") }}' + tests: + - not_null + + - name: max_fee + description: '{{ doc("max_fee") }}' + tests: + - not_null + + - name: operation_count + description: '{{ doc("operation_count") }}' + tests: + - not_null + + - name: created_at + description: '{{ doc("txn_created_at") }}' + tests: + - not_null + + - name: memo_type + description: '{{ doc("memo_type") }}' + + - name: memo + description: '{{ doc("memo") }}' + + - name: time_bounds + description: '{{ doc("time_bounds") }}' + + - name: successful + description: '{{ doc("successful") }}' + # tests: + # - not_null + + - name: fee_charged + description: '{{ doc("fee_charged") }}' + tests: + - not_null + + - name: inner_transaction_hash + description: '{{ doc("inner_transaction_hash") }}' + + - name: fee_account + description: '{{ doc("fee_account") }}' + + - name: new_max_fee + description: '{{ doc("new_max_fee") }}' + + - name: account_muxed + description: '{{ doc("account_muxed") }}' + + - name: fee_account_muxed + description: '{{ doc("fee_account_muxed") }}' + + - name: batch_id + description: '{{ doc("batch_id") }}' + tests: + - not_null + + - name: batch_run_date + description: '{{ doc("batch_run_date") }}' + tests: + - not_null + + - name: batch_insert_ts + description: '{{ doc("batch_insert_ts") }}' + tests: + - not_null + + - name: ledger_bounds + description: '{{ doc("ledger_bounds") }}' + + - name: min_account_sequence + description: '{{ doc("min_account_sequence") }}' + + - name: min_account_sequence_age + description: '{{ doc("min_account_sequence_age") }}' + + - name: min_account_sequence_ledger_gap + description: '{{ doc("min_account_sequence_ledger_gap") }}' + + - name: tx_envelope + description: '{{ doc("tx_envelope") }}' + + - name: tx_result + description: '{{ doc("tx_result") }}' + + - name: tx_meta + description: '{{ doc("tx_meta") }}' + + - name: tx_fee_meta + description: '{{ doc("tx_fee_meta") }}' + + - name: extra_signers + description: '{{ doc("extra_signers") }}' + + - name: resource_fee + description: '{{ doc("resource_fee") }}' + + - name: soroban_resources_instructions + description: '{{ doc("soroban_resources_instructions") }}' + + - name: soroban_resources_read_bytes + description: '{{ doc("soroban_resources_read_bytes") }}' + + - name: soroban_resources_write_bytes + description: '{{ doc("soroban_resources_write_bytes") }}' + + - name: closed_at + description: '{{ doc("closed_at") }}' + tests: + - not_null + + - name: transaction_result_code + description: '{{ doc("transaction_result_code") }}' + + - name: inclusion_fee_bid + description: '{{ doc("inclusion_fee_bid") }}' + + - name: inclusion_fee_charged + description: '{{ doc("inclusion_fee_charged") }}' + + - name: resource_fee_refund + description: '{{ doc("resource_fee_refund") }}' + + - name: non_refundable_resource_fee_charged + description: '{{ doc("non_refundable_resource_fee_charged") }}' + + - name: refundable_resource_fee_charged + description: '{{ doc("refundable_resource_fee_charged") }}' + + - name: rent_fee_charged + description: '{{ doc("rent_fee_charged") }}' + + - name: tx_signers + description: '{{ doc("tx_signers") }}' + + - name: refundable_fee + description: '{{ doc("refundable_fee") }}' + + - name: fact_transactions_id + description: '{{ doc("pk") }}' + tests: + - not_null + - unique + + - name: inserted_timestamp + description: '{{ doc("inserted_timestamp") }}' + tests: + - not_null + + - name: modified_timestamp + description: '{{ doc("modified_timestamp") }}' + tests: + - not_null + + - name: _invocation_id + description: '{{ doc("invocation_id") }}' + tests: + - not_null diff --git a/models/gold/defi/defi__fact_liquidity_pools.sql b/models/gold/defi/defi__fact_liquidity_pools.sql new file mode 100644 index 0000000..6c71d6f --- /dev/null +++ b/models/gold/defi/defi__fact_liquidity_pools.sql @@ -0,0 +1,62 @@ +-- depends_on: {{ ref('silver__liquidity_pools') }} +{{ config( + materialized = 'incremental', + unique_key = ["liquidity_pool_id", "closed_at"], + incremental_predicates = ["dynamic_range_predicate", "block_timestamp::date"], + merge_exclude_columns = ["inserted_timestamp"], + cluster_by = ['block_timestamp::DATE','closed_at::DATE'], + post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(liquidity_pool_id,asset_a_issuer,asset_b_issuer,asset_a_code,asset_b_code);", + tags = ['scheduled_core'] +) }} + +SELECT + liquidity_pool_id, + closed_at, + closed_at AS block_timestamp, + TYPE, + fee, + trustline_count, + pool_share_count, + asset_a_type, + asset_a_code, + asset_a_issuer, + asset_a_id, + asset_a_amount, + asset_b_type, + asset_b_code, + asset_b_issuer, + asset_b_id, + asset_b_amount, + last_modified_ledger, + ledger_entry_change, + deleted, + batch_id, + batch_run_date, + batch_insert_ts, + ledger_sequence, + _inserted_timestamp, + {{ dbt_utils.generate_surrogate_key( + ['liquidity_pool_id', 'closed_at'] + ) }} AS fact_liquidity_pools_id, + SYSDATE() AS inserted_timestamp, + SYSDATE() AS modified_timestamp, + '{{ invocation_id }}' AS _invocation_id +FROM + {{ ref('silver__liquidity_pools') }} + +{% if is_incremental() %} +WHERE + _inserted_timestamp > ( + SELECT + MAX(_inserted_timestamp) + FROM + {{ this }} + ) +{% endif %} + +qualify ROW_NUMBER() over ( + PARTITION BY liquidity_pool_id, + closed_at + ORDER BY + _inserted_timestamp DESC +) = 1 diff --git a/models/gold/defi/defi__fact_liquidity_pools.yml b/models/gold/defi/defi__fact_liquidity_pools.yml new file mode 100644 index 0000000..ad056ac --- /dev/null +++ b/models/gold/defi/defi__fact_liquidity_pools.yml @@ -0,0 +1,101 @@ +version: 2 + +models: + - name: defi__fact_liquidity_pools + description: Fact table containing liquidity pool data including pool details, asset pairs, and metrics. + + columns: + + - name: LIQUIDITY_POOL_ID + description: '{{ doc("liquidity_pool_id") }}' + tests: + - not_null + + - name: TYPE + description: '{{ doc("type") }}' + + - name: FEE + description: '{{ doc("fee") }}' + + - name: TRUSTLINE_COUNT + description: '{{ doc("trustline_count") }}' + + - name: POOL_SHARE_COUNT + description: '{{ doc("pool_share_count") }}' + + - name: ASSET_A_TYPE + description: '{{ doc("asset_type") }}' + + - name: ASSET_A_CODE + description: '{{ doc("asset_code") }}' + + - name: ASSET_A_ISSUER + description: '{{ doc("asset_issuer") }}' + + - name: ASSET_A_ID + description: '{{ doc("asset_id") }}' + + - name: ASSET_A_AMOUNT + description: '{{ doc("asset_a_amount") }}' + + - name: ASSET_B_TYPE + description: '{{ doc("asset_type") }}' + + - name: ASSET_B_CODE + description: '{{ doc("asset_code") }}' + + - name: ASSET_B_ISSUER + description: '{{ doc("asset_issuer") }}' + + - name: ASSET_B_ID + description: '{{ doc("asset_id") }}' + + - name: ASSET_B_AMOUNT + description: '{{ doc("asset_b_amount") }}' + + - name: LAST_MODIFIED_LEDGER + description: '{{ doc("last_modified_ledger") }}' + + - name: LEDGER_ENTRY_CHANGE + description: '{{ doc("ledger_entry_change") }}' + + - name: DELETED + description: '{{ doc("deleted") }}' + + - name: BATCH_ID + description: '{{ doc("batch_id") }}' + + - name: BATCH_RUN_DATE + description: '{{ doc("batch_run_date") }}' + + - name: BATCH_INSERT_TS + description: '{{ doc("batch_insert_ts") }}' + + - name: CLOSED_AT + description: '{{ doc("closed_at") }}' + tests: + - not_null + + - name: LEDGER_SEQUENCE + description: '{{ doc("ledger_sequence") }}' + + - name: FACT_LIQUIDITY_POOLS_ID + description: '{{ doc("pk") }}' + tests: + - unique + - not_null + + - name: INSERTED_TIMESTAMP + description: '{{ doc("inserted_timestamp") }}' + tests: + - not_null + + - name: MODIFIED_TIMESTAMP + description: '{{ doc("modified_timestamp") }}' + tests: + - not_null + + - name: _INVOCATION_ID + description: '{{ doc("invocation_id") }}' + tests: + - not_null diff --git a/models/gold/defi/defi__fact_trades.sql b/models/gold/defi/defi__fact_trades.sql new file mode 100644 index 0000000..3016984 --- /dev/null +++ b/models/gold/defi/defi__fact_trades.sql @@ -0,0 +1,59 @@ +--depends_on: {{ ref('silver__trades') }} +{{ config( + materialized = 'incremental', + unique_key = ["history_operation_id", "trade_order"], + incremental_predicates = ["dynamic_range_predicate", "block_timestamp::date"], + merge_exclude_columns = ["inserted_timestamp"], + cluster_by = ['block_timestamp::DATE','ledger_closed_at::DATE'], + post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(selling_account_address,selling_asset_code,selling_asset_issuer,buying_account_address,buying_asset_code,buying_asset_issuer);", + tags = ['scheduled_core'] +) }} + +SELECT + history_operation_id, + "order" AS trade_order, + ledger_closed_at, + ledger_closed_at AS block_timestamp, + selling_account_address, + selling_asset_code, + selling_asset_issuer, + selling_asset_type, + selling_asset_id, + selling_amount, + buying_account_address, + buying_asset_code, + buying_asset_issuer, + buying_asset_type, + buying_asset_id, + buying_amount, + price_n, + price_d, + selling_offer_id, + buying_offer_id, + batch_id, + batch_run_date, + batch_insert_ts, + selling_liquidity_pool_id, + liquidity_pool_fee, + trade_type, + rounding_slippage, + seller_is_exact, + _inserted_timestamp, + {{ dbt_utils.generate_surrogate_key( + ['history_operation_id','trade_order'] + ) }} AS fact_trades_id, + SYSDATE() AS inserted_timestamp, + SYSDATE() AS modified_timestamp, + '{{ invocation_id }}' AS _invocation_id +FROM + {{ ref('silver__trades') }} + +{% if is_incremental() %} +WHERE + _inserted_timestamp > ( + SELECT + MAX(_inserted_timestamp) + FROM + {{ this }} + ) +{% endif %} diff --git a/models/gold/defi/defi__fact_trades.yml b/models/gold/defi/defi__fact_trades.yml new file mode 100644 index 0000000..5c25d30 --- /dev/null +++ b/models/gold/defi/defi__fact_trades.yml @@ -0,0 +1,129 @@ +version: 2 + +models: + - name: defi__fact_trades + description: A fact table containing trade execution details from both the decentralized exchange and liquidity pools. + columns: + - name: history_operation_id + description: '{{ doc("history_operation_id") }}' + tests: + - not_null + + - name: trade_order + description: '{{ doc("order") }}' + tests: + - not_null + + - name: ledger_closed_at + description: '{{ doc("closed_at") }}' + tests: + - not_null + + - name: selling_account_address + description: '{{ doc("selling_account_address") }}' + tests: + - not_null + + - name: selling_asset_code + description: '{{ doc("selling_asset_code") }}' + + - name: selling_asset_issuer + description: '{{ doc("selling_asset_issuer") }}' + + - name: selling_asset_type + description: '{{ doc("selling_asset_type") }}' + tests: + - not_null + + - name: selling_asset_id + description: '{{ doc("selling_asset_id") }}' + tests: + - not_null + + - name: selling_amount + description: '{{ doc("selling_amount") }}' + tests: + - not_null + + - name: buying_account_address + description: '{{ doc("buying_account_address") }}' + tests: + - not_null + + - name: buying_asset_code + description: '{{ doc("buying_asset_code") }}' + + - name: buying_asset_issuer + description: '{{ doc("buying_asset_issuer") }}' + + - name: buying_asset_type + description: '{{ doc("buying_asset_type") }}' + tests: + - not_null + + - name: buying_asset_id + description: '{{ doc("buying_asset_id") }}' + tests: + - not_null + + - name: buying_amount + description: '{{ doc("buying_amount") }}' + tests: + - not_null + + - name: price_n + description: '{{ doc("price_n") }}' + tests: + - not_null + + - name: price_d + description: '{{ doc("price_d") }}' + tests: + - not_null + + - name: selling_offer_id + description: '{{ doc("selling_offer_id") }}' + + - name: buying_offer_id + description: '{{ doc("buying_offer_id") }}' + + - name: selling_liquidity_pool_id + description: '{{ doc("selling_liquidity_pool_id") }}' + + - name: liquidity_pool_fee + description: '{{ doc("liquidity_pool_fee") }}' + + - name: trade_type + description: '{{ doc("trade_type") }}' + tests: + - not_null + + - name: rounding_slippage + description: '{{ doc("rounding_slippage") }}' + + - name: seller_is_exact + description: '{{ doc("seller_is_exact") }}' + + - name: fact_trades_id + description: '{{ doc("pk") }}' + tests: + - unique + - not_null + + - name: _inserted_timestamp + description: '{{ doc("inserted_timestamp") }}' + tests: + - not_null + + - name: inserted_timestamp + description: '{{ doc("inserted_timestamp") }}' + tests: + - not_null + + - name: modified_timestamp + description: '{{ doc("modified_timestamp") }}' + tests: + - not_null + + - name: _invocation_id + description: '{{ doc("invocation_id") }}' diff --git a/models/gold/operations/core__ez_operations.sql b/models/gold/operations/core__ez_operations.sql new file mode 100644 index 0000000..80dd034 --- /dev/null +++ b/models/gold/operations/core__ez_operations.sql @@ -0,0 +1,411 @@ +-- depends_on: {{ ref('core__fact_operations') }} +-- depends_on: {{ ref('core__fact_transactions') }} +-- depends_on: {{ ref('core__fact_ledgers') }} + +{{ config( + materialized='incremental', + unique_key=['op_id'], + cluster_by=['block_timestamp::DATE', 'closed_at::DATE', 'type_string'], + post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(op_source_account,asset,asset_code,asset_issuer,buying_asset_code,buying_asset_issuer,selling_asset_code,selling_asset_issuer,tx_id,transaction_hash,ledger_sequence);", + tags=['scheduled_core'] +) }} + +WITH operations AS ( + SELECT + id as op_id, + source_account as op_source_account, + op_source_account_muxed, + account as op_account_id, + amount, + asset, + asset_code, + asset_issuer, + asset_type, + authorize, + coalesce(balance_id, claimable_balance_id) as balance_id, + claimant, + claimant_muxed, + claimant_muxed_id, + claimants, + data_account_id, + data_name, + buying_asset_code, + buying_asset_issuer, + buying_asset_type, + from_account, + from_muxed, + from_muxed_id, + funder, + funder_muxed, + funder_muxed_id, + high_threshold, + home_domain, + inflation_dest, + into_account, + into_muxed, + into_muxed_id, + limit_amount, + low_threshold, + master_key_weight, + med_threshold, + name, + offer_id, + path, + price, + price_r, + selling_asset_code, + selling_asset_issuer, + selling_asset_type, + set_flags, + set_flags_s, + signer_account_id, + signer_key, + signer_weight, + source_amount, + source_asset_code, + source_asset_issuer, + source_asset_type, + source_max, + starting_balance, + to_account, + to_muxed, + to_muxed_id, + trustee, + trustee_muxed, + trustee_muxed_id, + trustor, + trustor_muxed, + trustor_muxed_id, + trustline_account_id, + trustline_asset, + value, + clear_flags, + clear_flags_s, + destination_min, + bump_to, + sponsor, + sponsored_id, + begin_sponsor, + begin_sponsor_muxed, + begin_sponsor_muxed_id, + authorize_to_maintain_liabilities, + clawback_enabled, + liquidity_pool_id, + reserve_a_asset_type, + reserve_a_asset_code, + reserve_a_asset_issuer, + reserve_a_max_amount, + reserve_a_deposit_amount, + reserve_b_asset_type, + reserve_b_asset_code, + reserve_b_asset_issuer, + reserve_b_max_amount, + reserve_b_deposit_amount, + min_price, + min_price_r, + max_price, + max_price_r, + shares_received, + reserve_a_min_amount, + reserve_b_min_amount, + shares, + reserve_a_withdraw_amount, + reserve_b_withdraw_amount, + transaction_id as tx_id, + type, + type_string, + batch_id, + batch_run_date, + asset_balance_changes, + parameters, + parameters_decoded, + function, + address, + soroban_operation_type, + extend_to, + contract_id, + contract_code_hash, + operation_result_code, + operation_trace_code, + details_json, + modified_timestamp, + _inserted_timestamp + FROM {{ ref('core__fact_operations') }} + {% if is_incremental() %} + WHERE + modified_timestamp >= ( + SELECT + MAX(modified_timestamp) + FROM + {{ this }} + ) + {% endif %} +), + +transactions AS ( + SELECT + id as tx_id, + transaction_hash, + ledger_sequence, + account as tx_account, + account_sequence, + max_fee, + operation_count as tx_operation_count, + created_at as tx_created_at, + memo_type, + memo, + time_bounds, + successful, + fee_charged, + fee_account, + new_max_fee, + account_muxed, + fee_account_muxed, + ledger_bounds, + min_account_sequence, + min_account_sequence_age, + min_account_sequence_ledger_gap, + extra_signers, + batch_id, + batch_run_date, + resource_fee, + soroban_resources_instructions, + soroban_resources_read_bytes, + soroban_resources_write_bytes, + transaction_result_code, + inclusion_fee_bid, + inclusion_fee_charged, + resource_fee_refund, + non_refundable_resource_fee_charged, + refundable_resource_fee_charged, + rent_fee_charged, + tx_signers, + refundable_fee + FROM {{ ref('core__fact_transactions') }} + {% if is_incremental() %} + WHERE + modified_timestamp >= ( + SELECT + MAX(modified_timestamp) + FROM + {{ this }} + ) + {% endif %} +), + +ledgers AS ( + SELECT + sequence as ledger_sequence, + ledger_hash, + previous_ledger_hash, + transaction_count, + operation_count AS ledger_operation_count, + closed_at, + closed_at AS block_timestamp, + id AS ledger_id, + total_coins, + fee_pool, + base_fee, + base_reserve, + max_tx_set_size, + protocol_version, + successful_transaction_count, + failed_transaction_count, + soroban_fee_write_1kb, + node_id, + signature, + total_byte_size_of_bucket_list, + batch_id, + batch_run_date + FROM {{ ref('core__fact_ledgers') }} + {% if is_incremental() %} + WHERE + modified_timestamp >= ( + SELECT + MAX(modified_timestamp) + FROM + {{ this }} + ) + AND ledger_sequence = 55184199 + {% endif %} +) + +SELECT + o.op_id, + o.op_source_account, + o.op_source_account_muxed, + o.op_account_id, + o.amount, + o.asset, + o.asset_code, + o.asset_issuer, + o.asset_type, + o.authorize, + o.balance_id, + o.claimant, + o.claimant_muxed, + o.claimant_muxed_id, + o.claimants, + o.data_account_id, + o.data_name, + o.buying_asset_code, + o.buying_asset_issuer, + o.buying_asset_type, + o.from_account, + o.from_muxed, + o.from_muxed_id, + o.funder, + o.funder_muxed, + o.funder_muxed_id, + o.high_threshold, + o.home_domain, + o.inflation_dest, + o.into_account, + o.into_muxed, + o.into_muxed_id, + o.limit_amount, + o.low_threshold, + o.master_key_weight, + o.med_threshold, + o.name, + o.offer_id, + o.path, + o.price, + o.price_r, + o.selling_asset_code, + o.selling_asset_issuer, + o.selling_asset_type, + o.set_flags, + o.set_flags_s, + o.signer_account_id, + o.signer_key, + o.signer_weight, + o.source_amount, + o.source_asset_code, + o.source_asset_issuer, + o.source_asset_type, + o.source_max, + o.starting_balance, + o.to_account, + o.to_muxed, + o.to_muxed_id, + o.trustee, + o.trustee_muxed, + o.trustee_muxed_id, + o.trustor, + o.trustor_muxed, + o.trustor_muxed_id, + o.trustline_account_id, + o.trustline_asset, + o.value, + o.clear_flags, + o.clear_flags_s, + o.destination_min, + o.bump_to, + o.sponsor, + o.sponsored_id, + o.begin_sponsor, + o.begin_sponsor_muxed, + o.begin_sponsor_muxed_id, + o.authorize_to_maintain_liabilities, + o.clawback_enabled, + o.liquidity_pool_id, + o.reserve_a_asset_type, + o.reserve_a_asset_code, + o.reserve_a_asset_issuer, + o.reserve_a_max_amount, + o.reserve_a_deposit_amount, + o.reserve_b_asset_type, + o.reserve_b_asset_code, + o.reserve_b_asset_issuer, + o.reserve_b_max_amount, + o.reserve_b_deposit_amount, + o.min_price, + o.min_price_r, + o.max_price, + o.max_price_r, + o.shares_received, + o.reserve_a_min_amount, + o.reserve_b_min_amount, + o.shares, + o.reserve_a_withdraw_amount, + o.reserve_b_withdraw_amount, + o.tx_id, + o.type, + o.type_string, + o.batch_id, + o.batch_run_date, + o.asset_balance_changes, + o.parameters, + o.parameters_decoded, + o.function, + o.address, + o.soroban_operation_type, + o.extend_to, + o.contract_id, + o.contract_code_hash, + o.operation_result_code, + o.operation_trace_code, + o.details_json, + l.closed_at, + l.block_timestamp, + t.transaction_hash, + t.ledger_sequence, + t.tx_account, + t.account_sequence, + t.max_fee, + t.tx_operation_count, + t.tx_created_at, + t.memo_type, + t.memo, + t.time_bounds, + t.successful, + t.fee_charged, + t.fee_account, + t.new_max_fee, + t.account_muxed, + t.fee_account_muxed, + t.ledger_bounds, + t.min_account_sequence, + t.min_account_sequence_age, + t.min_account_sequence_ledger_gap, + t.extra_signers, + t.resource_fee, + t.soroban_resources_instructions, + t.soroban_resources_read_bytes, + t.soroban_resources_write_bytes, + t.transaction_result_code, + t.inclusion_fee_bid, + t.inclusion_fee_charged, + t.resource_fee_refund, + l.ledger_hash, + l.previous_ledger_hash, + l.transaction_count, + l.ledger_operation_count, + l.ledger_id, + l.total_coins, + l.fee_pool, + l.base_fee, + l.base_reserve, + l.max_tx_set_size, + l.protocol_version, + l.successful_transaction_count, + l.failed_transaction_count, + l.soroban_fee_write_1kb, + l.node_id, + l.signature, + l.total_byte_size_of_bucket_list, + t.non_refundable_resource_fee_charged, + t.refundable_resource_fee_charged, + t.rent_fee_charged, + t.tx_signers, + t.refundable_fee, + {{ dbt_utils.generate_surrogate_key(['op_id']) }} AS fact_operations_id, + SYSDATE() AS inserted_timestamp, + SYSDATE() AS modified_timestamp, + '{{ invocation_id }}' AS _invocation_id +FROM operations o +LEFT JOIN transactions t + on o.tx_id = t.tx_id +LEFT JOIN ledgers l + ON t.ledger_sequence = l.ledger_sequence \ No newline at end of file diff --git a/models/gold/operations/core__ez_operations.yml b/models/gold/operations/core__ez_operations.yml new file mode 100644 index 0000000..579d1f0 --- /dev/null +++ b/models/gold/operations/core__ez_operations.yml @@ -0,0 +1,115 @@ +version: 2 + +models: + - name: core__ez_operations + description: A comprehensive view combining operations with their associated transaction and ledger data. + config: + tags: ["core"] + + columns: + - name: fact_operations_id + description: '{{ doc("pk") }}' + tests: + - unique + - not_null + + - name: op_id + description: '{{ doc("op_id") }}' + tests: + - not_null + + - name: transaction_id + description: '{{ doc("transaction_id") }}' + + - name: type + description: '{{ doc("type") }}' + + - name: account + description: '{{ doc("account") }}' + + - name: amount + description: '{{ doc("amount") }}' + + - name: asset_code + description: '{{ doc("asset_code") }}' + + - name: asset_issuer + description: '{{ doc("asset_issuer") }}' + + - name: asset_type + description: '{{ doc("asset_type") }}' + + - name: transaction_hash + description: '{{ doc("transaction_hash") }}' + + - name: ledger_sequence + description: '{{ doc("ledger_sequence") }}' + + - name: closed_at + description: '{{ doc("closed_at") }}' + + - name: successful + description: '{{ doc("successful") }}' + + - name: operation_result_code + description: '{{ doc("operation_result_code") }}' + + - name: operation_trace_code + description: '{{ doc("operation_trace_code") }}' + + - name: details_json + description: '{{ doc("details_json") }}' + + - name: asset_balance_changes + description: '{{ doc("asset_balance_changes") }}' + + - name: parameters + description: '{{ doc("parameters") }}' + + - name: parameters_decoded + description: '{{ doc("parameters_decoded") }}' + + - name: function + description: '{{ doc("function") }}' + + - name: contract_id + description: '{{ doc("contract_id") }}' + + - name: contract_code_hash + description: '{{ doc("contract_code_hash") }}' + + - name: resource_fee + description: '{{ doc("resource_fee") }}' + + - name: soroban_resources_instructions + description: '{{ doc("soroban_resources_instructions") }}' + + - name: soroban_resources_read_bytes + description: '{{ doc("soroban_resources_read_bytes") }}' + + - name: soroban_resources_write_bytes + description: '{{ doc("soroban_resources_write_bytes") }}' + + - name: non_refundable_resource_fee_charged + description: '{{ doc("non_refundable_resource_fee_charged") }}' + + - name: refundable_resource_fee_charged + description: '{{ doc("refundable_resource_fee_charged") }}' + + - name: rent_fee_charged + description: '{{ doc("rent_fee_charged") }}' + + - name: tx_signers + description: '{{ doc("tx_signers") }}' + + - name: refundable_fee + description: '{{ doc("refundable_fee") }}' + + - name: inserted_timestamp + description: '{{ doc("inserted_timestamp") }}' + + - name: modified_timestamp + description: '{{ doc("modified_timestamp") }}' + + - name: _invocation_id + description: '{{ doc("invocation_id") }}' diff --git a/models/silver/silver__accounts.sql b/models/silver/silver__accounts.sql index 5a70873..8529843 100644 --- a/models/silver/silver__accounts.sql +++ b/models/silver/silver__accounts.sql @@ -73,10 +73,8 @@ WITH pre_final AS ( VALUE :closed_at :: INT, 6 ) AS closed_at, - TO_TIMESTAMP( - VALUE :ledger_sequence :: INT, - 6 - ) AS ledger_sequence, + VALUE :ledger_sequence :: INT, + ledger_sequence, _inserted_timestamp FROM @@ -85,11 +83,12 @@ WITH pre_final AS ( {% else %} {{ ref('bronze__accounts_FR') }} {% endif %} +WHERE + account_id IS NOT NULL {% if is_incremental() %} -WHERE - partition_gte_id >= '{{ max_part }}' - AND _inserted_timestamp > '{{ max_is }}' +AND partition_gte_id >= '{{ max_part }}' +AND _inserted_timestamp > '{{ max_is }}' {% endif %} qualify ROW_NUMBER() over (