tzkt.io offers a websocket based listener that can be used for the scenario mentioned by you.
Alternatively, you can run a cron job that checks for changes in the contract storage (tzkt's API can be used once again) and records the same in the DB.
You want to do something like:
import smartpy as sp
def __init__(self, **kargs):
c = sp.contract(sp.TUnit, sp.address("tz1dQXqXZ3Y5sgYwU9Aq9xRJPxEZNUwyE6ht"))
sp.transfer(sp.unit, sp.tez(10), c.open_some())
@sp.add_test(name = "...
The lambda view feature allows retrieving data via a contract's view method. Here is a link to the documentation: https://tezostaquito.io/docs/lambda_view
Here is an example with a similar contract on granadanet:
const contract = await Tezos.contract.at('KT1AQuWowr3WKwF69oTGcKaJrMajic3CKwR2');
const response = await contract.views.get('ETH-USD').read();
Does this mean that at the end of this 6 month period I would own 0.0596447509723% of that 1296000 xtz, or 772.99597260151 xtz?
Only if your share of the liquidity pools does not change in the meantime. If, for example, more liquidity providers join the pool your share will decrease so you will receive less than this.
You also risk impermanent loss.