Search…
FIAT Currencies
Express your threshold value in FIAT currencies
Basic triggers (WaE and WaC) allows users to specify if the amount you want to use as threshold for the event is a currency, and handles the conversion for you: from the token used in the Contract or Transaction to one of the available FIAT currencies (currently we support EUR & USD).
To define the currency used in the contract, from which to convert use the address of a specific token on the network (for WaE triggers you can also use the name of a parameter of the contract that specify the token).

Examples

Create a new WaE trigger with a threshold expressed in a FIAT currency

Query
Result
1
mutation {
2
createEventsTrigger(input: {
3
name: "Create WaE currency",
4
type: EventsTrigger,
5
statement: {
6
contract: {
7
address: "0x1f573d6fb3f13d689ff844b4ce37794d79a7ff1c",
8
abi: [ { anonymous: false, inputs: [ { indexed: true, internalType: "address", name: "_provider", type: "address" }, { indexed: false, internalType: "uint256", name: "_amount", type: "uint256" }, { indexed: false, internalType: "uint256", name: "_expirationTime", type: "uint256" } ], name: "BalanceLocked", type: "event" }, { anonymous: false, inputs: [ { indexed: true, internalType: "address", name: "_provider", type: "address" }, { indexed: false, internalType: "uint256", name: "_amount", type: "uint256" } ], name: "BalanceUnlocked", type: "event" }, { anonymous: false, inputs: [ { indexed: true, internalType: "address", name: "_prevOwner", type: "address" }, { indexed: true, internalType: "address", name: "_newOwner", type: "address" } ], name: "OwnerUpdate", type: "event" }, { anonymous: false, inputs: [ { indexed: true, internalType: "contract IConverterAnchor", name: "_poolAnchor", type: "address" }, { indexed: false, internalType: "bool", name: "_added", type: "bool" } ], name: "PoolWhitelistUpdated", type: "event" }, { anonymous: false, inputs: [ { indexed: true, internalType: "address", name: "_provider", type: "address" }, { indexed: true, internalType: "contract IDSToken", name: "_poolToken", type: "address" }, { indexed: true, internalType: "contract IERC20Token", name: "_reserveToken", type: "address" }, { indexed: false, internalType: "uint256", name: "_poolAmount", type: "uint256" }, { indexed: false, internalType: "uint256", name: "_reserveAmount", type: "uint256" } ], name: "ProtectionAdded", type: "event" }, { anonymous: false, inputs: [ { indexed: true, internalType: "address", name: "_provider", type: "address" }, { indexed: true, internalType: "contract IDSToken", name: "_poolToken", type: "address" }, { indexed: true, internalType: "contract IERC20Token", name: "_reserveToken", type: "address" }, { indexed: false, internalType: "uint256", name: "_poolAmount", type: "uint256" }, { indexed: false, internalType: "uint256", name: "_reserveAmount", type: "uint256" } ], name: "ProtectionRemoved", type: "event" }, { anonymous: false, inputs: [ { indexed: true, internalType: "address", name: "_provider", type: "address" }, { indexed: false, internalType: "uint256", name: "_prevPoolAmount", type: "uint256" }, { indexed: false, internalType: "uint256", name: "_prevReserveAmount", type: "uint256" }, { indexed: false, internalType: "uint256", name: "_newPoolAmount", type: "uint256" }, { indexed: false, internalType: "uint256", name: "_newReserveAmount", type: "uint256" } ], name: "ProtectionUpdated", type: "event" }, { anonymous: false, inputs: [ { indexed: false, internalType: "contract IERC20Token", name: "_token", type: "address" }, { indexed: false, internalType: "uint256", name: "_prevAmount", type: "uint256" }, { indexed: false, internalType: "uint256", name: "_newAmount", type: "uint256" } ], name: "SystemBalanceUpdated", type: "event" }, { inputs: [], name: "acceptOwnership", outputs: [], stateMutability: "nonpayable", type: "function" }, { inputs: [ { internalType: "address", name: "_provider", type: "address" }, { internalType: "uint256", name: "_amount", type: "uint256" }, { internalType: "uint256", name: "_expirationTime", type: "uint256" } ], name: "addLockedBalance", outputs: [ { internalType: "uint256", name: "", type: "uint256" } ], stateMutability: "nonpayable", type: "function" }, { inputs: [ { internalType: "contract IConverterAnchor", name: "_poolAnchor", type: "address" } ], name: "addPoolToWhitelist", outputs: [], stateMutability: "nonpayable", type: "function" }, { inputs: [ { internalType: "address", name: "_provider", type: "address" }, { internalType: "contract IDSToken", name: "_poolToken", type: "address" }, { internalType: "contract IERC20Token", name: "_reserveToken", type: "address" }, { internalType: "uint256", name: "_poolAmount", type: "uint256" }, { internalType: "uint256", name: "_reserveAmount", type: "uint256" }, { internalType: "uint256", name: "_reserveRateN", type: "uint256" }, { internalType: "uint256", name: "_reserveRateD", type: "uint256" }, { internalType: "uint256", name: "_timestamp", type: "uint256" } ], name: "addProtectedLiquidity", outputs: [ { internalType: "uint256", name: "", type: "uint256" } ], stateMutability: "nonpayable", type: "function" }, { inputs: [ { internalType: "contract IERC20Token", name: "_token", type: "address" }, { internalType: "uint256", name: "_amount", type: "uint256" } ], name: "decSystemBalance", outputs: [], stateMutability: "nonpayable", type: "function" }, { inputs: [ { internalType: "contract IERC20Token", name: "_token", type: "address" }, { internalType: "uint256", name: "_amount", type: "uint256" } ], name: "incSystemBalance", outputs: [], stateMutability: "nonpayable", type: "function" }, { inputs: [ { internalType: "contract IConverterAnchor", name: "_poolAnchor", type: "address" } ], name: "isPoolWhitelisted", outputs: [ { internalType: "bool", name: "", type: "bool" } ], stateMutability: "view", type: "function" }, { inputs: [ { internalType: "address", name: "_provider", type: "address" }, { internalType: "uint256", name: "_index", type: "uint256" } ], name: "lockedBalance", outputs: [ { internalType: "uint256", name: "", type: "uint256" }, { internalType: "uint256", name: "", type: "uint256" } ], stateMutability: "view", type: "function" }, { inputs: [ { internalType: "address", name: "_provider", type: "address" } ], name: "lockedBalanceCount", outputs: [ { internalType: "uint256", name: "", type: "uint256" } ], stateMutability: "view", type: "function" }, { inputs: [ { internalType: "address", name: "_provider", type: "address" }, { internalType: "uint256", name: "_startIndex", type: "uint256" }, { internalType: "uint256", name: "_endIndex", type: "uint256" } ], name: "lockedBalanceRange", outputs: [ { internalType: "uint256[]", name: "", type: "uint256[]" }, { internalType: "uint256[]", name: "", type: "uint256[]" } ], stateMutability: "view", type: "function" }, { inputs: [], name: "newOwner", outputs: [ { internalType: "address", name: "", type: "address" } ], stateMutability: "view", type: "function" }, { inputs: [], name: "owner", outputs: [ { internalType: "address", name: "", type: "address" } ], stateMutability: "view", type: "function" }, { inputs: [ { internalType: "uint256", name: "_id", type: "uint256" } ], name: "protectedLiquidity", outputs: [ { internalType: "address", name: "", type: "address" }, { internalType: "contract IDSToken", name: "", type: "address" }, { internalType: "contract IERC20Token", name: "", type: "address" }, { internalType: "uint256", name: "", type: "uint256" }, { internalType: "uint256", name: "", type: "uint256" }, { internalType: "uint256", name: "", type: "uint256" }, { internalType: "uint256", name: "", type: "uint256" }, { internalType: "uint256", name: "", type: "uint256" } ], stateMutability: "view", type: "function" }, { inputs: [ { internalType: "address", name: "_provider", type: "address" } ], name: "protectedLiquidityCount", outputs: [ { internalType: "uint256", name: "", type: "uint256" } ], stateMutability: "view", type: "function" }, { inputs: [ { internalType: "address", name: "_provider", type: "address" }, { internalType: "uint256", name: "_index", type: "uint256" } ], name: "protectedLiquidityId", outputs: [ { internalType: "uint256", name: "", type: "uint256" } ], stateMutability: "view", type: "function" }, { inputs: [ { internalType: "address", name: "_provider", type: "address" } ], name: "protectedLiquidityIds", outputs: [ { internalType: "uint256[]", name: "", type: "uint256[]" } ], stateMutability: "view", type: "function" }, { inputs: [ { internalType: "address", name: "_provider", type: "address" }, { internalType: "uint256", name: "_index", type: "uint256" } ], name: "removeLockedBalance", outputs: [], stateMutability: "nonpayable", type: "function" }, { inputs: [ { internalType: "contract IConverterAnchor", name: "_poolAnchor", type: "address" } ], name: "removePoolFromWhitelist", outputs: [], stateMutability: "nonpayable", type: "function" }, { inputs: [ { internalType: "uint256", name: "_id", type: "uint256" } ], name: "removeProtectedLiquidity", outputs: [], stateMutability: "nonpayable", type: "function" }, { inputs: [ { internalType: "contract IERC20Token", name: "_token", type: "address" } ], name: "systemBalance", outputs: [ { internalType: "uint256", name: "", type: "uint256" } ], stateMutability: "view", type: "function" }, { inputs: [ { internalType: "contract IDSToken", name: "_poolToken", type: "address" } ], name: "totalProtectedPoolAmount", outputs: [ { internalType: "uint256", name: "", type: "uint256" } ], stateMutability: "view", type: "function" }, { inputs: [ { internalType: "contract IDSToken", name: "_poolToken", type: "address" }, { internalType: "contract IERC20Token", name: "_reserveToken", type: "address" } ], name: "totalProtectedReserveAmount", outputs: [ { internalType: "uint256", name: "", type: "uint256" } ], stateMutability: "view", type: "function" }, { inputs: [ { internalType: "address", name: "_newOwner", type: "address" } ], name: "transferOwnership", outputs: [], stateMutability: "nonpayable", type: "function" }, { inputs: [ { internalType: "uint256", name: "_id", type: "uint256" }, { internalType: "uint256", name: "_newPoolAmount", type: "uint256" }, { internalType: "uint256", name: "_newReserveAmount", type: "uint256" } ], name: "updateProtectedLiquidityAmounts", outputs: [], stateMutability: "nonpayable", type: "function" }, { inputs: [ { internalType: "uint256", name: "_index", type: "uint256" } ], name: "whitelistedPool", outputs: [ { internalType: "contract IConverterAnchor", name: "", type: "address" } ], stateMutability: "view", type: "function" }, { inputs: [], name: "whitelistedPoolCount", outputs: [ { internalType: "uint256", name: "", type: "uint256" } ], stateMutability: "view", type: "function" }, { inputs: [], name: "whitelistedPools", outputs: [ { internalType: "contractIConverterAnchor", name: "", type: "address[]" } ], stateMutability: "view", type: "function" }, { inputs: [ { internalType: "contract IERC20Token", name: "_token", type: "address" }, { internalType: "address", name: "_to", type: "address" }, { internalType: "uint256", name: "_amount", type: "uint256" } ], name: "withdrawTokens", outputs: [], stateMutability: "nonpayable", type: "function" } ]
9
},
10
filters: [
11
{
12
method: {
13
name: "SystemBalanceUpdated"
14
},
15
parameter: {
16
name: "_newAmount",
17
type: "uint256",
18
currency: "$TOKEN or $PARAMETER_NAME",
19
index: null
20
},
21
type: CheckEventParameter,
22
condition: {
23
attribute: "5000",
24
predicate: BiggerThan,
25
currency: "USD"
26
}
27
}
28
]
29
},
30
actions: [
31
{
32
type: Webhook,
33
attributes: {
34
uri: "http://foo.bar"
35
}
36
}
37
]
38
}) {
39
UUID
40
}
41
}
42
Copied!
1
{
2
"data": {
3
"createContractsTrigger": {
4
"UUID": "8b944a2f-da6b-41a6-895b-c39fcac5011e"
5
}
6
}
7
}
Copied!

Create a WaC trigger with a threshold expressed in a FIAT currency

Query
Result
1
mutation {
2
createContractsTrigger(input: {
3
name: "Trigger to update",
4
type: ContractsTrigger,
5
recipe: 3,
6
statement: {
7
contract: {
8
address: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
9
abi: [ { abi1stkey: "abi1stvalue" }]
10
},
11
method: {
12
name: "balanceOf"
13
}
14
inputs: [
15
{
16
type: "address",
17
name: "who",
18
value: "0x04fa0d235c4abf4bcf4787af4cf447de572ef828"
19
}
20
],
21
outputFilters: [
22
{
23
parameter: {
24
name: "balanceOf-0",
25
type: "uint256",
26
currency: "$TOKEN"
27
},
28
returnIndex: 0,
29
condition: {
30
attribute: "2345",
31
predicate: "BiggerThan",
32
currency: "USD"
33
}
34
}
35
]
36
},
37
actions: [
38
{
39
type: Webhook,
40
attributes: {
41
uri: "http://www.dasa"
42
}
43
}
44
]
45
}) {
46
UUID
47
}
48
}
49
50
51
Copied!
1
{
2
"data": {
3
"createContractsTrigger": {
4
"UUID": "8b944a2f-da6b-41a6-895b-c39fcac5011e"
5
}
6
}
7
}
Copied!
Last modified 1yr ago