Skip to main content
POST
/
v2
/
wallets
/
risk
/
rules
Create Risk Rule
curl --request POST \
  --url https://sandbox.groundtech.co/v2/wallets/risk/rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "portfolioWalletId": "11111111-1111-4111-8111-111111111111",
  "yieldSourceId": "44444444-4444-4444-8444-444444444444",
  "name": "TVL drawdown",
  "metric": "tvl_usd",
  "ruleKind": "relative_change_bps",
  "comparator": "lte",
  "thresholdValue": -1500,
  "windowSeconds": 86400,
  "severity": "critical",
  "action": "block_rebalance_buy"
}
'
{
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "portfolioWalletId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "yieldSourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "thresholdValue": 123,
    "windowSeconds": 123,
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
portfolioWalletId
string<uuid>
required
yieldSourceId
string<uuid>
required
metric
enum<string>
required

Global risk metric currently supported across yield sources.

Available options:
apy_bps,
tvl_usd,
available_withdrawal_liquidity_usd
ruleKind
enum<string>
required
Available options:
absolute,
relative_change_bps
comparator
enum<string>
required
Available options:
lt,
lte,
gt,
gte
thresholdValue
number
required
name
string | null
windowSeconds
integer | null
severity
enum<string>
default:warning
Available options:
warning,
critical
action
enum<string>
default:alert_only
Available options:
alert_only,
block_rebalance_buy,
request_rebalance_out,
auto_rebalance_out
status
enum<string>
default:active
Available options:
active,
paused

Response

Risk rule created

data
object