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

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 here.

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.

PreviousEnvironment SetupNextConfiguring Hardhat

Last updated 6 months ago

๐Ÿค–