<p>Ok I wasn't able to reconcile the above but I did find that DeFiLlama post the code they use to calculate TVL (see the Check the code button here: <a href="https://defillama.com/protocol/sundaeswap" rel="nofollow noreferrer">https://defillama.com/protocol/sundaeswap</a>)</p>
<p>So using this I was able to discern the addresses different DApps use and so tracking those intead.</p>

CC BY-SA 4.0
2022-04-24T11:08:19.190Z
2022-04-24T11:08:19.190Z
Reddspark
<p>I'm trying to do an exercise where I see if I can calculate Sundaeswap TVL using DB-Sync.
Below is what I have managed to pull out from the database so far regarding Sundaeswap.
However for the UTXOs in the tx_out table I would have expected the payment_cred (which is described in the docs as &quot; For a script-locked address, this is the script hash.&quot; to match the script hash. However it doesn't so I'm not sure how to determine the total number of UTXOs locked by Sundaeswap.</p>
<p><a href="https://cardanoscan.io/transaction/d74798c4a1e453fbc6ba4fbb1d785e0534fb8531fd1bc054ceff5b086240d3b5" rel="nofollow noreferrer">Link</a> to the transaction below in case you need it</p>
<p><a href="https://i.sstatic.net/NxXgZ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/NxXgZ.png" alt="enter image description here" /></a></p>

<cardano-db-sync>
How to calculate Sundaeswap TVL using DB-sync?
# How to calculate Sundaeswap TVL using DB-sync?

(Asked by: username_0 on 2022-04-21)

I'm trying to do an exercise where I see if I can calculate Sundaeswap TVL using DB-Sync.
Below is what I have managed to pull out from the database so far regarding Sundaeswap.
However for the UTXOs in the tx\_out table I would have expected the payment\_cred (which is described in the docs as " For a script-locked address, this is the script hash." to match the script hash. However it doesn't so I'm not sure how to determine the total number of UTXOs locked by Sundaeswap.

[Link](https://cardanoscan.io/transaction/d74798c4a1e453fbc6ba4fbb1d785e0534fb8531fd1bc054ceff5b086240d3b5) to the transaction below in case you need it

[![enter image description here](https://i.sstatic.net/NxXgZ.png)](https://i.sstatic.net/NxXgZ.png)

**Tags:** cardano-db-sync

---

## 1 answers

### Answer by username_0 on 2022-04-24. Score: 1 | Accepted answer

Ok I wasn't able to reconcile the above but I did find that DeFiLlama post the code they use to calculate TVL (see the Check the code button here: <https://defillama.com/protocol/sundaeswap>)

So using this I was able to discern the addresses different DApps use and so tracking those intead.


---

