Skip to content

Paxeer Network

LicenseSolidityPaxeer

FlashLoanFacet API Reference

The FlashLoanFacet provides uncollateralized flash loans from pool reserves.

Functions

flashLoan

Execute a flash loan. Borrowed tokens must be repaid (plus fee) within the same transaction.

solidity
function flashLoan(
    address receiver,
    address token,
    uint256 amount,
    bytes calldata data
) external

Parameters:

NameTypeDescription
receiveraddressContract implementing IFlashLoanReceiver
tokenaddressToken to borrow
amountuint256Amount to borrow
databytesArbitrary data passed to receiver callback

Flow:

  1. Protocol transfers amount of token to receiver
  2. Protocol calls receiver.onFlashLoan(msg.sender, token, amount, fee, data)
  3. Receiver must approve protocol to pull back amount + fee
  4. Protocol pulls amount + fee from receiver

Reverts if receiver doesn't repay amount + fee.

getFlashLoanFee

Get the fee for a flash loan amount.

solidity
function getFlashLoanFee(uint256 amount) external view returns (uint256 fee)

Default fee: 9 bps (0.09%).

IFlashLoanReceiver Interface

Flash loan receivers must implement:

solidity
interface IFlashLoanReceiver {
    function onFlashLoan(
        address initiator,
        address token,
        uint256 amount,
        uint256 fee,
        bytes calldata data
    ) external returns (bytes32);
}

Must return keccak256("IFlashLoanReceiver.onFlashLoan").


License

Licensed under the GNU General Public License v3.0--see LICENSE for terms.

Copyright (C) 2026 PaxLabs Inc.
SPDX-License-Identifier: GPL-3.0-only

Contact & Resources

ResourceLink
Protocol Documentationdocs.hyperpaxeer.com
Block Explorerpaxscan.paxeer.app
Sidiora Exchangeapp.hyperpaxeer.com
Websitepaxeer.app
Twitter/X@paxeer_app
General Inquiriesinfopaxeer@paxeer.app
Security Reportssecurity@paxeer.app

Released under the GPL-3.0 License.