From da964e88a813d08de228b90e968196db6cf11dea Mon Sep 17 00:00:00 2001 From: Filip Martinsson Date: Tue, 17 Oct 2023 10:28:39 +0200 Subject: [PATCH 1/3] new streams pricing changes --- .../evm/reference/08-compute-units-cu.mdx | 3 + .../02-streams-api/evm/getting-started/faq.md | 82 ++----------------- .../02-streams-api/evm/records-and-pricing.md | 10 +-- 3 files changed, 16 insertions(+), 79 deletions(-) diff --git a/docs/01-web3-data-api/evm/reference/08-compute-units-cu.mdx b/docs/01-web3-data-api/evm/reference/08-compute-units-cu.mdx index 68cf968d1..9b9fcfedf 100644 --- a/docs/01-web3-data-api/evm/reference/08-compute-units-cu.mdx +++ b/docs/01-web3-data-api/evm/reference/08-compute-units-cu.mdx @@ -120,3 +120,6 @@ Your output for the API request will be as follows: ``` where `price` refers to how much CU does the API request cost in terms of billing and `rateLimitCost` refers to how much CU does the API request cost in terms of rate limits. + +## Streams and Compute Units +For Moralis Streams, each record has a fixed cost of 15 Compute Units. You can read more about records and Streams pricing on the [Streams pricing page](/streams-api/evm/records-and-pricing). diff --git a/docs/02-streams-api/evm/getting-started/faq.md b/docs/02-streams-api/evm/getting-started/faq.md index bb786fc85..27686f9f2 100644 --- a/docs/02-streams-api/evm/getting-started/faq.md +++ b/docs/02-streams-api/evm/getting-started/faq.md @@ -10,7 +10,7 @@ Yes, our Streams API is in production now. ## How are Streams priced? -Please see [Records and pricing](/streams-api/evm/records-and-pricing) +Streams consume Compute Units similar to our other APIs. Please see [Records and pricing](/streams-api/evm/records-and-pricing) for more details. ## Can I disable the unconfirmed webhook requests? @@ -36,7 +36,9 @@ Enterprise plans can have fully customized limits with no hard caps - the Stream ## How many separate streams can I create? -You can create up to 20 streams on a Free account and up to 200 streams with an upgraded account, and multiple addresses can be added to a single stream config, "listen to all addresses" feature can also be used with a single stream config for Business and Enterprise plans. +On our paid plans you can have up to 200 active streams, and each stream can support listening to millions of addresses in a single configuration. + +The free plan is limited to 1 active stream. You can contact our support team at [hello@moralis.io](mailto:hello@moralis.io) if you need a higher limit, we can support an unlimited number of streams. @@ -100,6 +102,8 @@ If you still require support, please contact us in your Slack channel, or drop a A record is either a transaction (`txsin` response), log (`logs`in response) or internal transaction (`txsInternalin` response). The number of records in a webhook is the sum of `txs + logs + txsInternal`. +For each record your account will be charged 15 compute units. + In the header of a webhook, you can find the total number of records in that webhook in the header `x-records-charged`. In this example, the `x-records-charged` is `20` so the webhook contains 20 records. @@ -113,76 +117,6 @@ headers: { } ``` -Only confirmed blocks will be charged, unconfirmed blocks will have `'x-records-charged': ‘0’` - -**Records determine usage** - -Records handle the usage of Streams API. In your plan, you have an included amount of records for free. You can find your included limits under your [billing page](https://admin.moralis.io/account/billing). - -For each transaction, you get two webhooks (read more [here](/streams-api/evm)), records are only counted towards your usage for webhooks with Confirmed status True. - -**Check your total consumed record for a period** - -By using /status ([see API reference](/streams-api/evm/reference/get-stats)) you will get a summary of `totalLogsProcessed`, `totalTxsProcessed`, and `totalTxsInternalProcessed` for your current billing period. - -**Example:** - -```json -{ - "totalWebhooksDelivered": 1288, - "totalWebhooksFailed": 17, - "totalLogsProcessed": 4257, - "totalTxsProcessed": 0, - "totalTxsInternalProcessed": 0 -} -``` - -Where your total consumed records for the current billing period would be `"totalLogsProcessed": 4257`+`"totalTxsProcessed": 0`+`"totalTxsInternalProcessed": 0`. In this case total consumption is 4257. - -**Check one streams total consumed records for a period** - -By using /stats/{streamId} (see [API reference](/streams-api/evm/reference/get-stats-by-streamid)) you will get a summary of `totalLogsProcessed`,`totalTxsProcessed`, and `totalTxsInternalProcessed` for that specific stream. - -**Example:** - -```json -{ - "totalWebhooksDelivered": 0, - "totalWebhooksFailed": 0, - "totalLogsProcessed": 0, - "totalTxsProcessed": 0, - "totalTxsInternalProcessed": 0, - "createdAt": "2022-10-25T08:21:00.877Z", - "updatedAt": "2022-10-25T08:21:00.877Z" -} -``` - -Where your total consumed records for the current billing period would be `totalLogsProcessed`+`totalTxsProcessed`+`totalTxsInternalProcessed`. - -**Records per transaction type** - -It depends on the selected address activity how many records will be charged - -- Contract Interactions (logs) -- Native Transactions (txs) -- Internal Transactions (txsInternal) - -| Description | Number of records\* | -| :------------------------------------------------------------------------------------------ | :------------------ | -| Stream with txs, logs and a erc20 transfer event is emitted | 2 | -| Stream with txs, logs and 10 NFT Tokens (ERC721) were transferred in one transaction | 11 | -| Stream with txs, logs and 30 NFT Tokens (ERC1155 Batch) were transferred in one transaction | 2 | -| Stream with logs and a ERC721 NFT is minted with 100 Tokens | 100 | -| Stream with txs and a native transfer takes place | 1 | - -\*The number of records for logs depends on the contract emitting the events, more complex contracts could emit more records - -**Decoded logs** - -Moralis will decode and enrich standardized contracts (ERC20/ERC721/ERC1155), for each log that matches one of those contracts, a decoded log will be generated, currently, the decoded logs are: - -- erc20Transfers -- erc20Approvals -- nftTransfers +Only confirmed blocks will be charged, unconfirmed blocks will have `'x-records-charged': ‘0’`. -Decoded logs are **free** they do NOT count as `Records`. +You can read more about pricing on the [Records and pricing](/streams-api/evm/records-and-pricing) page. diff --git a/docs/02-streams-api/evm/records-and-pricing.md b/docs/02-streams-api/evm/records-and-pricing.md index 4d88a8394..294d14596 100644 --- a/docs/02-streams-api/evm/records-and-pricing.md +++ b/docs/02-streams-api/evm/records-and-pricing.md @@ -33,15 +33,15 @@ headers: { Only confirmed blocks will be charged, unconfirmed blocks will have `'x-records-charged': ‘0’ ` -### Records determine usage +### Records pricing -Records handle the usage of Streams API. In your plan, you have an included amount of records for free. You can find your included limits under your [billing page](https://admin.moralis.io/account/billing). +For each record you consume, your account will be charged 15 compute units. Each Moralis plan has a certain number of included compute units. -For each transaction, you get two webhooks (read more [here](/streams-api/evm/webhooks-transactions)), records are only counted towards your usage for webhooks with Confirmed status True. +For each transaction, you will get two webhooks (read more [here](/streams-api/evm/webhooks-transactions)), one once the transaction is added to a block and one once the transaction is confirmed. Records are only counted towards your usage for webhooks with Confirmed status True. ### Check your total consumed record for a period -By using /status (see API [reference](/streams-api/evm/reference/get-stats)) you will get a summary of `totalLogsProcessed`, `totalTxsProcessed`, and `totalTxsInternalProcessed` for your current billing period. +By using /status (see API [reference](/streams-api/evm/reference/get-stats)) you will get a summary of `totalLogsProcessed`, `totalTxsProcessed`, and `totalTxsInternalProcessed` for your current billing period. Add those together and you will see your total record consumtion. **Example:** @@ -57,7 +57,7 @@ By using /status (see API [reference](/streams-api/evm/reference/get-stats)) you Where your total consumed records for the current billing period would be `"totalLogsProcessed": 4257` + `"totalTxsProcessed": 0` + `"totalTxsInternalProcessed": 0`. In this case total consumption is 4257. -### Check one streams total consumed records for a period +### Check total records consumed for a specific stream By using /stats/{streamId} (see API [reference](/streams-api/evm/reference/get-stats-by-streamid)) you will get a summary of `totalLogsProcessed`, `totalTxsProcessed`, and `totalTxsInternalProcessed` for that specific stream. From e3c341a773e3be8208b2fc68689a55f3b496451d Mon Sep 17 00:00:00 2001 From: Nazeim Date: Tue, 17 Oct 2023 23:08:57 +0300 Subject: [PATCH 2/3] general content update --- .../evm/reference/08-compute-units-cu.mdx | 7 +- .../02-streams-api/evm/getting-started/faq.md | 39 +++--- .../02-streams-api/evm/records-and-pricing.md | 114 +++++++++--------- 3 files changed, 82 insertions(+), 78 deletions(-) diff --git a/docs/01-web3-data-api/evm/reference/08-compute-units-cu.mdx b/docs/01-web3-data-api/evm/reference/08-compute-units-cu.mdx index 9b9fcfedf..070dfd90d 100644 --- a/docs/01-web3-data-api/evm/reference/08-compute-units-cu.mdx +++ b/docs/01-web3-data-api/evm/reference/08-compute-units-cu.mdx @@ -122,4 +122,9 @@ Your output for the API request will be as follows: where `price` refers to how much CU does the API request cost in terms of billing and `rateLimitCost` refers to how much CU does the API request cost in terms of rate limits. ## Streams and Compute Units -For Moralis Streams, each record has a fixed cost of 15 Compute Units. You can read more about records and Streams pricing on the [Streams pricing page](/streams-api/evm/records-and-pricing). + +For [Moralis Streams](/streams-api/evm#what-is-the-streams-api), it is important to note that each [record](/streams-api/evm/records-and-pricing#what-is-the-record) has a fixed cost of 15 Compute Units. + +:::tip +You can read the article [Records and Pricing](/streams-api/evm/records-and-pricing) to understand how records play a crucial role in the Streams API, allowing you to make the right decisions regarding usage and pricing. +::: diff --git a/docs/02-streams-api/evm/getting-started/faq.md b/docs/02-streams-api/evm/getting-started/faq.md index 27686f9f2..26ead33e0 100644 --- a/docs/02-streams-api/evm/getting-started/faq.md +++ b/docs/02-streams-api/evm/getting-started/faq.md @@ -1,16 +1,18 @@ --- title: "🙋 FAQ" sidebar_position: 20 -description: "This FAQ page provides answers to common questions about our product. Learn more about features, compatibility, installation, and more." +description: "This FAQ page helps you to get answers about our Web3 API, Streams, and product features, enhancing your API integration experience." --- +This article is a Frequently Asked Questions (FAQ) page providing answers to common questions about the Moralis Streams API and its pricing, covering topics such as production status, pricing, configurations, and usage details. + ## Is Streams API in production? Yes, our Streams API is in production now. ## How are Streams priced? -Streams consume Compute Units similar to our other APIs. Please see [Records and pricing](/streams-api/evm/records-and-pricing) for more details. +Streams consume [Compute Units](/web3-data-api/evm/reference/compute-units-cu) similar to our other APIs. You can read the article [Records and Pricing](/streams-api/evm/records-and-pricing) to understand how records play a crucial role in the Streams API, allowing you to make the right decisions regarding usage and pricing. ## Can I disable the unconfirmed webhook requests? @@ -36,11 +38,11 @@ Enterprise plans can have fully customized limits with no hard caps - the Stream ## How many separate streams can I create? -On our paid plans you can have up to 200 active streams, and each stream can support listening to millions of addresses in a single configuration. +On Moralis' paid plans, you can have up to 200 active streams, and each stream can support listening to millions of addresses in a single configuration. The free plan is limited to 1 active stream. -You can contact our support team at [hello@moralis.io](mailto:hello@moralis.io) if you need a higher limit, we can support an unlimited number of streams. +If you require more streams than your current plan allows, reach out to our support team at [hello@moralis.io](mailto:hello@moralis.io), as we can support an unlimited number of streams to suit your needs. ## Are there any events lost when a stream or the filters for a stream get updated? @@ -91,32 +93,27 @@ If you still require support, please contact us in your Slack channel, or drop a ## What is a record? -**Summary** - -- A record is either a transaction (`txs`), log (`logs`) or internal transactions (`txsInternal`) in the webhook response. -- Records is the base for usage of Streams -- Records are only counted towards your usage for webhooks with `confirmed:true` so webhooks `withconfirmed:false` are **free** -- Decoded logs are also free they do NOT count as `Records`. +Records are the basic unit for calculating your Streams usage, with charges applied only to webhooks with the field `confirmed:true`. Webhooks set to `withconfirmed:false` and decoded logs are both free of charge. -## What is a record? +In Moralis Streams, a **record** refers to either a transaction (`txs` in response), a log (`logs` in response), or an internal transaction (`txsInternal` in response). The total number of records within a webhook is calculated as the sum of `txs + logs + txsInternal`. -A record is either a transaction (`txsin` response), log (`logs`in response) or internal transaction (`txsInternalin` response). The number of records in a webhook is the sum of `txs + logs + txsInternal`. +For every record within a webhook, your account will be charged 15 [Compute Units](/web3-data-api/evm/reference/compute-units-cu). To identify the total number of records in a webhook, check the `x-records-charged` field within the webhook's header. -For each record your account will be charged 15 compute units. +:::tip +Please note that only confirmed blocks will require charges, with unconfirmed blocks having `'x-records-charged': '0'`. +::: -In the header of a webhook, you can find the total number of records in that webhook in the header `x-records-charged`. - -In this example, the `x-records-charged` is `20` so the webhook contains 20 records. +In the following code example, `x-records-charged` is set to `20`, indicating the presence of 20 records: ```json headers: { 'x-region': 'us-west-2', 'x-queue-size': '0', - 'x-records-charged': ‘20’ + 'x-records-charged': '20', 'x-signature': '0xdf49163b5273b50a8da48e82b7254b45d81aeee9a02f1909a45d7aaea240e9c2', - } +} ``` -Only confirmed blocks will be charged, unconfirmed blocks will have `'x-records-charged': ‘0’`. - -You can read more about pricing on the [Records and pricing](/streams-api/evm/records-and-pricing) page. +:::tip +You can read the article [Records and Pricing](/streams-api/evm/records-and-pricing) to understand how records play a crucial role in the Streams API, allowing you to make the right decisions regarding usage and pricing. +::: diff --git a/docs/02-streams-api/evm/records-and-pricing.md b/docs/02-streams-api/evm/records-and-pricing.md index 294d14596..4f77aa6ac 100644 --- a/docs/02-streams-api/evm/records-and-pricing.md +++ b/docs/02-streams-api/evm/records-and-pricing.md @@ -1,49 +1,59 @@ --- -title: "Records and pricing" +title: "Records and Pricing" slug: "records-and-pricing" sidebar_position: 4 -description: "Discover how Records are used in Streams API to determine usage and pricing. Records are either a transaction (txs), log (logs) or internal transactions (txsInternal) in the webhook response." +description: "How Records are used in Streams API to determine usage and pricing. Records are either a transaction, log, or internal transactions in the webhook response." --- -Discover how Records are used in Streams API to determine usage and pricing. Records are either a transaction (txs), log (logs) or internal transactions (txsInternal) in the webhook response. +This article explains the Record, its pricing, how to check the total records for a specific period, how each record cost depends on the transaction type, and finally the current decoded logs. -## Summary +## What is the Record? -- A record is either a transaction (`txs`), log (`logs`) or internal transactions (`txsInternal`) in the webhook response. -- Records is the base for usage of Streams -- Records are only counted towards your usage for webhooks with `confirmed:true` so webhooks with `confirmed:false` are **free** -- Decoded logs are also **free** they do NOT count as `Records`. +Records are the basic unit for calculating your Streams usage, with charges applied only to webhooks with the field `confirmed:true`. Webhooks set to `withconfirmed:false` and decoded logs are both free of charge. -## What is the record? +In Moralis Streams, a **record** refers to either a transaction (`txs` in response), a log (`logs` in response), or an internal transaction (`txsInternal` in response). The total number of records within a webhook is calculated as the sum of `txs + logs + txsInternal`. -A record is either a transaction (`txs` in response), log (`logs` in response) or internal transaction (`txsInternal` in response). The number of records in a webhook is the sum of `txs + logs + txsInternal`. +For every record within a webhook, your account will be charged 15 [Compute Units](/web3-data-api/evm/reference/compute-units-cu). To identify the total number of records in a webhook, check the `x-records-charged` field within the webhook's header. -In the header of a webhook, you can find the total number of records in that webhook in the header `x-records-charged`. +:::tip +Please note that only confirmed blocks will require charges, with unconfirmed blocks having `'x-records-charged': '0'`. +::: -In this example, the `x-records-charged` is `20` so the webhook contains 20 records. +In the following code example, `x-records-charged` is set to `20`, indicating the presence of 20 records: ```json headers: { 'x-region': 'us-west-2', 'x-queue-size': '0', - 'x-records-charged': ‘20’ + 'x-records-charged': '20', 'x-signature': '0xdf49163b5273b50a8da48e82b7254b45d81aeee9a02f1909a45d7aaea240e9c2', - } +} ``` -Only confirmed blocks will be charged, unconfirmed blocks will have `'x-records-charged': ‘0’ ` +## Records Pricing + +For each record you consume, your account will be charged 15 compute units. + +:::note +Note that each Moralis plan has a certain number of included compute units. +::: + +For each transaction, you will get two webhooks: -### Records pricing +* One once the transaction is added to a block +* One once the transaction is confirmed -For each record you consume, your account will be charged 15 compute units. Each Moralis plan has a certain number of included compute units. +Records are only counted towards your usage for webhooks with the field `confirmed:true`. Webhooks set to `withconfirmed:false` and decoded logs are both free of charge. -For each transaction, you will get two webhooks (read more [here](/streams-api/evm/webhooks-transactions)), one once the transaction is added to a block and one once the transaction is confirmed. Records are only counted towards your usage for webhooks with Confirmed status True. +:::tip +You can read the article [Webhooks Transactions](/streams-api/evm/webhooks-transactions) to understand more. +::: -### Check your total consumed record for a period +### Checking Total Records Consumed for a Specific Period -By using /status (see API [reference](/streams-api/evm/reference/get-stats)) you will get a summary of `totalLogsProcessed`, `totalTxsProcessed`, and `totalTxsInternalProcessed` for your current billing period. Add those together and you will see your total record consumtion. +You can monitor your total record consumption for a specific billing period by utilizing the `/status` endpoint. You can use it to receive a summary of `totalLogsProcessed`, `totalTxsProcessed`, and `totalTxsInternalProcessed`. -**Example:** +The following code example is a response of using the [getStats](/streams-api/evm/reference/get-stats) endpoint: ```json { @@ -55,52 +65,44 @@ By using /status (see API [reference](/streams-api/evm/reference/get-stats)) you } ``` -Where your total consumed records for the current billing period would be `"totalLogsProcessed": 4257` + `"totalTxsProcessed": 0` + `"totalTxsInternalProcessed": 0`. In this case total consumption is 4257. +To calculate the total records consumed for the current billing period, add together the values of `totalLogsProcessed`, `totalTxsProcessed`, and `totalTxsInternalProcessed`. -### Check total records consumed for a specific stream +:::note +Make sure to refer to the [getStats API reference](/streams-api/evm/reference/get-stats) for additional details on using the `/status` endpoint. +::: -By using /stats/{streamId} (see API [reference](/streams-api/evm/reference/get-stats-by-streamid)) you will get a summary of `totalLogsProcessed`, `totalTxsProcessed`, and `totalTxsInternalProcessed` for that specific stream. +### Records Per Transaction Type -**Example:** +The number of records charged depends on the type of transaction activity associated with the selected address. Records are categorized into three transaction types: -```json -{ - "totalWebhooksDelivered": 0, - "totalWebhooksFailed": 0, - "totalLogsProcessed": 0, - "totalTxsProcessed": 0, - "totalTxsInternalProcessed": 0, - "createdAt": "2022-10-25T08:21:00.877Z", - "updatedAt": "2022-10-25T08:21:00.877Z" -} -``` - -Where your total consumed records for the current billing period would be `totalLogsProcessed` + `totalTxsProcessed` + `totalTxsInternalProcessed`. +- **Contract Interactions (logs)** +- **Native Transactions (txs)** +- **Internal Transactions (txsInternal)** -### Records per transaction type +:::tip +The number of records for logs can vary based on the complexity of the contract emitting the events, with more complex contracts potentially generating additional records. +::: -It depends on the selected address activity how many records will be charged +Below is a breakdown of the number of records typically charged for various transaction scenarios: -- Contract Interactions (logs) -- Native Transactions (txs) -- Internal Transactions (txsInternal) - -| Description | Number of records\* | +| Description | Number of Records\* | | :------------------------------------------------------------------------------------------ | :------------------ | -| Stream with txs, logs and a erc20 transfer event is emitted | 2 | -| Stream with txs, logs and 10 NFT Tokens (ERC721) were transferred in one transaction | 11 | -| Stream with txs, logs and 30 NFT Tokens (ERC1155 Batch) were transferred in one transaction | 2 | -| Stream with logs and a ERC721 NFT is minted with 100 Tokens | 100 | -| Stream with txs and a native transfer takes place | 1 | - -\*The number of records for logs depends on the contract emitting the events, more complex contracts could emit more records +| Stream with txs, logs, and an ERC20 transfer event | 2 | +| Stream with txs, logs, and the transfer of 10 NFT Tokens (ERC721) in one transaction | 11 | +| Stream with txs, logs, and the transfer of 30 NFT Tokens (ERC1155 Batch) in one transaction | 2 | +| Stream with logs and the minting of an ERC721 NFT with 100 Tokens | 100 | +| Stream with txs and a native transfer | 1 | ### Decoded logs -Moralis will decode and enrich standardized contracts (ERC20/ERC721/ERC1155), for each log that matches one of those contracts, a decoded log will be generated, currently, the decoded logs are: +Moralis decodes and enhances standardized contracts such as ERC20, ERC721, and ERC1155. Whenever a log matches one of these contracts, Moralis generates a decoded log. + +The current Decoded Logs are: -- erc20Transfers -- erc20Approvals -- nftTransfers +* erc20Transfers +* erc20Approvals +* nftTransfers +::note Decoded logs are **free** they do NOT count as `Records`. +::: From ac1850e0e78c56ca2de86ae88496baa687b0f480 Mon Sep 17 00:00:00 2001 From: Nazeim Date: Wed, 18 Oct 2023 16:05:59 +0300 Subject: [PATCH 3/3] small fix --- docs/02-streams-api/evm/records-and-pricing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/02-streams-api/evm/records-and-pricing.md b/docs/02-streams-api/evm/records-and-pricing.md index 4f77aa6ac..d67f65464 100644 --- a/docs/02-streams-api/evm/records-and-pricing.md +++ b/docs/02-streams-api/evm/records-and-pricing.md @@ -93,7 +93,7 @@ Below is a breakdown of the number of records typically charged for various tran | Stream with logs and the minting of an ERC721 NFT with 100 Tokens | 100 | | Stream with txs and a native transfer | 1 | -### Decoded logs +### Decoded Logs Moralis decodes and enhances standardized contracts such as ERC20, ERC721, and ERC1155. Whenever a log matches one of these contracts, Moralis generates a decoded log.