Axel - DeFi Protocols Integration

Demo to preview the settings

Introduction

This plugin enables you to easily integrate all of DeFi into your application within minutes.
It supports the top DeFi applications on the blockchain like Aave, Compound, Uniswap, Sushiswap, Quickswap, Lido, Rocket Pool, Ribbon, and Yearn.
You can Lend, Borrow, Yield, Stake or Swap ETH and USDC tokens on any supported protocol.
The current list of supported protocols can be found here.
Transactions performed by our plugin are tested using the Hardhat development environment according to Axel's guide.

Prerequisites

To use the plugin, you must register and get an access key on Axel dev.
Image without caption

How to setup

  1. Go to https://axel.dev/.
  1. Click "Get API Keys”.
    1. Image without caption
  1. Enter your first and last name.
    1. Image without caption
  1. Enter your telegram handle.
    1. Image without caption
  1. Enter your Email.
    1. Image without caption
  1. Enter your job title.
    1. Image without caption
  1. Enter your company name.
    1. Image without caption
  1. Enter your website.
    1. Image without caption
  1. Tell us how you integrate DeFi.
    1. Image without caption
  1. Select protocols.
    1. Image without caption
  1. Choose a blockchain.
    1. Image without caption
  1. The API key must come to the specified email.
    1. Image without caption
  1. Insert the received API key into the plugin settings.
    1. Image without caption

API Calls

Plugin Data Calls

  1. Protocols - Get a list of protocols that the Axel API supports.
Parameters:
Title
Type
Description
chain
string
The chain to filter protocols by.
filter protocols
string
Describes the action to filter protocols by: lend, unlend, borrow, unborrow, stake, deposit, undeposit, or exchange.
Returns:
Title
Type
Description
status
string
Request execution status: "success" or "error".
protocols
array
List of protocols
  1. Tokens - Get a list of tokens that the Axel API supports.
Returns:
Title
Type
Description
status
string
Request execution status: "success" or "error".
tokens
array
List of supported tokens.
redemption_tokens
array
List of supported wrapped tokens.
  1. Balance - Get the balance of a token in a particular user's wallet.
Parameters:
Title
Type
Description
wallet_address
string
The wallet address for which you'd like to pull the balance.
token
string
The token denomination for the balance you're pulling.
chain
string
The chain on which you'd like to pull the balance.
Returns:
Title
Type
Description
status
string
Request execution status: "success" or "error".
balance
number
Balance of a token in a particular user's wallet
  1. Apy lend - Return all estimated APYs for a given lending protocol.
Parameters:
Title
Type
Description
protocol
string
The name of the lending protocol to pull the supply APY from.
token
string
The token denomination for the supply APY you're pulling.
chain
string
The chain on which you'd like to pull the supply APY.
Returns:
Title
Type
Description
status
string
Request execution status: "success" or "error".
apy
number
APYs for a given lending protocol.
  1. Apy borrow - Get the borrow APY for a specific lending protocol with a specific supplied token.
Parameters:
Title
Type
Description
protocol
string
The name of the lending protocol to pull the borrow APY from.
token
string
The token denomination for the supply APY you're pulling.
chain
string
The chain on which you'd like to pull the borrow APY.
Returns:
Title
Type
Description
status
string
Request execution status: "success" or "error".
apy
number
Borrow APY for a specific lending protocol with a specific supplied token
  1. Apy stake - Get the staking APY for a specific Eth2.0 staking protocol with the Ethereum (ETH) token.
Parameters:
Title
Type
Description
protocol
string
The name of the Eth2.0 staking protocol to pull the staking APY from.
chain
string
The chain on which you'd like to pull the staking APY.
Returns:
Title
Type
Description
status
string
Request execution status: "success" or "error".
apy
number
Staking APY for a specific Eth2.0 staking protocol with the Ethereum (ETH) token.
  1. Apy yield - Get the yield APY for a specific Eth2.0 staking protocol with a specific supplied token.
Parameters:
Title
Type
Description
protocol
string
The name of the yield protocol to pull the yield APY from.
token
string
The token denomination for the yield APY you're pulling.
chain
string
The chain on which you'd like to pull the yield APY.
Returns:
Title
Type
Description
status
string
Request execution status: "success" or "error".
apy
number
Yield APY for a specific Eth2.0 staking protocol with a specific supplied token
  1. Gas price - Get the most up-to-date gas price for a given gas_priority on a specific chain. The gas price is denominated in Gwei (1 ETH = 1,000,000,000 Gwei).
Parameters:
Title
Type
Description
gas_priority
number
Number between 0-2, representing how much gas one is willing to spend in order to make a transaction settle quicker. 0 is the lowest gas priority (longest transaction settlement time), 2 is the highest gas priority (shortest transaction settlement time), and all values in between are interpolated.
chain
string
The chain on which you'd like to pull the gas price from.
Returns:
Title
Type
Description
status
string
Request execution status: "success" or "error".
gas_price
number
Gas price
  1. Swap rate - Get the most up-to-date amount of buy_token returned by swapping one sell_token.
Parameters:
Title
Type
Description
chain
string
The chain on which you'd like to pull the gas price from.
sell_token
string
The name of the token that the user "sells", or gives away, for the corresponding buy_token.
buy_token
string
The name of the token that the user "buys", or receives, in exchange for the corresponding sell_token.
slippage_percentage
number
The amount of slippage  you're willing to undertake in your trade, specified as a whole number percentage. If not specified, the slippage is automatically set to 1%.
Returns:
Title
Type
Description
status
string
Request execution status: "success" or "error".
market_swap_rate
number
Market swap rate
guaranteed_swap_rate
number
Guaranteed swap rate

Plugin Action Calls

  1. Auth ping - Check the functionality of the API key.
Returns:
Title
Type
Description
status
string
Request execution status: "success" or "error".
  1. Lend - Lend on the blockchain by getting the transaction data to lend on any specific lending protocol.
Fields:
Title
Type
Description
chain
string
The chain on which the user lends on.
token
string
The name of the token to lend.
wallet_address
string
The user's wallet address that you'd like to lend for.
amount
number
The amount of token the user is lending.
protocol
string
The name of the lending protocol to lend on.
Returns:
Title
Type
Description
status
string
Request execution status: "success" or "error".
rpc_requests
array
An array of transaction data. method(string) - transaction method, params(string) - transaction parameters.
  1. Unlend - Unlend (withdraw) on the blockchain by getting the transaction data to withdraw from any specific lending protocol.
Fields:
Title
Type
Description
chain
string
The chain on which the user withdraws from.
token
string
The name of the token to withdraw.
wallet_address
string
The user's wallet address that you'd like to withdraw for.
amount
number
The amount of token the user is withdrawing.
protocol
string
The name of the lending protocol to withdraw from.
Returns:
Title
Type
Description
status
string
Request execution status: "success" or "error".
rpc_requests
array
An array of transaction data. method(string) - transaction method, params(string) - transaction parameters.
  1. Borrow - Borrow on the blockchain by getting the transaction data to borrow on any specific lending protocol.
Fields:
Title
Type
Description
chain
string
The chain on which the user borrows on.
token
string
The name of the token to borrow.
wallet_address
string
The user's wallet address that you'd like to borrow for.
amount
number
The amount of token the user is borrowing.
protocol
string
The name of the lending protocol to borrow on.
Returns:
Title
Type
Description
status
string
Request execution status: "success" or "error".
rpc_requests
array
An array of transaction data. method(string) - transaction method, params(string) - transaction parameters.
  1. Unborrow - Unborrow (repay) on the blockchain by getting the transaction data to repay on any specific lending protocol.
Fields:
Title
Type
Description
chain
string
The chain on which the user repays on.
token
string
The name of the token to repay.
wallet_address
string
The user's wallet address that you'd like to repay for.
amount
number
The amount of token the user is repaying.
protocol
string
The name of the lending protocol to repay on.
Returns:
Title
Type
Description
status
string
Request execution status: "success" or "error".
rpc_requests
array
An array of transaction data. method(string) - transaction method, params(string) - transaction parameters.
  1. Stake - Stake on the blockchain by getting the transaction data to stake on any specific Eth2.0 staking protocol with the Ethereum (ETH) token.
Fields:
Title
Type
Description
chain
string
The chain on which the user stakes on.
wallet_address
string
The user's wallet address that you'd like to stake for.
amount
number
The amount of token the user is staking.
protocol
string
The name of the Eth2.0 staking protocol to stake on.
Returns:
Title
Type
Description
status
string
Request execution status: "success" or "error".
rpc_requests
array
An array of transaction data. method(string) - transaction method, params(string) - transaction parameters.
  1. Yeld - Deposit on the blockchain by getting the transaction data to deposit on any specific yield protocol.
Fields:
Title
Type
Description
chain
string
The chain on which the user deposits on.
token
string
The name of the token to deposit.
wallet_address
string
The user's wallet address that you'd like to deposit for.
amount
number
The amount of token the user is depositing.
protocol
string
The name of the yield protocol to deposit on.
Returns:
Title
Type
Description
status
string
Request execution status: "success" or "error".
rpc_requests
array
An array of transaction data. method(string) - transaction method, params(string) - transaction parameters.
  1. Unyield - Undeposit (withdraw) on the blockchain by getting the transaction data to withdraw from any specific yield protocol.
Fields:
Title
Type
Description
chain
string
The chain on which you'd withdraw from.
token
string
The name of the token to withdraw.
wallet_address
string
The user's wallet address that you'd like to withdraw from.
amount
number
The amount of token the user is withdrawing.
protocol
string
The name of the yield protocol to withdraw from.
prior_rpc_responses
json
See the What is prior_rpc_responses?  guide on how to supply to this parameter. The default value for the initial call is an empty array.
Returns:
Title
Type
Description
status
string
Request execution status: "success" or "error".
rpc_requests
array
An array of transaction data. method(string) - transaction method, params(string) - transaction parameters.
  1. Swap - Swap on the blockchain by getting the transaction data to swap on any specific decentralized exchange, or leverage our swap aggregation ("protocol": "auto" ) to split your trade across multiple decentralized exchanges for an optimized trade.
Fields:
Title
Type
Description
chain
string
The chain on which the user exchanges on.
wallet_address
string
The end user's wallet address that you'd like to exchange for.
protocol
string
The name of the decentralized exchange protocol to exchange on. Inputting "auto"  enables you to use Axel's tailored, optimized swap aggregator API (aka auto-routing ) to split your trade across DEXes for the most optimized exchange.
sell_token
string
The name of the token that the user "sells", or gives away, for the corresponding buy_token.
buy_token
string
The name of the token that the user "buys", or receives, in exchange for the corresponding sell_token.
sell_amount
number
The amount of token the user is "selling" for the corresponding buy_token.
slippage_percentage
number
The amount of slippage  you're willing to undertake in your trade, specified as a whole number percentage. If not specified, the slippage is automatically set to 1%.
Returns:
Title
Type
Description
status
string
Request execution status: "success" or "error".
rpc_requests
array
An array of transaction data. method(string) - transaction method, params(string) - transaction parameters.

Workflow example

This workflow shows how to add steps to exchange ETH to USDC and vice versa on the "Ethereum" chain.
Image without caption
  1. Add inputs to enter "sell_amount" and output the resulting exchange result and add dropdowns to select "sell_token" and "buy_token"
Image without caption
  1. Set up the input of the received amount as a result of the exchange. Use the swap rate from the "swap_rate" data call by specifying the necessary parameters. In the input field "Initial content", configure the display of the received result.
Image without caption
  1. Add Gas fee using the "gas price" data call and formatting it.
Image without caption
  1. Configure the workflow to send the transaction when the "Exchange" button is clicked.
Use the action call "swap" to configure the transaction parameters, passing the values of inputs and dropdowns.
Image without caption
Image without caption

Changelogs