LogoLogo
  • Overview
  • Learn
    • Lend
    • Borrow
    • Interest Rate
    • Liquidate
    • Flash Loans
    • NEPT Token
    • Risks
  • Develop
    • Contracts
      • Market
      • Interest Model
      • Token
      • Oracle
      • Querier
      • Flashloan Reciever
      • nToken
    • Token Addresses
  • User Guides
    • How to Lend on Neptune
    • How to Borrow on Neptune
    • How to Stake with the Neptune Validator
    • How to bridge TIA to Injective
  • Socials and Media
  • Audits
Powered by GitBook
On this page
  • Execute Messages
  • 1. Receive Flash Loan
  • 2. Withdraw Assets
  1. Develop
  2. Contracts

Flashloan Reciever

PreviousQuerierNextnToken

Last updated 2 months ago

Flashloan Receiver Contract Address:

The Flash Loan Receiver Contract is a component of the Neptune protocol designed to handle flash loan operations. It is a utility which allows users to execute multiple messages related to a trading strategy utilising flashloans. Upon a borrow_flash_loan excution call, the borrowed funds and messages are forwarded to the Flashloan Receiver to be executed.

Execute Messages

1. Receive Flash Loan

Execute: receive_flash_loan

Purpose: Authorizes the sender and processes subsequent flash loan messages.

Execute Input:

{
  "receive_flash_loan": {
    "flash_loan_receive_msg": {
      "msgs": [
        {
          "bank": {
            "send": {
              "amount": [
                {
                  "denom": "inj",
                  "amount": "1000000"
                }
              ],
              "to_address": "inj1exampleaddress"
            }
          }
        }
      ],
      "sender": "inj1senderaddress"
    }
  }
}
Parameter
Type
Description
Required

flash_loan_receive_msg

FlashLoanReceiveMsg

Contains the messages to be processed and the sender's address

Yes

2. Withdraw Assets

Execute: withdraw_assets

Purpose: Withdraws specified assets to a designated recipient.

Execute Input:

{
  "withdraw_assets": {
    "assets": [
      {
        "native_token": {
          "denom": "inj"
        }
      }
    ],
    "recipient": "inj1nc7gjkf2mhp34a6gquhurg8qahnw5kxs5u3s4u"
  }
}
Parameter
Type
Description
Required

assets

Vec<AssetInfo>

List of assets to withdraw

Yes

recipient

Addr

Recipient address, Neptune Market contract

Yes

inj1wmtzan6tgzg0zyauknuxdnnfjwn350yewjf6fq