Policies

Policies are rules that define how Swivell components behave in response to events.

{
   "effect": "effect_forward",
   "scope": "<channel id>",
   "condition": "deposit.asset.symbol == 'USDT' && !deposit.asset.is_possible_spam",
   "forward": {
     "network": "solana",
     "asset": "USDT",
     "recipient": "your address"
   }
}

Structure

Policy definitions have the following fields:

effect

What should happen if the condition is met

condition

Predicate that determines when this policy takes effect

scope

ID of the resource to which the policy should apply

Effect parameters

  • forward: defines where the deposit should be sent and what asset should be received

There are currently two effects:

  • effect_forward: convert and forward the deposit to the specified asset and wallet
  • effect_freeze: hold the deposit at the channel and prevent funds from reaching your wallets