Tutorial: Swapping ETH for dETH in vETH Protocol

ETH based vETH Strategy

vETH optimizes ETH earning against a benchmark rate.

A common strategy is for users to deposit ETH into vETH in order to yield at the highest rate at the market. In order to achieve this, vETH will re-market ETH and other LSTs in order to offer the best ETH earnings for vETH users.

One strategy is to have ETH remarketed via a strategy that acquires dETH from the dETH vault, a smart contract part of Blockswap’s vETH protocol.

Smart contracts

The Blockswap vETH Strategy contract can be found at:

https://etherscan.io/address/0x000000000000000000000000000

The Blockswap dETH vault contract can be found at:

https://etherscan.io/address/0x000000000000000000

Strategy

The strategy is simple: if there is savETH or dETH in the dETH vault contract, there is an ability to boost the yield of your ETH by depositing ETH into the vETH strategy contract (via vETH UI) and then swapping that ETH to dETH.

Swapping

After depositing ETH into vETH , how do you swap ETH into dETH to boost vETH earnings? Invoke a swap on the strategy contract!

ABI required for this:

[{
      "inputs": [
        {
          "internalType": "address",
          "name": "_swapper",
          "type": "address"
        },
        {
          "internalType": "address",
          "name": "_tokenIn",
          "type": "address"
        },
        {
          "internalType": "uint256",
          "name": "_amountIn",
          "type": "uint256"
        },
        {
          "internalType": "address",
          "name": "_tokenOut",
          "type": "address"
        },
        {
          "internalType": "uint256",
          "name": "_minAmountOut",
          "type": "uint256"
        },
        {
          "internalType": "bytes",
          "name": "_extraData",
          "type": "bytes"
        }
      ],
      "name": "invokeSwap",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "amountOut",
          "type": "uint256"
        }
      ],
      "stateMutability": "nonpayable",
      "type": "function"
}]

Parameters required for the transaction:

  • Swapper address: 0x9a0F65f1c2Ea92Da82Ef070ab947862B8799C103

  • Token input (ETH): 0x0000000000000000000000000000000000000000

  • Amount in: Total ETH held by strategy in WEI

  • Token Out (dETH): 0x3d1E5Cf16077F349e999d6b21A4f646e83Cd90c5

  • Min amount out: 0 (Zero)

  • Extra data: Buffer.from("") (Empty)

Invoking this transaction on the vETH strategy contract It will start boosting the vETH earnings for vETH token holders.

Happy swapping!

Last updated