Bonzo Finance Documentation
  • 🤠Overview
  • 🗺️Roadmap
  • GET STARTED
    • 🏦Bonzo Mainnet
      • Connect Wallet
      • Supply Assets
      • Withdraw Assets
      • Enable / Disable Collateral
      • Borrow Assets
      • Repay Loan
      • Dashboard Metrics Explained
    • ❗Troubleshooting
    • 🧪Bonzo Testnet
    • 💸Protocol Fees & Revenue
    • 💧Liquidations
    • 🌐Hedera ($HBAR)
      • Hedera Wallet Setup
      • Obtaining $HBAR
      • Bridging Assets
  • Rewards & Incentives
    • 🥩Single-Sided Staking
    • ✨Native APYs & Liquidity Incentives
    • 🎟️Bonzo Points
      • Pre-Season Points Airdrop
      • Season One Points
      • Season Two Points
    • 🖼️Bonzo NFT Collectables
      • 1st Edition Bonzo NFTs
      • Cybernetic NFT
      • Commemorative NFT
      • Ownership & License Terms
  • SECURITY & RISK
    • ⚠️Risk Framework
    • 🛡️Audits
  • CONTRIBUTORS
    • 🐵Team
    • 👷Careers
    • 🎉Community
  • DEVELOPER
    • 📊Bonzo v1 Data API
    • 📜Protocol Contracts
    • 🤖Liquidation Bots (Beta)
      • 🛸SaucerSwap DEX
      • Environment Setup
      • Liquidator Contract
      • Configuring Hardhat
      • Performing a Liquidation
    • ⚡Flash Loans
    • 🔮Oracles
      • Supra
      • Chainlink
    • 👾GitHub
    • 🐞Bug Bounty
  • RESOURCES
    • 🟢Status Page
    • 🎨Brand Assets
    • 📚Glossary
    • 📞Contact
      • Support
      • Community
  • TRANSPARENCY
  • 🏦Accounts & Contracts
  • LEGAL
    • 📃Terms of Service
    • 🔒Privacy Policy
Powered by GitBook
On this page
  • 1. Review the Contract
  • 2. Compile the Contract
  • 3. Deploy the Contract
  1. DEVELOPER
  2. Liquidation Bots (Beta)

Liquidator Contract

PreviousEnvironment SetupNextConfiguring Hardhat

Last updated 5 months ago

The LiquidatorContract.sol smart contract facilitates liquidations by interacting with the Bonzo lending pool and performing token swaps via SaucerSwap.

1. Review the Contract

You can find the contract code .

Key Functions:

  • liquidate(): Initiates the flash loan and triggers the liquidation.

  • executeOperation(): Called after receiving the flash-loaned amount; performs the liquidation and token swap.

  • _associateToken(): Associates Hedera tokens with the contract (required on Hedera).

2. Compile the Contract

Compile the contract using Hardhat:

npm run compile

3. Deploy the Contract

Deploy the contract to the Hedera testnet:

npx hardhat run scripts/deploy.ts --network hedera_testnet
  • Ensure your hardhat.config.ts is set up for the Hedera testnet.

  • In deploy.ts, replace LendingPoolAddressesProvider_address and SaucerswapRouter_address with the actual contract addresses.

🤖
here