Magicspend++

Transact now, settle later!

Overview

Normally, if a user wants to transact on a new chain, they need to:

  1. Bridge tokens across chains

  2. Manage gas on each chain

  3. Wait for settlement before taking action

This creates friction, slows down activity, and reduces usability across chains.

Magicspend++ lets users spend their token balances across multiple chains in one seamless transaction without bridging delays or worrying about gas fees:

  • No bridging needed – funds are instantly available on the target chain

  • No gas headaches – gas fees are sponsored

  • Fast transactions – executed at the speed of the destination chain

How it works

Magicspend++ removes this friction with a borrow-and-settle model:

  1. Resource Lock

    • Locks part of the user’s tokens on source chains.

    • Those funds can’t be spent elsewhere until settlement.

    • Enforced differently depending on wallet type:

      • Turnkey Signers: Turnkey policies prevent wallets from spending locked tokens.

      • Smart contract wallets (e.g. Safe): Co-signer must approve spending of locked tokens.

  2. Enclave Vault

    • Instantly lends tokens on the target chain so the user can transact right away.

    • The loan is repaid later using the locked funds across chains.

Example

Let's say the user wants to buy 10 GMX tokens on Arbitrum but only has funds on Optimism and Base.

Magicspend++ flow:

  1. Borrow USDC on Arbitrum vault

  2. Instantly swap on Arbitrum DEX

  3. Settlement takes place later and deducts from Base and Optimism

Wallet Support

Enclave supports Magicspend++ with the following wallet types:

  1. Turnkey EOA Wallets

  2. Smart Contract Wallets (ERC4337, ERC7579 Smart Accounts)

Batched Transactions and Gas Abstraction

Enclave leverages ERC4337 paymasters to abstract gas for users. ERC4337 /7579 accounts are also able to execute batched transactions which allows the end user to borrow from Enclave's vault and execute the desired action (ex. swap on Uniswap) in a single atomic on-chain transaction.

EOA Support

In order to support Turnkey EOAs, Enclave leverages EIP7702 to convert the EOA into a smart contract wallet, allowing it to inherit the properties of a smart contract wallet which supports gas sponsorship and transaction batching.

Quote Types

Amount In

User specifies exactly how much to spend (inclusive of fees).

For example: User wants to spend exactly $10 to buy a memecoin.

Enclave gives $9.90 on target chain, settles $10 across balances on other chains.

Amount Out

User specifies how much they need on the target chain

For example: User needs $10 on Base to lend on Morpho

Enclave gives $10 on target chain, settles $10.10 across balances on other chains.

Note on fees: The quote includes fees for both the borrow cost as well as sponsoring the gas fees to be paid on the target chain for execution of the user's desired action, and the gas fees to be paid on the settlement chains for settlement transactions.

Last updated