Policies

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

{
   "effect": "proxy_forward",
   "scope": "<proxy 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 proxy and prevent funds from reaching your wallets