# One sentence, fourteen steps, three chains

> The health factor it has to hold, the fees at every hop, the places it can fail, and the three things that make this plan harder than it looks.

- Source: https://defiloops.com/blog/a-loop-that-buys-and-borrows
- Published: 2026-05-19
- Category: Strategy
- Tags: worked-example, lending, bridging, rwa
- Author: DeFiLoops

---
Most strategy write-ups show you the idea and skip the execution. The execution is where
the money goes, so this one does the opposite: the idea takes two paragraphs and the rest
is what actually has to happen.

## The idea

You hold $1,000 in USDC on Base. You want long cbBTC exposure, you do not want to sell it
to raise cash, and you want a yield-bearing real-world asset paying down the borrow so the
position services itself.

In one sentence:

<Quote>
  Take $1,000, swap half to cbBTC, supply it, borrow $500, bridge it, buy the RWA, and let
  its yield repay the loan every month.
</Quote>

Four protocols, three chains, and a monthly schedule. By hand this is roughly twenty
minutes and eight signatures a month, every month, forever — which is the actual reason
people stop running strategies like this, not the strategy being wrong.

## The compiled plan

<StepBoard title="Fourteen steps, three chains, armed forever" repeats="every month" steps={[
  { op: 'deposit.pull',      name: 'pull-1000',     detail: '$1,000 USDC from wallet',      chain: 'base',     pill: '1 call' },
  { op: 'swap.router',    name: 'swap-cbbtc',    detail: '500 USDC → cbBTC',             chain: 'base',     pill: '2 calls', brk: true },
  { op: 'lend.supply',    name: 'supply-cbbtc',  detail: "← linked step's output",       chain: 'base',     pill: '2 calls', brk: true },
  { op: 'lend.borrow',    name: 'borrow-500',    detail: '500 USDC · HF 1.56',           chain: 'base',     pill: '2 calls', brk: true },
  { op: 'bridge.cctp',    name: 'bridge-to-arb', detail: '500 USDC · CCTP',              chain: 'base→arb', pill: 'off-chain', brk: true },
  { op: 'swap.router',    name: 'swap-route',    detail: "← linked step's output",       chain: 'arbitrum', pill: '2 calls', brk: true },
  { op: 'bridge.cctp',  name: 'bridge-to-eth', detail: '500 USDC · CCTP',            chain: 'arb→eth',  pill: 'off-chain', brk: true },
  { op: 'swap.router',    name: 'swap-usdc',     detail: "← linked step's output",       chain: 'ethereum', pill: '2 calls', brk: true },
  { op: 'bridge.cctp',    name: 'bridge-back',   detail: '499.50 · $0.50 fee',           chain: 'eth→base', pill: 'off-chain', brk: true },
  { op: 'property.buy',        name: 'buy-rwa-49',    detail: '49 units @ $10.10',            chain: 'base',     pill: '2 calls', brk: true },
  { op: 'rent.claim_own',      name: 'claim-yield',   detail: 'monthly yield',                chain: 'base',     pill: '1 call' },
  { op: 'rent.redeem',     name: 'redeem-usdc',   detail: "← linked step's output",       chain: 'base',     pill: '2 calls' },
  { op: 'lend.repay',     name: 'repay-500',     detail: '500 USDC · Aave v3',           chain: 'base',     pill: '2 calls' },
  { op: 'transfer.erc20', name: 'send-rest',     detail: 'remainder to wallet',          chain: 'base',     pill: '1 call' },
]} />

<StatRow>
  <Stat value="14" label="steps" />
  <Stat value="3" label="chains" />
  <Stat value="1.56" label="health factor" accent />
  <Stat value="1" label="signature" note="One message covers the whole plan." />
</StatRow>

## Reading it

Three things in that board are worth stopping on.

### The dotted lines are transaction boundaries

Steps 2→3 and 3→4 are dotted. That is the engine saying a runtime amount cannot be carried
across that point, so a new transaction starts. It is not a warning. It is the shape of the
plan, stated before you approve it rather than discovered when something reverts.

### "← linked step's output" is not a placeholder

Step 3 supplies *what step 2 actually received* — the real fill after slippage, not the
500 USDC the plan hoped for. If the swap fills at a worse price, the supply is smaller and
the borrow is sized against the smaller collateral. The health factor holds.

<Callout type="warn" title="Not every parameter reads the bus">
  This is a sharp edge. On a liquidity-provision step, `amount0` can be fed by a previous
  step while `amount1` is a literal. A plan that swaps into token1 and expects both legs to
  size themselves will come up short on one side. Check which parameters are runtime-fed
  before you rely on it.
</Callout>

### The bridges are the expensive part

Steps 5, 7 and 9 cross chains. Each is off-chain — value leaves, time passes, value
arrives. They are the slowest steps, the ones with real fees, and the ones a runtime
amount cannot cross.

<Callout type="danger" title="Only USDC bridges">
  The bridge in the catalogue is CCTP, and CCTP is USDC-only. Sizing a bridge step from a
  swap that produced WETH is refused at validation — which is the correct outcome, but it
  surprises people, because the sentence did not say anything about USDC.
</Callout>

## The numbers

<Spec title="Where the money goes" rows={[
  ['Swap slippage', '~0.05–0.3% on 500 USDC through an aggregation router'],
  ['CCTP fee', '$0.50 per crossing, flat — visible as 499.50 on step 9'],
  ['Gas', 'Sponsored by the relayer, reimbursed from the plan in USDC'],
  ['Borrow rate', 'Aave v3 variable, floating — the largest uncertain cost'],
  ['RWA entry', '49 units @ $10.10, from a $500 budget with rounding'],
]} />

Note what is *not* a cost: you never bridge gas to Arbitrum or Ethereum. The relayer
sponsors those calls and is reimbursed in the asset the plan already holds. For a
three-chain plan that is the difference between one signature and about six.

## The same plan, at three sizes

The step count does not change with size, but what is worth doing does. Bridge fees are
flat, so they dominate a small plan and vanish in a large one.

| Plan size | CCTP fees | Fees as % | Steps | Worth automating |
| --- | --- | --- | --- | --- |
| $1,000 | $1.50 | 0.15% | 14 | Marginal — fees eat a month of yield |
| $10,000 | $1.50 | 0.015% | 14 | Yes |
| $100,000 | $1.50 | 0.0015% | 14 | Yes, and slippage now matters more than fees |

Above roughly $10,000 the flat costs stop being the thing to optimise and swap execution
becomes the thing to optimise — which is a different plan shape, with the trade split
across venues rather than routed through one.

## What can go wrong

<Steps>
  <Step title="The swap fills badly">
    The supply and borrow size down with it. The health factor is preserved because the
    borrow is computed from the actual collateral, not the intended collateral.
  </Step>
  <Step title="cbBTC falls">
    The health factor drops. At 1.56 there is meaningful room, but this is a leveraged
    position and it can be liquidated. The plan does not defend it — you would need a
    separate rule for that, and you should ask what protection costs before assuming it is
    worth buying.
  </Step>
  <Step title="The RWA yield underpays">
    Step 13 repays what step 12 redeemed. A short month leaves debt outstanding, which is
    fine — it accrues, and the next run repays more. Nothing breaks.
  </Step>
  <Step title="A step reverts">
    The plan halts there and reports the state it stopped in. Steps 11–14 simply do not
    run. The next scheduled run reads your balances fresh rather than assuming.
  </Step>
</Steps>

<Callout type="note" title="Ask before you commit">
  Before running this, the read-only tools will price it: what the range would have
  collected over real history, what the borrow has cost at every rate since 2021, what
  liquidations have looked like at this health factor. None of that signs anything, and it
  is the half of the product most people underuse.
</Callout>

## Repaying by shares, not by amount

One implementation detail that generalises well beyond this plan.

Step 13 repays 500 USDC. If you instead repay *the position*, repay by shares rather than
by a fixed amount — a fixed amount leaves dust debt behind as interest accrues between
calculation and execution, and dust debt blocks the withdrawal you were trying to make.

<Compare left="Repay 500 USDC" right="Repay the full share balance" verdict>
  <Fragment slot="left">
    Interest accrues between the read and the transaction. A few wei of debt survive. The
    subsequent withdraw reverts and the reason is not obvious.
  </Fragment>
  <Fragment slot="right">
    The position closes cleanly regardless of how much interest accrued in between.
  </Fragment>
</Compare>

The same shape shows up with aTokens: withdrawing exactly what you supplied can revert by
one wei, because the token rounds down. Whole-position operations should be expressed as
whole-position operations.

## Was it worth automating?

Twenty minutes and eight signatures a month is not a lot of work. The reason to automate it
is not the twenty minutes — it is that a strategy you run by hand is a strategy you run
when you remember, at a price you did not choose, and stop running the month you are busy.

The plan above runs on the first of the month whether or not you are paying attention, at
a shape you approved once, and stops cleanly if anything is wrong.