Curve 3pool Proportion Monitoring
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: https://compassdao.com/scripts/0x7361a257b248491a
The script code is as following:
Here we use [Cache] to store last result, and define a delta variant to monitor the change of the ratio.
Once the Script is created, it can be saved and run, the result is as below:
Now you can schedule a task for the script:

Then set the alert to notify my Twitter bot:
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:
A similar case you can use to monitor the Curve stETH pool (just simply change the token addresses in script): https://compassdao.com/scripts/0x326fb04cd0b74269
Last updated
