WHEREevent_type='transfer'ANDmsg_type='wasm/MsgExecuteContract'ANDterraswap_pool='terra1jxazgm67et0ce260kvrpfv50acuushpjsz2y0p'--Here we specify the bLUNA-LUNA terraswap pool, and the particular event (transfer) that we want to extract the data from; Other conditions are also meant to cut down on the potential results
),
tradedas-- we extract the tokens sent to the terraswap pool from the msgs table
WHEREmsg_type='wasm/MsgExecuteContract'ANDterraswap_pool='terra1jxazgm67et0ce260kvrpfv50acuushpjsz2y0p'ANDaddress_token_sent='terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp'-- We define the terraswap pool in scope as the bLUNA-LUNA pool, and the asset swapped as bLUNA
),
stagingas-- we combine the tables in this table so that the last table can be a clean select statement where the user can focus on filters for