Flash Loans
Flash loans in the Neptune Protocol allow users to borrow assets without collateral, as long as the borrowed amount is returned within the same transaction. This powerful feature enables sophisticated trading strategies, arbitrage opportunities, and efficient debt refinancing.
How Flash Loans Work
When executing a flash loan, the protocol:
Lends the requested assets to the borrower
Executes the borrower's specified series of operations
Verifies the borrowed amount plus fees are returned
Completes or reverts the entire transaction
All of these steps occur atomically - either all succeed together, or the entire transaction is rolled back, ensuring the protocol's safety.
Accessing Flashloans
Flashloan access in Neptune in gated by NEPT token staking, where the amount and value of your NEPT token stake determines the amount of value a user can Flashloan from the protocol.
For a users to be able to access Flashloans from the Neptune protocol, they must first stake NEPT into staking pool 3. The amount of NEPT staked to this pool, and the market value of NEPT is used in conjunction with the Flasloan Multiplier to determine the maximum value the user can utilise in a single Flashloan process.
This token gating feature was introduced to mitigate against misuse of Flashloans. Where in the past Flashloans have been utilized in malicious trading strategies to exploit vulnerabilities in third party protocols. Having to stake NEPT to first access Flashloans, requires the user to put up their own capital, increasing the cost of malicious behaviour and a potential loss to the user if protocol governance determines they are a bad actor.
Flash Loan Components
Borrowing and Fees
Flash loans in Neptune incur a small fee (typically 0.1%) on the borrowed amount. The total repayment amount is calculated as:
Flash Loan Receiver
The Flash Loan Receiver contract acts as an intermediary that:
Receives the borrowed funds
Executes the user's specified operations
Ensures proper repayment
Handles any remaining asset management
Common Use Cases
Flash loans enable several powerful strategies:
Arbitrage
Exploit price differences across exchanges
Execute trades with zero initial capital
Return loan plus fees from arbitrage profits
Collateral Swaps
Refinance existing loans
Switch collateral types efficiently
Optimize borrowing positions
Liquidations
Access capital for liquidation opportunities
Execute liquidations without holding reserves
Profit from discounted collateral sales
Safety Mechanisms
Neptune's flash loans incorporate several safety features:
Atomic Execution
All operations must succeed, or everything reverts
No partial execution possible
Protocol assets always protected
Validation Checks
Verification of full repayment
Fee calculation and collection
Asset balance reconciliation
Access Controls
Whitelisted receiver contracts
Validated operation sequences
Protected callback functions
Last updated