From b64819ba94fcd00e32a8972443b42adfdc2ead4b Mon Sep 17 00:00:00 2001 From: Dmytro Kozhevin Date: Wed, 18 Oct 2023 11:09:26 -0400 Subject: [PATCH] Updated the rent fees documentation for clarity. (#596) --- .../fees-and-metering.mdx | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/docs/fundamentals-and-concepts/fees-and-metering.mdx b/docs/fundamentals-and-concepts/fees-and-metering.mdx index 75f56914..cc56cf3f 100644 --- a/docs/fundamentals-and-concepts/fees-and-metering.mdx +++ b/docs/fundamentals-and-concepts/fees-and-metering.mdx @@ -62,24 +62,26 @@ The best way to find the required fees for any Soroban transaction is to use the The fee rates are currently defined for the Testnet as follows: -| Description | Cost (stroops) | -| --------------------------------- | -------------------- | -| 10000 CPU instructions | 100 | -| Read 1 ledger entry | 1000 | -| Write 1 ledger entry | 3000 | -| Read 1KB from ledger | 1000 | -| 1KB of transaction (bandwidth) | 500 | -| 1KB of transaction (history) | 5000 | -| 1KB of Events/return value | 300 | -| Write 1KB to empty ledger | 1000 | -| Write 1KB to 2GB ledger | 4_000_000 | -| Write 1KB to 4GB ledger | 4_000_000_000 | -| Temp entry rent coefficient | 10 months in ledgers | -| Persistent entry rent coefficient | 1 month in ledgers | +| Description | Cost (stroops) | +| ----------------------------------------------------- | -------------- | +| 10000 CPU instructions | 100 | +| Read 1 ledger entry | 1000 | +| Write 1 ledger entry | 3000 | +| Read 1KB from ledger | 1000 | +| 1KB of transaction (bandwidth) | 500 | +| 1KB of transaction (history) | 5000 | +| 1KB of Events/return value | 300 | +| Write 1KB to empty ledger | 1000 | +| Write 1KB to 2GB ledger | 4_000_000 | +| Write 1KB to 4GB ledger | 4_000_000_000 | +| Store 1KB temp entry for 1 month (empty ledger) | 100 | +| Store 1KB temp entry for 1 month (2GB ledger) | 400_000 | +| Store 1KB persistent entry for 1 month (empty ledger) | 1000 | +| Store 1KB persistent entry for 1 month (2GB ledger) | 4_000_000 | Note, that write fees grow linearly from empty ledger to 2 GB (ledger "target size"), and then grow linearly, but with a 1000x factor after exceeding the target. This is to bound the ledger size growth. As Testnet is a small, test network, the target size is set to just 2 GB. -One ledger worth of rent costs `write_fee / rent_coefficient`, where `write_fee` is the cost of writing the ledger entry and `rent_coefficient` is a number of ledgers for which the whole write fee will be paid. Given the numbers above, this means that 1 month of renting the ledger space for the temporary entry costs `write_fee / 10` and it costs `write_fee` for a persistent entry (10x more). +The ledger rent cost ('Store 1KB' entries in the table) is based on the write fee, rent period and some coefficient. For the temporary storage, the coefficient is 10 months (in ledgers), thus 1 month of temporary entry rent is 1/10 of the rent fee. For persistent storage the coefficient is 1 month (in ledgers) and thus 1 month of rent is equivalent to the write fee. ### Refundable resources