1ī¸Lending Core
The core entry of NAVI Protocol.
As a developer, your primary interactions with the NAVI Protocol will occur through the functions within the lending_core::incentive_v2
module. This module acts as the gateway for all write transactions, including deposits, withdrawals, borrowing, repayment, liquidations, and reward claims
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 function allows users to claim rewards of a specified pool. 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 liquidation call event is emitted.
Non-entry Functions
deposit_with_account_cap
This function allows a user to deposit a specified amount of a certain coin type into a lending pool with an account cap. The deposit amount is then added to the pool's balance, and the deposit event is emitted.
withdraw
This function allows other contracts to withdraw a specified amount from a lending pool. Balance object will be returned. The withdrawal amount is deducted from the pool's balance, and the withdrawal event is emitted.
withdraw_with_account_cap
This function allows users to withdraw a specified amount from a lending pool with an account cap. Balance object will be returned. 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. Balance object will be returned. The borrowed amount is deducted from the pool's balance, and the borrow event is emitted.
borrow_with_account_cap
This function allows other contracts to borrow a specified amount from a lending pool with an account cap. Balance object will be returned. 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. Balance object will be returned. The repayment amount is added to the pool's balance, and the repay event is emitted.
repay_with_account_cap
This function allows other contracts to repay a specified amount of a loan with an account cap. Balance object will be returned. The repayment amount is added to the pool's balance, and the repay event is emitted.
claim_reward_non_entry
This function allows users to claim rewards of a specified amount. Rewards are given from the bonus pool and and the claim reward event is emitted. Balance object will be returned.
claim_reward_with_account_cap
This function allows users to claim rewards of a specified amount with an account cap. Rewards are given from the bonus pool and and the claim reward event is emitted. Balance object will be returned.
Last updated