Peridot Protocol
  • Introduction
    • Overview
      • What is Peridot?
      • Our Mission & Vision
      • Key Value Propositions
    • Why Cross-Chain DeFi?
      • Current Challenges in DeFi
      • How our Hub & Spoke model addresses these challenges
  • Architecture & Design
    • System Architecture
      • Overview of the Hub & Spoke Model
    • Core Components
      • Compound Based Lending & Borrowing Modules
      • Wormhole Integration: Token Transfer with Payload
      • On-Chain Accounting & Interest Rate Models
    • Integration Details
  • Technical Specifications
    • Core Contracts
      • Peridottroller
      • PERC20
      • PEther
  • Easy Mode: Onramp & Offramp for New Users
    • Overview of Easy Mode
    • Goals
    • Key Features
  • Contact
Powered by GitBook
On this page
  • How It Works
  • Payload Structure
  • Why It Matters
  1. Architecture & Design
  2. Core Components

Wormhole Integration: Token Transfer with Payload

Wormhole powers the cross-chain communication layer of Peridot Protocol. We use the Token Bridge with Payload feature to move assets and messages together in a single operation.

How It Works

  1. A user interacts with a Spoke Contract (e.g., on Solana).

  2. The contract calls Wormhole’s transferTokensWithPayload() method:

    • Locks the asset on the source chain

    • Emits a message (VAA) with the user action: deposit, borrow, repay, etc.

  3. The Hub Contract receives and verifies the VAA using completeTransferWithPayload().

  4. Logic is executed on the Hub: balances are updated, collateral is verified, loans are issued.

Payload Structure

The payload includes:

  • Action type (deposit, borrow, repay, etc.)

  • Asset and amount

  • Source chain and user address

  • Optional metadata

Why It Matters

  • Combines token movement and cross-chain logic in one step

  • Eliminates the need for separate messaging or relayers

  • Guarantees atomicity of user intents and token transfers

PreviousCompound Based Lending & Borrowing ModulesNextOn-Chain Accounting & Interest Rate Models

Last updated 1 month ago