Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Updated the rent fees documentation for clarity. (#596)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmkozh authored Oct 18, 2023
1 parent 3c09c7c commit b64819b
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions docs/fundamentals-and-concepts/fees-and-metering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b64819b

Please sign in to comment.