Auto Position Creator Smart Contract (1.0.0)
Download OpenAPI specification:Download
The Auto Position Creator Smart Contract simplifies the process of interacting with liquidity pools and farm staking on the Bitcoin.me DeFi. It allows users to utilize any token to enter a liquidity pool or a farm staking position seamlessly.
The Auto Position Creator contract provides:
- Multi-Token Entry: Supports creating positions using a single token
- Automated Swaps: Automatically performs the required token swaps to acquire liquidity pool tokens
- Seamless Farm Staking: Facilitates direct entry into farm staking positions
- LP Position Creation: Creates liquidity pool positions from a single token
Create LP Position from Single Token
Creates a liquidity pool position using a single token. The contract swaps the token into the required pair tokens and adds liquidity to the specified pool.
Process:
- User sends a single token as payment
- Contract performs swap operations to acquire both tokens needed for the LP
- Liquidity is added to the specified pair
- LP tokens are returned to the user
Swap Operations Structure: Each swap operation in the list contains:
address: Address of the token pair for the swapmethod: Swap method (swapTokensFixedInputorswapTokensFixedOutput)token_identifier: Identifier of the output tokenmin_amount_out: Minimum output amount of the token
Payment: Any token listed in the DeFi
Request Body schema: application/jsonrequired
| scAddress required | string Auto Position Creator contract address |
| funcName required | string Value: "createLpPosFromSingleToken" |
| args required | Array of strings Arguments:
|
| value required | string Token payment to use for creating the LP position |
Responses
Request samples
- Payload
{- "scAddress": "klv1qqqqqqqqqqqqqpgqxyz...",
- "funcName": "createLpPosFromSingleToken",
- "args": [
- "address:klv1qqqqqqqqqqqqqpgqk762znj9v7nyky3wucdcw9awz83ppqy6c0nqhe2qaz",
- "BigUint:4500000",
- "BigUint:4500000",
- "address:klv1qqqqqqqqqqqqqpgqlequ2zkergzrpzh5nzadduh0r80qau7mc0nqtwx8hz",
- "string:swapTokensFixedInput",
- "string:KFI",
- "BigUint:4500000"
], - "value": "KLV=10000000"
}Response samples
- 200
{- "data": {
- "returnData": [
- "string"
], - "returnCode": "string",
- "returnMessage": "string"
}, - "error": "string",
- "code": "string"
}Create Farm Staking Position from Single Token
Creates a farm staking position using a single token. The contract performs swaps to acquire the required staking tokens and initiates the staking process.
Process:
- User sends a single token as payment
- Contract performs swap operations to acquire the farm's staking token
- Tokens are staked in the farm staking contract
- Farm position tokens are returned to the user
Swap Operations Structure: Each swap operation in the list contains:
address: Address of the token pair for the swapmethod: Swap method (swapTokensFixedInputorswapTokensFixedOutput)token_identifier: Identifier of the output tokenmin_amount_out: Minimum output amount of the token
Payment: Any token listed in the DeFi
Request Body schema: application/jsonrequired
| scAddress required | string Auto Position Creator contract address |
| funcName required | string Value: "createFarmStakingPosFromSingleToken" |
| args required | Array of strings Arguments:
|
| value required | string Token payment to use for creating the farm staking position |
Responses
Request samples
- Payload
{- "scAddress": "klv1qqqqqqqqqqqqqpgqxyz...",
- "funcName": "createFarmStakingPosFromSingleToken",
- "args": [
- "address:klv1qqqqqqqqqqqqqpgqfarmstaking...",
- "BigUint:9500000",
- "address:klv1qqqqqqqqqqqqqpgqk762znj9v7nyky3wucdcw9awz83ppqy6c0nqhe2qaz",
- "string:swapTokensFixedInput",
- "string:KFI",
- "BigUint:9500000"
], - "value": "KLV=10000000"
}Response samples
- 200
{- "data": {
- "returnData": [
- "string"
], - "returnCode": "string",
- "returnMessage": "string"
}, - "error": "string",
- "code": "string"
}