Nexera-FiInterfaces
IAdapter
Basic interface for Nexera-Fi Adapters.
Enums
Operation
Defines the various generic operations that Adapters can conduct:
DEPOSIT: For adding liquidity to DeFi ProtocolsWITHDRAW: For removing liquidity from DeFi ProtocolsSWAP: For performing token swaps against PoolsCOLLECT: For collecting generated fees and rewardsOPERATE: For protocol-specific interactions
Structs
TokenAmount
Defines data for an individual token composition.
Members
| Name | Type | Description |
|---|---|---|
token | address | The address of the target token: - address(0) signifies blockchain native currency.- non-zero address signifies ERC-20 compatible token. |
amount | uint256 | The amount of the target token |
Functions
executeAction
Executes an operation-related action on a 3rd party service (DEX, Liquidity Pool, etc).
Parameters
| Name | Type | Description |
|---|---|---|
op | IAdapter.Operation | Enum key representing the operation |
out | IAdapter.TokenAmount[] | Array of TokenAmount structs defining the token compositions to send |
expectedIn | IAdapter.TokenAmount[] | Array of TokenAmount structs defining the expected token compositions to receive |
extraData | bytes | Extra ABI encoded data specific to the Adapter, required for the operation action |
Returns
| Name | Type | Description |
|---|---|---|
actualIn | IAdapter.TokenAmount[] | Array of TokenAmount structs defining the token compositions actually received |
initialize
Virtual intialization function for Adapters.
Developers should override this function to appropriately initialize their Adapter implementation.
Parameters
| Name | Type | Description |
|---|---|---|
initData | bytes | ABI encoded initialization data |

