đĻIncentive_v2
The core entry of Navi Protocol.
As a developer, your primary interactions with the Navi Protocol should be conducted through the functions contained within the incentive_v2 module. This module serves as the gateway for all write transactions, including deposit, withdrawal, borrowing, repayment, liquidation, and reward claim processes.
The functions within this module are categorized into two types: entry and non-entry calls.
Entry Functions:
Invoke the underlying base function.
Directly return the token object to the function sender.
Non-Entry Functions:
Also invoke the underlying base function.
Return the token object without handling it.
The caller, typically a developer or transaction builder, is required to manage the token object. Failing to do so will result in the transaction being reverted.
These functions offer greater flexibility for developers, enhancing interoperability and compatibility with other protocols.
Entry Functions
entry_deposit
This function allows a user to deposit a specified amount of a certain coin type into a lending pool. The deposit amount is then added to the pool's balance, and the deposit event is emitted.
example: https://suivision.xyz/txblock/5x5oAmbCq3CetnG6BrGBtSf9H3S7qhChvqcS7jphQp6o?tab=Overview
entry_withdraw
This function allows a user to withdraw a specified amount from a lending pool. The withdrawal amount is deducted from the pool's balance, and the withdrawal event is emitted.
example: https://suivision.xyz/txblock/9PmcTv7GYHQ7ECz4VFpGtYPVv64ny12fn5yeFjgFqZZS?tab=Overview
entry_borrow
This function allows a user to borrow a specified amount from a lending pool. The borrowed amount is deducted from the pool's balance, and the borrow event is emitted.
example: https://suivision.xyz/txblock/8rbib4Nc5WK8CeMSdqDKCHWjKsDKjzX3YJP95VvVW9zA?tab=Overview
entry_repay
This function allows a user to repay a specified amount of a loan. The repayment amount is added to the pool's balance, and the repay event is emitted.
example: https://suivision.xyz/txblock/6uNqkQUK5WBALuaTwdv31ZfqzVTCqAqAX56gwqq5LoPS?tab=Overview
Claim_reward
This functio allows users to claim rewards of a specified amount. Rewards are given from the bonus pool and and the claim reward event is emitted.
Entry_liquidation
This function is used to liquidate a loan when a borrower's collateral is insufficient to cover their debt. The liquidation process involves repaying the debt, and any excess amount is returned to the sender. The collateral is also sold to cover the debt, and any remaining collateral is returned to the treasury. The liquidation call event is emitted.
Non-entry Functions
withdraw
This function allows other contracts to withdraw a specified amount from a lending pool. The withdrawal amount is deducted from the pool's balance, and the withdrawal event is emitted.
borrow
This function allows other contracts to borrow a specified amount from a lending pool. The borrowed amount is deducted from the pool's balance, and the borrow event is emitted.
repay
This function allows other contracts to repay a specified amount of a loan. The repayment amount is added to the pool's balance, and the repay event is emitted.
Last updated