API Reference

Execute a DeFi transaction

Execute the selected action on the specified pool against the mainnet fork provided by Valha.

Log in to see full request history
Path Params
string
required
Defaults to ethereum

The blockchain that will be used for this request.

string
required
Defaults to 0xdf0770df86a8034b3efef0a1bb3c889b8332ff56

The address of the pool that will be used for this request.

string
required
Defaults to deposit

The address of the pool that will be used for this request.

Body Params

The API will get the transactions to execute from Valha software to interact with the specified pool (as explained in the Interactions API Reference) and will execute them against the selected fork. It will return the receipt of the transactions from the chain (information about receipt: https://docs.ethers.org/v5/api/providers/types/#providers-TransactionReceipt).

PLEASE make sure that your provided wallet has the authorization to execute this transaction (right amount of token, whitelisting etc.).

string
required
Defaults to 0x45E954acf1Efc374478dF69B45f12AEFD8AE51a3
number
Defaults to 20
tokens
array of strings

Please specify the addresses of the underlying tokens in the same order as the amounts.

tokens
amounts_desired
array of numbers
amounts_desired
amounts_minimum
array of numbers
amounts_minimum
boolean
Defaults to true

If selected to true, the API will not check if the provided user's address has enought token to perform the action.

boolean
Defaults to false

If selected to true, the API will put the maximum amount for the approval action.

boolean
Defaults to false

BETA FEATURE (only Ethereum, Polygon and Arbitrum chains for now) - If selected to true, the API will return the gas limit necessary for the action.

bridge
object

BETA FEATURE - If you want to do a crosschain deposit, you must specify the information from the origin chain, token and the amount to be received.

boolean
Defaults to false

BETA FEATURE - If selected to true, the API will return the estimation of token you will receive with this action in a specific "estimate" object. Be careful, this option changes the return type of the API to have two objects: "estimate" and "transactions".

boolean
Defaults to false

BETA FEATURE - If selected to true, the API will return the estimation of rewards you will receive with this action in a specific "estimate" object and the gas cost of the action (from approval to the action). Be careful, this option changes the return type of the API to have two objects: "estimate" and "transactions".

ranges
array of strings

Necessary only if you want to specify the range in which you deposit (ex.: Uniswap v3, Atlendis, etc)

ranges
string

It can be an address or an id number.

string

Please specify the address, the string or the referral number you want to specify into the action. This referral code will be provided to the protocol for the action.

string

The address that should receive affiliate fees specified in the fee parameters.

number

The percentage (denoted as a decimal between 0 - 1.0 where 1.0 represents 100% and 0.01 represents 1%) of the amount that should be attributed to fee_recipient as affiliate fees.

Responses

Language
Credentials
Click Try It! to start a request and see the response here! Or choose an example:
application/json