user1369: 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 to the transaction below in case you need it


user1369: 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.

1369: <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.stack.imgur.com/NxXgZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NxXgZ.png" alt="enter image description here" /></a></p>
 1369: <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>
