Curve 3pool Proportion Monitoring
Last updated
Last updated
The previous sample showed the most simplified example of the Script feature. It can be also utilized in more complicated scenarios. For example, monitoring the proportion of tokens in a liquidity pool.
Here we take Curve 3pool as an example to monitor the proportion of USDT:
Check the script here:
The script code is as following:
Once the Script is created, it can be saved and run, the result is as below:
So the alert will notify me when the change is above 2%, and some variants from the result are filled in the notify message. The condition will be checked every 1 minute.
⚠️ Warning: $USDT ratio of @CurveFinance 3pool is now {usdtRatio}%, $USDC balance is {USDCAmount}, $DAI balance is {DAIAmount}, for more info, see: https://compassdao.com/scripts/0x7361a257b248491a. Powered by @compassDAO
Now you get your perfect Twitter bot:
Here we use [] to store last result, and define a delta variant to monitor the change of the ratio.
Now you can for the script:
Then to notify my Twitter bot:
A similar case you can use to monitor the Curve stETH pool (just simply change the token addresses in script):