deposit and
withdraw endpoints before it prepares the underlying
approval and vault transactions.
That means Earn rules should match request-body fields like vault_id, amount, and
raw_amount.
Supported methods
Earn policies currently support these rule methods:earn_depositearn_withdraw
Supported conditions
Earn rules supportaction_request_body conditions for the fields below:
| Field source | Field | Supported operators | Notes |
|---|---|---|---|
action_request_body | vault_id | eq, in, in_condition_set | Matches the Privy vault ID from the Dashboard. |
action_request_body | amount | eq, gt, gte, lt, lte | Value must be a positive decimal string, such as “1.5”. |
action_request_body | raw_amount | eq, gt, gte, lt, lte | Value must be an integer string in base units, such as “1500000”. |
system conditions, such as current_unix_timestamp, for
time-based controls.
Earn policies use
chain_type: "ethereum". For Earn methods, the policy engine only accepts
action_request_body and system conditions.Choose amount or raw_amount
Use amount if your app sends human-readable decimal values like "1.5". Use raw_amount if
your app sends base-unit values like "1500000".
This also affects runtime matching:
- A rule using
amountwill not match a request that only sendsraw_amount. - A rule using
raw_amountwill not match a request that only sendsamount.
Example
The example below allows:- deposits into one approved vault up to
1000units of the asset - withdrawals from that same vault
policy_ids. For signer-specific Earn
permissions, attach the policy as an override policy on a signer instead.
- Node SDK
- REST API
owner_id, the wallet update must be authorized by that owner.Common patterns
- Restrict deposits to one vault by matching
vault_id. - Reuse one rule across many vaults with
vault_id: inorvault_id: in_condition_set. - Enforce maximum deposit or withdrawal size with
amountorraw_amount. - Add time-based controls with
system.current_unix_timestamp.
Next steps
Create a policy
Learn more about creating and managing policy objects.
Conditional policies per signer
Apply different Earn permissions to different signers on the same wallet.

