Skip to main content

DeFi

To interact with DeFi protocols utilizing shielded funds, actual smart contract calls targeting external smart contracts are routed through burner EIP-7702 smart accounts for maximum compatibilty and frictionlessness.

As common interactions with DeFi protocols can be either of stateless, e.g. swapping on Uniswap, or stateful, e.g.supplying/withdrawing liquidity to/from an Aave pool the SDK provides means to accomodate both scenarios.

Stealth Actions

Our sdk provides all required primitives to compose stealth actions, that is DeFi actions performed by a burner account funded through the shielded pool and possibly with proceeds returning back into the shielded pool.

Bird-view

unshield -> DeFi actions (swap, vault-deposit, etc) -> reshield (optional)

Stealth primitives include a.o.: stealth addresses, EIP-7702 authorizations, EIP-7821 batch execution. We restructured our SDK to not provide an overloaded and oppinionated stealth function or equivalent, but rather nerded out on making the primitives absolutely modular so that higher-level composition is more flexible while still seamless.

Our SDK also supports Safe stealth actions, they follow the same bird-view flow as ordinary stealth actions, just that the stealth hop is performed by a JIT-Safe whose owners are stealth accounts derived from the original Safe's owner set.

Vaults

Since ERC-4626 tokenized vaults expose shares that are ERC-20 tokens they are supported in Bermuda out-of-the-box. Just provide the vault's share token address anywhere in the SDK as token parameter.

An example depositing sUSDC:

let payload = await bermuda.deposit({
signer,
token: bermuda.config.sUSDC,
to: '0x...',
amount: 100_000_000n
})

await signer.sendTransaction(payload)