Configure an account's automations from a list of intents and return the unsigned setAssetManagers transaction. The backend resolves which asset managers each intent needs, validates that the combination is compatible, encodes the metadata and builds the calldata, so you describe the desired outcome rather than the contracts.
With mode 'save' (the default) the intents array is the complete desired state: the backend diffs it against what is currently enabled, so any automation you leave out is DISABLED by the returned transaction. Pass a single intent with enabled: false to turn everything off.
Mode 'preview' validates and resolves the intents WITHOUT reading chain state and returns no transaction, because its calldata carries no disable entries and would only partially apply the state. Use it to check a combination is legal or to show a plan; use 'save' to get something signable. To toggle one automation without restating the rest, use write_account_automations_delta.
Intents:
- compound_fees: reinvest earned fees/rewards back into the LP. Optional 'tokens' scopes it per yielding token. A staked reward that is not a pool token is swapped in via CowSwap automatically.
- claim_rewards: claim yield out. config.mode as_earned pays the tokens as-is, convert_to swaps them to config.buy_token via CowSwap. config.convert_tokens converts only a subset and claims the rest as-earned. config.destination account or wallet.
- add_to_lp: fold idle pool-token balances (deposits, rebalance leftovers) back into the LP. Opt-in per token.
- claim_merkl: auto-claim Merkl incentive rewards. Independent of the compounder/claimer/cowswapper triad and needs no position context.
- rebalance: reposition the LP. strategy out_of_range (default), take_profit (runs on the dedicated profit-taker contract), or protocol_owned_liquidity.
Pass position_id (from assets[] in read_account_info) and the backend fills in protocol, is_staked, token0, token1 and reward_tokens for you; anything you pass explicitly wins. claim_merkl needs no position context.
Rules the backend enforces (a violation is returned as an error, never written on-chain):
- Every yielding token must be assigned to exactly one of compound_fees or claim_rewards. Scoping one to a subset without covering the rest is rejected, and no token may be in both.
- A wallet or custom-recipient payout requires a pure as-earned claim: nothing converted, and every yielding token claimed. Converts settle in the account.
- convert_tokens must be a subset of the claimed tokens, and buy_token cannot be a compounded token, a converted token, or an add_to_lp folded token.
- Each intent kind may appear only once, and a token list must not be empty or name a token the position does not yield.
Returns { valid, errors, warnings, human_summary, plan, diff, transaction }. When a compatibility rule fires the call returns an error and no transaction: read errors[].reason, adjust the intents and retry. There is deliberately no transaction when the account already matches the request (no_changes_needed), when the Tenderly simulation predicts a revert (an error), or in preview mode (preview_only). Call read_asset_manager_intents first to see which intents this account can enable.
View input schema
{
"type": "object",
"properties": {
"account_address": {
"type": "string",
"description": "Arcadia account address"
},
"intents": {
"minItems": 1,
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "compound_fees"
},
"enabled": {
"default": true,
"description": "False disables this intent's managers instead of enabling them.",
"type": "boolean"
},
"position_id": {
"description": "LP position (NFT) id this intent applies to. Also used to auto-fetch position context.",
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"tokens": {
"description": "Which tokens' yield to reinvest. Omit for all yielding tokens. 'reward' only exists on a staked position whose reward token is not a pool token. Every yielding token must be assigned to either compound_fees or claim_rewards, so if you scope this to a subset you must add a claim_rewards intent covering the rest.",
"type": "array",
"items": {
"type": "string",
"enum": [
"token0",
"token1",
"reward"
]
}
}
},
"required": [
"kind"
]
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "claim_rewards"
},
"enabled": {
"default": true,
"description": "False disables this intent's managers instead of enabling them.",
"type": "boolean"
},
"position_id": {
"description": "LP position (NFT) id this intent applies to. Also used to auto-fetch position context.",
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"config": {
"default": {},
"type": "object",
"properties": {
"mode": {
"default": "as_earned",
"description": "as_earned pays out the claimed tokens as-is; convert_to swaps them to buy_token via CowSwap. Use convert_tokens to convert only some of them.",
"type": "string",
"enum": [
"as_earned",
"convert_to"
]
},
"destination": {
"default": "account",
"description": "Payout target ('wallet' is the owner EOA). A wallet payout is only allowed for a pure as-earned claim: nothing converted, and every yielding token claimed. Any convert, or a claim scoped to a subset of tokens, must use 'account' because CowSwap settles there.",
"type": "string",
"enum": [
"account",
"wallet"
]
},
"buy_token": {
"description": "ERC20 to swap into. Required whenever any token is being converted. It cannot be a token you also compound, one of the tokens being converted, or a token folded by add_to_lp.",
"type": "string"
},
"recipient": {
"description": "Explicit payout address. Overrides destination when set, and is subject to the same pure-as-earned rule as a wallet payout unless it equals the account address.",
"type": "string"
},
"tokens": {
"description": "Which tokens' yield to claim out. Omit for all yielding tokens. A token cannot be both claimed and compounded, and every yielding token must be assigned to one of the two.",
"type": "array",
"items": {
"type": "string",
"enum": [
"token0",
"token1",
"reward"
]
}
},
"convert_tokens": {
"description": "Subset of this intent's claimed tokens to swap to buy_token; the rest are claimed as-earned. Must be a subset of `tokens`. Omit to defer to mode (convert_to converts all claimed tokens, as_earned converts none). Use this for a partial convert, e.g. tokens: ['token0','reward'] with convert_tokens: ['reward'] swaps only the reward and claims token0 as-is.",
"type": "array",
"items": {
"type": "string",
"enum": [
"token0",
"token1",
"reward"
]
}
}
}
}
},
"required": [
"kind"
]
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "add_to_lp"
},
"enabled": {
"default": true,
"description": "False disables this intent's managers instead of enabling them.",
"type": "boolean"
},
"position_id": {
"description": "LP position (NFT) id this intent applies to. Also used to auto-fetch position context.",
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"tokens": {
"description": "Which pool tokens' idle account balance to fold into the LP. Omit for both. Folding is opt-in per token, and a folded token cannot be the buy_token of a claim_rewards convert.",
"type": "array",
"items": {
"type": "string",
"enum": [
"token0",
"token1"
]
}
}
},
"required": [
"kind"
]
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "claim_merkl"
},
"enabled": {
"default": true,
"description": "False disables this intent's managers instead of enabling them.",
"type": "boolean"
},
"position_id": {
"description": "LP position (NFT) id this intent applies to. Also used to auto-fetch position context.",
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"config": {
"default": {},
"type": "object",
"properties": {
"destination": {
"default": "account",
"type": "string",
"enum": [
"account",
"wallet"
]
},
"reward_recipient": {
"description": "Explicit recipient address. Overrides destination when set.",
"type": "string"
}
}
}
},
"required": [
"kind"
]
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "rebalance"
},
"enabled": {
"default": true,
"description": "False disables this intent's managers instead of enabling them.",
"type": "boolean"
},
"position_id": {
"description": "LP position (NFT) id this intent applies to. Also used to auto-fetch position context.",
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"strategy": {
"description": "out_of_range repositions when price leaves the range; take_profit runs on the dedicated profit-taker contract; protocol_owned_liquidity is the POL strategy.",
"default": {
"kind": "out_of_range"
},
"oneOf": [
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "out_of_range"
},
"optimal_token0_ratio": {
"default": 500000,
"description": "Target token0 composition after a rebalance, 1e6-scaled: 500000 = 50% (balanced, the default), 750000 = 75% token0, 0 = all token1.",
"type": "integer",
"minimum": 0,
"maximum": 1000000
},
"trigger_lower_tick_ratio": {
"default": 0,
"description": "Offset from tick_lower as a fraction of the position's tick range, 1e6-scaled. This is TICK distance, not price: 50000 shifts the trigger by 5% of (tick_upper - tick_lower) ticks, which is not 5% of price. 0 = trigger exactly at the boundary. Positive (e.g. 50000) puts the trigger outside the position so price must travel further beyond the range before rebalancing. Negative (e.g. -50000) puts it inside, firing preemptively while price is still in range.",
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"trigger_upper_tick_ratio": {
"default": 0,
"description": "Same as trigger_lower_tick_ratio, for tick_upper. The two are independent, so asymmetric configs are valid (e.g. lower -50000, upper 0 rebalances early on the downside but only at the boundary on the upside).",
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"min_rebalance_time": {
"default": 3600,
"description": "Cooldown in seconds between rebalances.",
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"max_rebalance_time": {
"default": 1000000000000,
"description": "Seconds before a rebalance is forced. Default is effectively disabled.",
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"kind"
]
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "protocol_owned_liquidity"
},
"initial_range": {
"default": 200000,
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"base_range": {
"default": 50000,
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"k1": {
"default": 0,
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"k2": {
"default": 0,
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"rebalance_threshold": {
"default": 25000,
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"limit_order_withdrawal_threshold": {
"default": 50000,
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"fraction_excess_to_limit_order": {
"default": 500000,
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"deadzone": {
"default": 20000,
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"target_token0_ratio": {
"default": 500000,
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"kind"
]
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "take_profit"
},
"profit_token": {
"default": "token0",
"type": "string",
"enum": [
"token0",
"token1"
]
},
"take_profit_trigger_type": {
"default": "fixed",
"type": "string",
"enum": [
"",
"fixed",
"relative"
]
},
"take_profit_trigger_threshold": {
"default": 0,
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"take_profit_reposition_mode": {
"default": "anchor_tick",
"type": "string",
"enum": [
"",
"anchor_tick",
"shift_range"
]
},
"has_reversal": {
"default": false,
"type": "boolean"
},
"reversal_trigger_type": {
"default": "",
"type": "string",
"enum": [
"",
"fixed",
"relative"
]
},
"reversal_trigger_threshold": {
"default": 0,
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"reversal_reposition_mode": {
"default": "",
"type": "string",
"enum": [
"",
"anchor_tick",
"shift_range"
]
}
},
"required": [
"kind"
]
}
]
},
"max_tolerance": {
"description": "Max price deviation (MEV/slippage cap), 1e18-scaled: 1e18 = 100%, so 5000000000000000 = 0.5% (the default) and 50000000000000000 = 5%. Omit for the pool's default. AAA pools are floored at 5%.",
"type": "number",
"minimum": 0,
"maximum": 1000000000000000000,
"multipleOf": 1
},
"min_liquidity_ratio": {
"description": "Min fraction of liquidity that must survive a rebalance, 1e18-scaled: 990000000000000000 = 99% (the default), i.e. at most 1% value loss. Omit for the default.",
"type": "number",
"minimum": 0,
"maximum": 1000000000000000000,
"multipleOf": 1
}
},
"required": [
"kind"
]
}
],
"description": "One user-facing automation intent."
},
"description": "Complete desired automation state. In save mode anything omitted is disabled, so include every automation to keep. A single intent with enabled: false disables all automations."
},
"mode": {
"default": "save",
"description": "save diffs against on-chain state and returns a signable transaction that also disables anything omitted. preview resolves and validates only, returning a plan and no transaction.",
"type": "string",
"enum": [
"save",
"preview"
]
},
"position_id": {
"description": "LP position (NFT) id, as listed in assets[] by read_account_info. Supply this and the backend fetches protocol, staked flag, tokens and reward tokens for you. Strongly preferred over passing the position fields by hand.",
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"protocol": {
"description": "Position's DEX protocol. Only needed when position_id is omitted. Accepts the dex_protocol values the read tools return (slipstream, staked_slipstream_v3, uniV3, metadexcl_v1, staked_metadexcl_v1, ...), which imply is_staked, as well as the canonical slipstream_v1 / uniswap_v3 spellings. metadexcl_v1 is Aero CL; staked_metadexcl_v1 covers both the staked module and the wrapper.",
"type": "string",
"enum": [
"slipstream_v1",
"slipstream_v2",
"slipstream_v3",
"uniswap_v3",
"uniswap_v4",
"metadexcl_v1",
"slipstream",
"staked_slipstream",
"staked_slipstream_v2",
"staked_slipstream_v3",
"uniV3",
"uniV4",
"staked_metadexcl_v1"
]
},
"is_staked": {
"description": "Whether the LP position is staked. Implied by a staked_* protocol value.",
"type": "boolean"
},
"token0": {
"description": "Pool token0 address.",
"type": "string"
},
"token1": {
"description": "Pool token1 address.",
"type": "string"
},
"reward_tokens": {
"description": "Staking reward token addresses.",
"type": "array",
"items": {
"type": "string"
}
},
"owner": {
"description": "Account owner EOA. Used to resolve wallet payout targets.",
"type": "string"
},
"chain_id": {
"default": 8453,
"description": "Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)",
"type": "number"
}
},
"required": [
"account_address",
"intents"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}