[
"autonomous agent",
{
"bounce_fees": {
"base": 10000
},
"init": "{
$OWNER_ADDRESS = "
HMFR76BEZXV5T7X4QVWXFKADT73DKS2G";
$OSWAP_POOL_ADDRESS = "
YJ3FVKBJRMZWGJNHYW5E2RRDAFWB6ZC2";
$OSWAP_CURVE_ADDRESS = "
OSWAPWKOXZKJPYWATNK47LRDV4UN4K7H";
$OSWAP_ASSET = "KxyAj3Yk9OFy+cweRFl8yjwYEmeg6scHoRXJsExun98=";
}",
"messages": {
"cases": [
{
"if": "{trigger.address == $OWNER_ADDRESS}",
"messages": [
{
"app": "data",
"payload": {
"delta_xn": 989999941
}
},
{
"app": "payment",
"payload": {
"outputs": [
{
"address": "{$OSWAP_POOL_ADDRESS}",
"amount": "{trigger.output[[asset=base]] - 1000}"
}
]
}
},
{
"app": "state",
"state": "{
var["start_balance"] = trigger.output[[asset=base]];
}"
}
]
},
{
"if": "{trigger.address == $OSWAP_POOL_ADDRESS}",
"messages": [
{
"app": "payment",
"payload": {
"asset": "{$OSWAP_ASSET}",
"outputs": [
{
"address": "{$OSWAP_CURVE_ADDRESS}"
}
]
}
}
]
},
{
"if": "{trigger.address == $OSWAP_POOL_ADDRESS}",
"init": "{
require(trigger.output[[asset=base]] > var["start_balance"], "Not profitable");
}",
"messages": [
{
"app": "payment",
"payload": {
"outputs": [
{
"address": "{$OWNER_ADDRESS}"
}
]
}
},
{
"app": "state",
"state": "{
var["start_balance"] = 0;
}"
}
]
}
]
}
}
]