LogoLogo
  • Introduction
    • Get started
  • Kiln Products
    • Overview
    • 🧱Validators
      • ⛓️Protocols
        • Algorand (ALGO)
        • Aptos (APT)
        • Avalanche (AVAX)
        • Babylon (BABY)
        • Cardano (ADA)
        • Celestia (TIA)
        • CoreChain (CORE)
        • Cosmos (ATOM)
        • Cronos (CRO)
        • DyDx (DYDX)
        • Ethereum (ETH)
        • Eigenlayer (EIGEN)
        • Fetch.ai (FET)
        • Flare (FLR)
        • Harmony (ONE)
        • Injective (INJ)
        • Iota (IOTA)
        • Kava (KAVA)
        • Kusama (KSM)
        • Mantra (OM)
        • MultiversX (EGLD)
        • Near (NEAR)
        • Oasis (ROSE)
        • Osmosis (OSMO)
        • Peaq (PEAQ)
        • Polkadot (DOT)
        • Polygon (POL - ex MATIC)
        • Sei (SEI)
        • Solana (SOL)
        • Stacks (STX)
        • Starknet (STRK)
        • Story(IP)
        • Sui (SUI)
        • Symbiotic (SYM)
        • Tezos (XTZ)
        • The Open Network (TON)
        • Tron (TRX)
        • Zetachain (ZETA)
    • 🎆Connect
      • Accessing Kiln Connect
      • API specs
      • Postman Demo
      • SDK
        • Getting started
        • How to find Kiln's validators
        • Upgrade guide from v2 to v3
      • Tutorials
        • SOL - Tag a stake
        • DYDX - How to bridge your rewards
      • Kiln Connect FAQs
    • 🚀Dashboard
      • Architecture
      • Staking
        • Cardano (ADA)
        • Celestia (TIA)
        • Cosmos (ATOM)
        • Cronos (CRO)
        • DYDX (DYDX)
        • Ethereum (ETH)
          • Native EigenLayer Restaking
          • Deposit into compounding validators
          • Convert skimming validators to compounding validators
        • Fetch.ai (FET)
        • Injective (INJ)
        • Kava (KAVA)
        • Kusama (KSM)
        • Mantra (OM)
        • Near (NEAR)
        • Osmosis (OSMO)
        • Polkadot (DOT)
        • Polygon (POL)
        • Solana (SOL)
        • Tezos (XTZ)
        • The Open Network (TON)
        • TRON (TRX)
        • ZetaChain (ZETA)
      • Reporting
        • Cardano (ADA)
        • Celestia (TIA)
        • Cosmos (ATOM)
        • Cronos (CRO)
        • DYDX (DYDX)
        • Ethereum (ETH)
        • Fetch.ai (FET)
        • Injective (INJ)
        • Kava (KAVA)
        • Kusama (KSM)
        • Mantra (OM)
        • Near (NEAR)
        • Osmosis (OSMO)
        • Polkadot (DOT)
        • Polygon (POL)
        • Solana (SOL)
        • Tezos (XTZ)
        • The Open Network (TON)
        • Tron (TRX)
        • ZetaChain (ZETA)
      • Unstaking
        • Cardano (ADA)
        • Celestia (TIA)
        • Cosmos (ATOM)
        • Cronos (CRO)
        • DYDX (DYDX)
        • Ethereum (ETH)
          • Native EigenLayer Withdraw Flow
          • Partial withdraw liquidity
        • Fetch.ai (FET)
        • Injective (INJ)
        • Kava (KAVA)
        • Kusama (KSM)
        • Mantra (OM)
        • Near (NEAR)
        • Osmosis (OSMO)
        • Polkadot (DOT)
        • Polygon (POL)
        • Solana (SOL)
          • Deactivate
          • Merge
          • Split
          • Withdraw
        • Tezos (XTZ)
        • Tron (TRX)
        • The Open Network (TON)
        • ZetaChain (ZETA)
      • Import stakes
      • Move stakes
      • Invite a user to your organization
      • Troubleshooting
      • 🎓Tutorials
        • Cosmos Chains - Auto-compound a stake
      • Dashboard FAQs
    • 📥dApp
      • ETH staking
      • EigenLayer
        • Operator delegation
        • Native restaking
        • Liquid restaking
      • 🔒Security
      • Kiln dApp FAQ
    • ⛓️Onchain
      • 🙋‍♀️Dedicated Validators
        • Key concepts
          • Deposit Flow
          • Rewards Management
          • Unstaking
        • How to integrate
          • 1. Contract Interactions
          • 2. Administration
      • 🤽‍♂️Pooled Staking
        • Key concepts
          • Staking Positions
          • Oracle Reports
          • Exit & Withdrawal
        • How to integrate
          • 🐎Getting Started
          • 🏗️Architecture overview
          • 😊User experience
          • 📃Integration contract
          • ⛑️Contract governance
          • ℹ️Contract ABI
          • 📥Using TheGraph
          • 🥩Staking Interactions
            • Staking
            • Rewards
            • Unstaking & Withdrawals
      • 🎡Tokenized Validators
      • 🎩Node Operators: how to integrate
        • Dedicated Validators (v1)
          • Manage Validators
        • Pooled Staking
          • 1. Using TheGraph for Setup
          • 2. Deploying vPool
          • 3. Key Provisioning in vFactory
          • 4. Oracle Daemon
          • 5. Depositing via Integration Contracts
          • 6. Exit Daemon
          • 7. Deploy Integration Contract (optional)
      • 🔓Security
        • Staking Risks
        • Audits & Bug Bounties
        • Business Continuity
        • Source code
    • 💰DeFi
      • 🦋Morpho via Kiln DeFi
      • 💻How to integrate?
        • Smart contract interactions
        • Governance
        • Reporting data
        • Administration
        • Supported DeFi Protocols
        • Additional Rewards Management
      • 🔓Security
        • Risks
        • Audits & Bug Bounty
        • Pause
        • Source code
        • Compliance Features
      • Kiln DeFi FAQ
    • 🪄Widget
      • 🧑‍🎨Customize - Widget Editor
      • ☄️Integrate - No/Low Code
    • 🛠️More Tools
      • ETH Batch Deposit Contract
      • Safe CD
  • Integrations
    • 🔭Plan your integration
    • 🔌Integrate Kiln products
    • 📱Wallets
      • Stake from Ledger Live
        • Direct Staking
        • Using Kiln Widget
          • DeFi Lending in Ledger Live
        • Using Kiln dApp
          • Dedicated Validators
          • Pooled Staking
          • EigenLayer Restaking
      • Stake from Safe{Wallet}
        • How to stake ETH on Safe & FAQ
        • DeFi Lending in Safe{Wallet}
        • Using Kiln dApp
      • Stake from Squads
    • 🏢Custody platforms
      • Stake from Anchorage
      • Stake from Bitgo
      • Stake from Coinbase Custody/Prime
      • Stake from Copper
      • Stake from Cordial Systems
      • Stake from DFNS
      • Stake from Finoa
      • Stake from Fireblocks
      • Stake from Fordefi
      • Stake from Hex Safe
      • Stake from Ledger Enterprise
      • Stake from Metamask Institutional
      • Stake from Rakkar
      • Stake from Utila
  • Working with Kiln
    • ☑️Staking & DeFi Track Record
    • ✅Security & Insurances
    • ☎️Support
      • FAQs
        • Enzyme FAQ
        • EigenLayer FAQ
        • Kiln x Safe{Wallet} FAQ
        • Ledger Live FAQ
Powered by GitBook
On this page
  • Bridge to Ethereum
  • Bridge to Osmosis

Was this helpful?

Export as PDF
  1. Kiln Products
  2. Connect
  3. Tutorials

DYDX - How to bridge your rewards

How to bridge your rewards using Kiln Connect, regardless of your custody solution.

PreviousSOL - Tag a stakeNextKiln Connect FAQs

Last updated 7 months ago

Was this helpful?

Rewards earned on DYDX are DYDX-USDC. In this tutorial we will present how to bridge these rewards to Ethereum or to Osmosis using the Kiln SDK. These flows can be done directly from if you are using Fireblocks.

Bridge to Ethereum

The goal of this bridge is to bring your dYdX rewards in USDC on your ETH address so that you can use them for other purposes like depositing them on a centralized exchange to get some dYdX back.

To convert your DYDX-USDC to USDC on Ethereum, we will use the developed by Circle, which is the recommended on-chain approach.

There is 3 steps to this flow:

1) Transfer the USDC from DYDX to the Noble chain

2) Burn the USDC on Noble

3) Mint the USDC on Ethereum

Here is a TypeScript code snippet that you can use:

import { Kiln } from "@kilnfi/sdk";
import axios from 'axios';

const f = async () => {
  const k = new Kiln({
    baseUrl: 'https://api.kiln.fi',
    apiToken: 'YOUR_KILN_API_TOKEN',
  });

  /**
   * Send dydx-usdc rewards to noble
   */
  // Craft IBC transfer transaction
  const transferTx = await k.client.POST(
    '/v1/dydx/transaction/noble-ibc-transfer',
    {
      body: {
        pubkey: '02d92b48d3e9ef34f2016eac7857a02768c88e30aea7a2366bc5ba032a22eceb8b',
        amount_uusdc: '1000000',
      }
    }
  );
  // Sign the transaction with Fireblocks or your custody solution
  const signResponse = await k.fireblocks.signDydxTx(vault, tx.data.data);
  // Broadcast the transaction on DYDX
  const broadcastedTx = await k.client.POST("/v1/dydx/transaction/broadcast", {
    body: {
      tx_serialized: signResponse.signed_tx.data.tx_serialized,
    }
  });


  /**
   * Burn the usdc on noble for eth address recipient
   */
  // Craft burn transaction
  const txburn = await k.client.POST(
    '/v1/noble/transaction/burn-usdc',
    {
      body: {
        pubkey: '02d92b48d3e9ef34f2016eac7857a02768c88e30aea7a2366bc5ba032a22eceb8b',
        amount_usdc: '1000000',
        recipient: '0xBC86717BaD3F8CcF86d2882a6bC351C94580A994',
      }
    }
  );
  // Sign the transaction with Fireblocks or your custody solution
  const signResponseBurn = await k.fireblocks.signDydxTx(vault, txburn.data.data);
  // Broadcast the transaction on Noble
  const broadcastedTxBurn = await k.client.POST("/v1/noble/transaction/broadcast", {
    body: {
      tx_serialized: signResponseBurn.signed_tx.data.tx_serialized,
    }
  });

  /**
   * Mint the USDC on Ethereum to the recipient
   */

  // Fetch the attestation from circle's API (https://developers.circle.com/stablecoins/reference/getattestation)
  const { data: attestation } = await axios.get(`https://iris-api-sandbox.circle.com/v1/messages/4/${burnTxHash}`);

  // Craft the Ethereum mint transaction
  // todo: Kiln to add this part to the sdk
  const mintTx;
  // Sign and broadcast the transaction with Fireblocks on Ethereum
  const txHash = await k.fireblocks.signAndBroadcastEthTx(vault, mintTx);
};

f();

Bridge to Osmosis

The goal of this bridge is to bring your dYdX rewards in USDC on another cosmos address here on Osmosis so that you can use them for other purposes like depositing them on a centralized exchange or a Swap on Osmosis to get some dYdX back.

This flow follows two steps:

1) Transfer the DYDX-USDC to the Noble chain

2) Transfer the USDC on Noble to Osmosis

Here is a TypeScript code snippet that you can use:

import { Kiln } from "@kilnfi/sdk";
import axios from 'axios';

const f = async () => {
  const k = new Kiln({
    apiToken: 'YOUR_KILN_API_TOKEN',
  });

  /**
   * Send dydx-usdc rewards to noble
   */
  // Craft IBC transfer transaction
  const transferTx = await k.client.POST(
    '/v1/dydx/transaction/noble-ibc-transfer',
    {
      body: {
        pubkey: '02d92b48d3e9ef34f2016eac7857a02768c88e30aea7a2366bc5ba032a22eceb8b',
        amount_uusdc: '1000000',
      }
    }
  );
  // Sign the transaction with Fireblocks or your custody solution
  const signResponse = await k.fireblocks.signDydxTx(vault, tx.data.data);
  // Broadcast the transaction on DYDX
  const broadcastedTx = await k.client.POST("/v1/dydx/transaction/broadcast", {
    body: {
      tx_serialized: signResponse.signed_tx.data.tx_serialized,
    }
  });


  /**
   * Send usdc from noble to osmosis
   */
  // Craft IBC transfer transaction
  const tx = await k.client.POST(
      '/v1/noble/transaction/osmo-ibc-transfer',
      {
        body: {
          pubkey: '02d92b48d3e9ef34f2016eac7857a02768c88e30aea7a2366bc5ba032a22eceb8b',
          recipient: 'osmo1qz0jvz6v3v7z2zg3z2zg3z2zg3z2zg3z2zg3z2',
          amount_uusdc: '1000000',
        }
      }
    );
  // Sign the transaction with Fireblocks or your custody solution
  const signResponse = await k.fireblocks.signDydxTx(vault, tx.data.data);
  // Broadcast the transaction on Noble
  const broadcastedTx = await k.client.POST("/v1/noble/transaction/broadcast", {
    body: {
      tx_serialized: signResponse.signed_tx.data.tx_serialized,
    }
  });
};

f();

🎆
Kiln Dashboard
Noble bridge