Yearn Finance V2

Supported Chains

Available on Ethereum, Arbitrum, Base and Optimism

Available Endpoints:

Click on the endpoint to jump to the section with full details

  • /getbalanceGET -Get balance of the user in a given Vault.

  • /getvaultsGET - Get the number of the vaults along with the respective vault APY.

  • /depositvault GET - Trigger the deposit transaction for the given vault.

  • /withdrawvault POST - Trigger the withdraw transaction for the given vault.

Yield Aggregator IDs

Many endpoints have a parameter where you can provide a lendborrow ID.

Endpoint Details

/getbalance

For /getbalance, the user can either pass the vaultAddress or the tokenAddress and the vaultNumber along with the required parameters.

Get balance of the user in a given Vault.

GET https://api.expand.network/yieldaggregator/getbalance

Query Parameters

With tokenAddress:

https://api.expand.network/yieldaggregator/getbalance?address=0xC7565379C190014449eE83CF9FD7475206E59f9e&tokenAddress=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2&yieldAggregatorId=5000

With VaultAddress:

https://api.expand.network/yieldaggregator/getbalance?address=0x6Fb447Ae94F5180254D436A693907a1f57696900&yieldAggregatorId=5000&vaultAddress=0xa9fE4601811213c340e850ea305481afF02f5b28

/getvaults

Get the number of the vaults along with the respective vault APY.

GET https://api.expand.network/yieldaggregator/getvaults

Query Parameters

https://api.expand.network/yieldaggregator/getvaults?tokenAddress=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2&yieldAggregatorId=5000

/depositvault

For /depositvault, the user can either pass the tokenAddress or the vaultAddress along with the required parameters.

Trigger the deposit transaction for the given vault.

POST https://api.expand.network/yieldaggregator/depositvault

Request Body

With tokenAddress:

{
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "tokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
    "amount": "500000",
    "vaultNumber": "1",
    "yieldAggregatorId": "5000",
    "gas": "2307200" 
}

With VaultAddress:

{
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "vaultAddress":"0xa258C4606Ca8206D8aA700cE2143D7db854D168c",
    "amount": "500000",
    "yieldAggregatorId": "5000",
    "gas": "2307200"
}

With gasPriority (medium)-

1. With tokenAddress:

{
    "from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
    "tokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
    "amount": "10000000000",
    "vaultNumber": "1",
    "yieldAggregatorId": "5000",
    "gas": "2307200",
    "gasPriority":"medium"
}

2. With VaultAddress:

{
    "from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
    "vaultAddress":"0xa258C4606Ca8206D8aA700cE2143D7db854D168c",
    "amount": "500000",
    "yieldAggregatorId": "5000",
    "gas": "2307200",
    "gasPriority":"medium"
}

/withdrawvault

For /withdrawvault, the user can either pass the tokenAddress or the vaultAddress along with the required parameters.

Trigger the withdraw transaction for the given vault.

POST https://api.expand.network/yieldaggregator/withdrawvault

Request Body

With tokenAddress:

{
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "tokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
    "amount": "4881310",
    "gas": "2307200",
    "vaultNumber": "1",
    "yieldAggregatorId": "5000"
}

With vaultAddress:

{
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "vaultAddress": "0xa258C4606Ca8206D8aA700cE2143D7db854D168c",
    "amount": "4881310",
    "gas": "2307200",
    "yieldAggregatorId": "5000" 
}

With gasPriority (high)-

1. With tokenAddress:

{
    "from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
    "tokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
    "amount": "10000000",
    "gas": "2307200",
    "gasPriority":"high",
    "vaultNumber": "1",
    "yieldAggregatorId": "5000"
}

2. With VaultAddress:

{
    "from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
    "vaultAddress": "0xa258C4606Ca8206D8aA700cE2143D7db854D168c",
    "amount": "4881310",
    "gas": "2307200",
    "gasPriority":"high",
    "yieldAggregatorId": "5000"
}

Last updated