Ambient Docs
  • Introduction to Ambient
  • Concepts
    • AMMs
    • Concentrated Liquidity
    • Knockout Liquidity
    • Governance & Policy
    • Surplus Collateral
    • Permissioned Pools
    • Account Abstraction
  • Users
    • Swaps
    • LP Positions
    • Surplus Collateral
    • Dynamic Fees
    • Knockout Positions
    • Initializing Pools
    • Gasless Transactions
    • External Routers
  • Governance & Policy
    • Ops & Treasury Multisigs
    • Policy
    • Upgrading Code
    • Emergency
  • Developers
    • Deployed Contracts
    • Token Transfers
    • Type Conventions
    • DEX Contract Interface
      • userCmd Callpaths
      • Swaps
        • Hot Path Swap Migration
          • Directly Calling CrocSwapDex
          • External Swap Router
      • Flat LP Calls
      • Long Form Orders
      • Knockout LP Calls
      • Pool Initialization
      • Surplus Collateral
      • Router Calls
      • Relayer Calls
    • Query Contracts
      • CrocQuery Contract
      • CrocImpact Contract
    • Logs and Queries
    • Libraries and APIs
      • SDK
      • Indexer API
      • Subgraph
Powered by GitBook
On this page
  1. Concepts

Account Abstraction

All operations in the Ambient dex can be undertaken with account abstraction, where a user signs an operation off-chain and a third party relayer executes it on their behalf. Relayers can be made in any arbitrary token from a user's balance. There are multiple reasons why a user would want to do this:

  • Avoid the inconvenience of managing transactions

  • Pay an exact cost with easier to manage tokens (like USDC) instead of worrying about calculating gas fees.

  • Save on execution costs by having the relayer bundle their actions with other similar actions to amortize the gas cost.

  • Make a pre-signed transaction and save it for later

There are two types of account abstraction, one is immediate and the other is conditional. Immediate account abstraction occurs when a user signs an intention and sends it to a relayer with the hope of imminent and unconditional execution.

Conditional account abstraction is when a user signs a transaction but prefers for it to be executed only after some condition is met, such as a fixed time delay or a certain market condition such as a stop loss. All intentions in Ambient can be gated with a check to an arbitrary oracle contract with arbitrary calldata. E.g. to implement a stop loss, the intention can be signed with a call to an oracle that checks the Chainlink price has exceeded a given threshold.

Intentions in Ambient use a multi-dimensional nonce system, so unlike Ethereum transactions they can be executed with arbitrary dependence and a user doesn't have to wait for one to finish before the next executes.

PreviousPermissioned PoolsNextSwaps

Last updated 1 year ago