0

Is there an way to query directly Cardano Db Syncs database to get withhold of the daily volume of an certain token ( For example via using multi_asset.fingerprint )

WITH ma_tx_ids AS (
    SELECT ma_tx_out.tx_out_id AS tx_id
    FROM multi_asset 
    INNER JOIN ma_tx_out ON multi_asset.id = ma_tx_out.ident
    WHERE multi_asset.fingerprint = 'asset1wwyy88f8u937hz7kunlkss7gu446p6ed5gdfp6')
SELECT *, encode(tx.hash::bytea, 'hex') AS encoded_hash FROM block
    INNER JOIN tx ON block.id = tx.block_id
    INNER JOIN tx_out ON tx.id = tx_out.tx_id
    INNER JOIN collateral_tx_out ON tx.id = collateral_tx_out.tx_id
        WHERE block.time > '2023-06-06 00:00:00' AND tx_out.id IN (
        (SELECT tx_id FROM ma_tx_ids));

With this query it should return all transaction what have been done today with AGIX token, the multi_asset_descr contains for an single result

fromList [(PolicyID {policyID = ScriptHash "32cc9c6c3456bc048d14a4a8e4ee3592e9664e8daac921a8ef52d92a"},fromList [(4752415353,40020000)]),(PolicyID {policyID = ScriptHash "4f1440d7813020d5f359eeeb355902edf1ab9598de9c7c783224795d"},fromList [(536e656b4149,235237509)]),(PolicyID {policyID = ScriptHash "5d16cc1a177b5d9ba9cfa9793b07e60f1fb70fea1f8aef064415d114"},fromList [(494147,4786312)]),(PolicyID {policyID = ScriptHash "75fcc276057db5fc48eae0e11453c773c8a54604c3086bf9d95ac1b7"},fromList [(43485259,3137346983)]),(PolicyID {policyID = ScriptHash "83117b5acb702fd086db386d26e83b7de3b19fbfe24c9e96f8f101a3"},fromList [(433343757469657330383137,1),(433343757469657330393030,1),(433343757469657331303832,1),(433343757469657332303930,1)]),(PolicyID {policyID = ScriptHash "8db269c3ec630e06ae29f74bc39edd1f87c819f1056206e879a1cd61"},fromList [(446a65644d6963726f555344,251584)]),(PolicyID {policyID = ScriptHash "9a9693a9a37912a5097918f97918d15240c92ab729a0b7c4aa144d77"},fromList [(53554e444145,78915974)]),(PolicyID {policyID = ScriptHash "a2936e00439913f1ac105c29883c013322360247c409343028b831be"},fromList [(4d564f5543484552,386180)]),(PolicyID {policyID = ScriptHash "b6a7467ea1deb012808ef4e87b5ff371e85f7142d7b356a40d9b42a0"},fromList [(436f726e75636f70696173205b76696120436861696e506f72742e696f5d,470750000)]),(PolicyID {policyID = ScriptHash "d15c36d6dec655677acb3318294f116ce01d8d9def3cc54cdd78909b"},fromList [(,87452787799)]),(PolicyID {policyID = ScriptHash "dda5fdb1002f7389b33e036b6afee82a8189becb6cba852e8b79b4fb"},fromList [(0014df1047454e53,850843)]),(PolicyID {policyID = ScriptHash "f0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a"},fromList [(7061792e746869732e77616c6c6574,1)]),(PolicyID {policyID = ScriptHash "f43a62fdc3965df486de8a0d32fe800963589c41b38946602a0dc535"},fromList [(41474958,36959748122)])]

From the response we could read out ,fromList [(41474958,36959748122)] Should all the values from the "fromlist containing AGIX (41474958) asset name" summed up?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.