Yield Aggregator
Provides connectivity across the various Yield Aggregator protocols.
Following are the common functions implemented for all the Yield Aggregator protocols:-
Get balance of the user in a given Vault or Pool (harvest finance).
Get the number of the vaults along with the respective vault APY.
Trigger the deposit transaction for the given vault.
Trigger the deposit transaction for the given pool.
Trigger the withdraw transaction for the given vault.
Trigger the withdraw transaction for the given pool.
Yearn Finance
/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
Remote procedural call URL.
Public Address of the owner.
The number of the vault, incase there are multiple vaults.
The address of the vault.
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
{
"status": 200,
"msg": "success",
"data": {
"vaultBalance": "0"
}
}
/getvaults
Get the number of the vaults along with the respective vault APY.
GET
https://api.expand.network/yieldaggregator/getvaults
Query Parameters
Remote procedural call URL
https://api.expand.network/yieldaggregator/getvaults?tokenAddress=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2&yieldAggregatorId=5000
{
"status": 200,
"msg": "success",
"data": {
"tokenVaults": [
{
"vaultAddress": "0xa9fE4601811213c340e850ea305481afF02f5b28",
"apy": "3.90",
"vaultNumber": 0
},
{
"vaultAddress": "0xa258C4606Ca8206D8aA700cE2143D7db854D168c",
"apy": "0.54",
"vaultNumber": 1
}
]
}
}
/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
The amount of token to deposit.
The address of the token.
Address of the sender of the token.
Maximum gas limit provided by the sender, for the transaction.
The number of the vault, in case there are multiple vaults.
The address of the vault.
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"
}
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"to": "0xa258C4606Ca8206D8aA700cE2143D7db854D168c",
"value": "0",
"gas": "2307200",
"data": "0xb6b55f25000000000000000000000000000000000000000000000000000000000007a120"
}
}
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"
}
With gasPriority-
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
"to": "0xa258C4606Ca8206D8aA700cE2143D7db854D168c",
"value": "0",
"gas": "144259",
"data": "0xb6b55f2500000000000000000000000000000000000000000000000000000002540be400"
}
}
/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
Address of the withdrawer of the token.
Maximum gas limit provided by the sender, for the transaction.
The number of the vault, in case there are multiple vaults.
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"
}
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"to": "0xa258C4606Ca8206D8aA700cE2143D7db854D168c",
"value": "0",
"gas": "2307200",
"data": "0x2e1a7d4d00000000000000000000000000000000000000000000000000000000004a7b9e"
}
}
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"
}
With gasPriority-
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
"to": "0xa258C4606Ca8206D8aA700cE2143D7db854D168c",
"value": "0",
"gas": "139073",
"data": "0x2e1a7d4d0000000000000000000000000000000000000000000000000000000000989680"
}
}
Harvest Finance
/getbalance
For /getbalance, the user can either pass the tokenAddress or the vaultAddress and poolAddress along with the required parameters.
Get balance of the user in a given Vault or Pool
GET
https://api.expand.network/yieldaggregator/getbalance
Query Parameters
Remote procedural call URL
Public Address of the owner.
The address of the token.
The address of the vault.
With tokenAddress:
https://api.expand.network/yieldaggregator/getbalance?address=0xC7565379C190014449eE83CF9FD7475206E59f9e&tokenAddress=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2&yieldAggregatorId=5100
With vaultAddress and poolAddress:
https://api.expand.network/yieldaggregator/getbalance?address=0xC7565379C190014449eE83CF9FD7475206E59f9e&vaultAddress=0xFE09e53A81Fe2808bc493ea64319109B5bAa573e&yieldAggregatorId=5100&poolAddress=0x3DA9D911301f8144bdF5c3c67886e5373DCdff8e
{
"status": 200,
"msg": "success",
"data": {
"vaultBalance": "0",
"poolBalance": "0"
}
}
/getvaults
Get the number of the vaults along with the respective vault APY.
GET
https://api.expand.network/yieldaggregator/getvaults
Query Parameters
Remote procedural call URL
The address of the token.
https://api.expand.network/yieldaggregator/getvaults?tokenAddress=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2&yieldAggregatorId=5100
{
"status": 200,
"msg": "success",
"data": {
"tokenVaults": [
{
"vaultAddress": "0xFE09e53A81Fe2808bc493ea64319109B5bAa573e",
"apy": "4.08",
"poolAddress": "0x3DA9D911301f8144bdF5c3c67886e5373DCdff8e"
}
]
}
}
/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
The amount of token to deposit.
The address of the token.
Address of the sender of the token.
Maximum gas limit provided by the sender, for the transaction.
The address of the vault.
With tokenAddress:
{
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"tokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"amount": "500000",
"gas": "2307200",
"yieldAggregatorId": "5100"
}
With vaultAddress:
{
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"vaultAddress": "0xFE09e53A81Fe2808bc493ea64319109B5bAa573e",
"amount": "500000",
"gas": "2307200",
"yieldAggregatorId": "5100"
}
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"to": "0xFE09e53A81Fe2808bc493ea64319109B5bAa573e",
"value": "0",
"gas": "2307200",
"data": "0xb6b55f25000000000000000000000000000000000000000000000000000000000007a120"
}
}
With gasPriority (medium)-
1. With tokenAddress:
{
"from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
"tokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"amount": "10000000",
"gas": "2307200",
"gasPriority":"medium",
"yieldAggregatorId": "5100"
}
2. With vaultAddress:
{
"from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
"vaultAddress": "0xFE09e53A81Fe2808bc493ea64319109B5bAa573e",
"amount": "500000",
"gas": "2307200",
"gasPriority":"medium",
"yieldAggregatorId": "5100"
}
With gasPriority-
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
"to": "0xFE09e53A81Fe2808bc493ea64319109B5bAa573e",
"value": "0",
"gas": "155912",
"data": "0xb6b55f250000000000000000000000000000000000000000000000000000000000989680"
}
}
/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
Address of the withdrawer of the token.
Maximum gas limit provided by the sender, for the transaction.
The address of the the token.
The address of the vault.
With tokenAddress:
{
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"tokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"amount": "500000",
"gas": "2307200",
"yieldAggregatorId": "5100"
}
With vaultAddress:
{
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"amount": "4934226",
"gas": "2307200",
"vaultAddress": "0xFE09e53A81Fe2808bc493ea64319109B5bAa573e",
"yieldAggregatorId": "5100"
}
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"to": "0xFE09e53A81Fe2808bc493ea64319109B5bAa573e",
"value": "0",
"gas": "2307200",
"data": "0x2e1a7d4d00000000000000000000000000000000000000000000000000000000004b4a52"
}
}
With gasPriority (medium)-
1. With tokenAddress:
{
"from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
"tokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"amount": "500000",
"gas": "2307200",
"gasPriority":"medium",
"yieldAggregatorId": "5100"
}
2. With vaultAddress:
{
"from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
"vaultAddress": "0xFE09e53A81Fe2808bc493ea64319109B5bAa573e",
"amount": "500000",
"gas": "2307200",
"gasPriority":"medium",
"yieldAggregatorId": "5100"
}
With gasPriority
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
"to": "0xFE09e53A81Fe2808bc493ea64319109B5bAa573e",
"value": "0",
"gas": "127728",
"data": "0x2e1a7d4d000000000000000000000000000000000000000000000000000000000007a120"
}
}
/depositpool
For /depositpool, the user can either pass the tokenAddress or the poolAddress along with the required parameters.
Trigger the deposit transaction for the given pool.
POST
https://api.expand.network/yieldaggregator/depositpool
Request Body
The amount of token to deposit.
Address of the sender of the token.
Maximum gas limit provided by the sender, for the transaction.
The address of the token.
With tokenAddress:
{
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"tokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"amount": "4934226",
"gas": "2307200",
"yieldAggregatorId": "5100"
}
With poolAddress:
{
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"poolAddress": "0x3DA9D911301f8144bdF5c3c67886e5373DCdff8e",
"amount": "4934226",
"gas": "2307200",
"yieldAggregatorId": "5100"
}
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"to": "0x3DA9D911301f8144bdF5c3c67886e5373DCdff8e",
"value": "0",
"gas": "2307200",
"data": "0xa694fc3a00000000000000000000000000000000000000000000000000000000004b4a52"
}
}
With gasPriority (low)
1. With tokenAddress:
{
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"tokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"amount": "4934226",
"gas": "230720",
"gasPriority": "low",
"yieldAggregatorId": "5100"
}
2. With poolAddress:
{
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"poolAddress": "0x3DA9D911301f8144bdF5c3c67886e5373DCdff8e",
"amount": "4934226",
"gas": "230720",
"gasPriority": "low",
"yieldAggregatorId": "5100"
}
With gasPriority (low):
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"to": "0x3DA9D911301f8144bdF5c3c67886e5373DCdff8e",
"value": "0",
"gas": "11926",
"data": "0xa694fc3a00000000000000000000000000000000000000000000000000000000004b4a52"
}
}
/withdrawpool
For /withdrawpool, the user can either pass the tokenAddress or the poolAddress along with the required parameters.
Trigger the withdraw transaction for the given pool.
POST
https://api.expand.network/yieldaggregator/withdrawpool
Request Body
Address of the withdrawer of the token.
Maximum gas limit provided by the sender, for the transaction.
The address of the token.
With tokenAddress:
{
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"amount": "4934226",
"gas": "2307200",
"tokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"yieldAggregatorId": "5100"
}
With poolAddress:
{
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"poolAddress": "0x3DA9D911301f8144bdF5c3c67886e5373DCdff8e",
"amount": "4934226",
"gas": "2307200",
"yieldAggregatorId": "5100"
}
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"to": "0x3DA9D911301f8144bdF5c3c67886e5373DCdff8e",
"value": "0",
"gas": "2307200",
"data": "0x2e1a7d4d00000000000000000000000000000000000000000000000000000000004b4a52"
}
}
With gasPriority (medium)
1. With tokenAddress:
{
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"amount": "4934226",
"gas": "230720",
"gasPriority": "medium",
"tokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"yieldAggregatorId": "5100"
}
2. With poolAddress:
{
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"amount": "4934226",
"gas": "230720",
"gasPriority": "medium",
"poolAddress": "0x3DA9D911301f8144bdF5c3c67886e5373DCdff8e",
"yieldAggregatorId": "5100"
}
With gasPriority (medium)
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"to": "0x3DA9D911301f8144bdF5c3c67886e5373DCdff8e",
"value": "0",
"gas": "229110",
"data": "0x2e1a7d4d00000000000000000000000000000000000000000000000000000000004b4a52"
}
}