DEFI Actions
Yield farming across DeFi third-party protocol platforms instantly interact with Nimbus.
Value of the API
-
Instant Interaction: These APIs allow developers to quickly prepare and execute transactions with third-party DeFi protocols without needing to understand the underlying complexities of each protocol.
-
Standardization: By providing a standardized way to prepare transaction fields and generate payloads, these APIs reduce the risk of errors and improve the efficiency of integrating with multiple DeFi protocols.
-
Flexibility: Developers can easily switch between different protocols and action types, making it easier to build versatile DeFi applications that can interact with various services.
-
Enhanced User Experience: These APIs streamline the user experience by automating the preparation of transaction fields and payloads. This allows users to focus on their investment strategies rather than the technical details of transaction construction.
How to use?
1. Prepare Transaction Fields for DEFI Actions
-
Endpoint:
/v2/farming/tx/prepare
-
Description: This API prepares the necessary transaction fields required for various DeFi actions based on the specified protocol and action type. It ensures that the client knows what parameters are needed for the transaction.
-
Usage:
The response will provide the necessary fields to be included in the transaction payload.
2. Get Transaction Payload for DEFI Actions
-
Endpoint:
/v2/farming/tx/payload
-
Description: This API generates the transaction payload based on the operation type and parameters provided. It uses the required fields determined by the
/v2/farming/tx/prepare
API. -
Usage:
The response will provide the transaction payload that can be sent to the blockchain for execution.
3. Execute Transaction Payload for DEFI Actions
-
Description: Sign and Execute Transaction from API generates transaction payload.
-
Usage:
4. Supported Protocol Types and Actions
The following protocols and actions are currently supported by the API:
-
Supported Protocols
alpha-fi
navi
scallop
suilend
native-staking
-
Supported Actions
LENDING
: Borrowing assets from a liquidity pool.BORROW
: Taking a loan against collateral.REPAY
: Paying back a borrowed amount.ADD_LP
: Adding liquidity to a liquidity pool.REMOVE_LP
: Removing liquidity from a liquidity pool.STAKING
: Locking assets to earn rewards.UNSTAKING
: Unlocking staked assets.LENDING_WITHDRAW
: Withdrawing lent assets from a pool.