user6918: Take JPG store as an example.
When someone lists an NFT for sale there, or when someone buys an NFT there, a smart contract governs that transaction.
Can sql queries against the db-sync generated blockchain data "see" that?
I'd like to write sql queries against the db-sync data that show the most recent transaction involving a particular smart contract, but I'm not sure what to query for...
UPDATE:
Here is a call to opencnft's free api which allows me to know the most recent transactions involving a particular NFT policy, sorted by date.
If I want to simple replicate that by using sql queries against db-sync, that's also something I am interested in:
https://api.opencnft.io/1/#/Policy/PublicController_getPolicyTx
However...that makes the NFT policy the focus of the query, whereas I am also looking for a query that would find the same resulting transaction had occurred but with the Smart Contract being used as the criteria I am querying on.
So in plain language - there are two generalized queries I am hoping to create as a basis and launching pad for other queries?

select the latest transaction 'Smart Contract X' was involved in, and the  assets involved in that transaction.

select the latest transaction 'Policy Id X' was involved in and any Smart Contracts and/or other assets involved in the transaction.


...sort of like looking for the same thing but from two different perspectives in terms of the criteria and tables involved in building the query?

user1897: Would something like the Blockfrost API for watching transactions happening against an address work for you? Something like this maybe? You could also query for assets held by an address
Ultimately, you can query specific details using multiple queries and filters on the JSON data returned and probably achieve what you want.

user7590: Maybe oura is something for you to be worth looking into. https://github.com/txpipe/oura
In a nutshell: Oura allows you to watch for patterns in the blockchain as it progresses and then if you have found a match trigger your own events. So in your case you could have different filters that would trigger the same web enpoint but offer different payloads.

6918: <p>Take JPG store as an example.
When someone lists an NFT for sale there, or when someone buys an NFT there, a smart contract governs that transaction.</p>
<p>Can sql queries against the db-sync generated blockchain data &quot;see&quot; that?
I'd like to write sql queries against the db-sync data that show the most recent transaction involving a particular smart contract, but I'm not sure what to query for...</p>
<h2>UPDATE:</h2>
<p>Here is a call to opencnft's free api which allows me to know the most recent transactions involving a particular NFT policy, sorted by date.
If I want to simple replicate that by using sql queries against db-sync, that's also something I am interested in:</p>
<p><a href="https://api.opencnft.io/1/#/Policy/PublicController_getPolicyTx" rel="nofollow noreferrer">https://api.opencnft.io/1/#/Policy/PublicController_getPolicyTx</a></p>
<p>However...that makes the NFT policy the focus of the query, whereas I am also looking for a query that would find the same resulting transaction had occurred but with the Smart Contract being used as the criteria I am querying on.</p>
<p>So in plain language - there are two generalized queries I am hoping to create as a basis and launching pad for other queries?</p>
<ol>
<li><p>select the latest transaction 'Smart Contract X' was involved in, and the  assets involved in that transaction.</p>
</li>
<li><p>select the latest transaction 'Policy Id X' was involved in and any Smart Contracts and/or other assets involved in the transaction.</p>
</li>
</ol>
<p>...sort of like looking for the same thing but from two different perspectives in terms of the criteria and tables involved in building the query?</p>
 1897: <p>Would something like the Blockfrost API for watching transactions happening against an address work for you? Something like <a href="https://docs.blockfrost.io/#tag/Cardano-Addresses/paths/%7E1addresses%7E1%7Baddress%7D%7E1transactions/get" rel="nofollow noreferrer">this</a> maybe? You could also query for <a href="https://docs.blockfrost.io/#tag/Cardano-Accounts/paths/%7E1accounts%7E1%7Bstake_address%7D%7E1addresses%7E1assets/get" rel="nofollow noreferrer">assets held by an address</a></p>
<p>Ultimately, you can query specific details using multiple queries and filters on the JSON data returned and probably achieve what you want.</p>
 7590: <p>Maybe oura is something for you to be worth looking into. <a href="https://github.com/txpipe/oura" rel="nofollow noreferrer">https://github.com/txpipe/oura</a></p>
<p>In a nutshell: Oura allows you to watch for patterns in the blockchain as it progresses and then if you have found a match trigger your own events. So in your case you could have different filters that would trigger the same web enpoint but offer different payloads.</p>
