The frontend helper contract is used to make it easy for frontends or other contracts to provide liquidity and lock the LP for incentives with a single message.
Once users have provided liquidity on WW pools via the pair contract, there is an additional step to lock the LP tokens for incentives in the incentive contract of the pool they provided liquidity to. These two actions are separate, so in a normal scenario, the user would need to first provide liquidity and then lock it, effectively signing two separate transactions.
The frontend helper allows users to do this in a single transaction, by providing liquidity and locking it for incentives via the deposit message.
The following are the messages that can be executed on the frontend helper contract:
Instantiates the frontend helper.
{
"incentive_factory": "migaloo1..."
}
Key | Type | Description |
---|---|---|
incentive_factory |
String | Address of the incentive factory |
Migrates the frontend helper. This is to be triggered by the owner.
{}
Deposits assets into a pair pool and opens or expands a position on the respective incentive contract with the received LP tokens.
{
"deposit": {
"pair_address": "migaloo1...",
"assets": [
{
"info": {
"native_token": {
"denom": "uusdc"
}
},
"amount": "1000"
},
{
"info": {
"native_token": {
"denom": "ibc/B3504E092456BA618CC28AC671A71FB08C6CA0FD0BE7C8A5B5A3E2DD933CC9E4"
}
},
"amount": "1000"
}
],
"slippage_tolerance": "0.01",
"unbonding_duration": 86400
}
}
Key | Type | Description |
---|---|---|
pair_address |
String | Address of the pair to provide liquidity to |
assets |
[Asset; 2] | Assets to provide liquidity with |
slippage_tolerance |
Option<Decimal> | If set, the transaction will succeed if the price in the pool moves less than the given slippage tolerance |
unbonding_duration |
u64 | The amount of time in seconds to unbond tokens for when incentivizing |
Updates the configuration of the frontend helper.
{
"update_config": {
"owner": "migaloo1...",
"incentive_factory_addr": "migaloo1..."
}
}
Key | Type | Description |
---|---|---|
owner |
Option<String> | New owner of the contract |
incentive_factory_addr |
Option<String> | New incentive factory address |
Retrieves the configuration of the frontend helper.
{% tabs %} {% tab title="Query" %}
{
"config": {}
}
{% endtab %}
{% tab title="Response (ConfigResponse)" %}
{
"owner": "migaloo1...",
"incentive_factory_addr": "migaloo1..."
}
Key | Type | Description |
---|---|---|
owner |
Addr | The contract's owner |
incentive_factory_addr |
Addr | The incentive factory contract address |
{% endtab %} {% endtabs %}