curl --request POST \
--url https://hedgin.xyz/api/external/v1/transactions/dlmm/open \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"vault": "7Np41oeYqPefeNQEHSv1UDhYrehxin3NStELsSKCT4K2",
"lbPair": "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
"lowerBinId": -20,
"upperBinId": 20,
"amountX": "500000000",
"amountY": "75000000",
"shape": "spot",
"maxActiveBinSlippage": 5
}
'import requests
url = "https://hedgin.xyz/api/external/v1/transactions/dlmm/open"
payload = {
"vault": "7Np41oeYqPefeNQEHSv1UDhYrehxin3NStELsSKCT4K2",
"lbPair": "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
"lowerBinId": -20,
"upperBinId": 20,
"amountX": "500000000",
"amountY": "75000000",
"shape": "spot",
"maxActiveBinSlippage": 5
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
vault: '7Np41oeYqPefeNQEHSv1UDhYrehxin3NStELsSKCT4K2',
lbPair: '5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6',
lowerBinId: -20,
upperBinId: 20,
amountX: '500000000',
amountY: '75000000',
shape: 'spot',
maxActiveBinSlippage: 5
})
};
fetch('https://hedgin.xyz/api/external/v1/transactions/dlmm/open', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://hedgin.xyz/api/external/v1/transactions/dlmm/open",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'vault' => '7Np41oeYqPefeNQEHSv1UDhYrehxin3NStELsSKCT4K2',
'lbPair' => '5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6',
'lowerBinId' => -20,
'upperBinId' => 20,
'amountX' => '500000000',
'amountY' => '75000000',
'shape' => 'spot',
'maxActiveBinSlippage' => 5
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://hedgin.xyz/api/external/v1/transactions/dlmm/open"
payload := strings.NewReader("{\n \"vault\": \"7Np41oeYqPefeNQEHSv1UDhYrehxin3NStELsSKCT4K2\",\n \"lbPair\": \"5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6\",\n \"lowerBinId\": -20,\n \"upperBinId\": 20,\n \"amountX\": \"500000000\",\n \"amountY\": \"75000000\",\n \"shape\": \"spot\",\n \"maxActiveBinSlippage\": 5\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://hedgin.xyz/api/external/v1/transactions/dlmm/open")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"vault\": \"7Np41oeYqPefeNQEHSv1UDhYrehxin3NStELsSKCT4K2\",\n \"lbPair\": \"5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6\",\n \"lowerBinId\": -20,\n \"upperBinId\": 20,\n \"amountX\": \"500000000\",\n \"amountY\": \"75000000\",\n \"shape\": \"spot\",\n \"maxActiveBinSlippage\": 5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hedgin.xyz/api/external/v1/transactions/dlmm/open")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"vault\": \"7Np41oeYqPefeNQEHSv1UDhYrehxin3NStELsSKCT4K2\",\n \"lbPair\": \"5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6\",\n \"lowerBinId\": -20,\n \"upperBinId\": 20,\n \"amountX\": \"500000000\",\n \"amountY\": \"75000000\",\n \"shape\": \"spot\",\n \"maxActiveBinSlippage\": 5\n}"
response = http.request(request)
puts response.read_body{
"vault": "So11111111111111111111111111111111111111112",
"result": {
"transaction": "aSDinaTvuI8gbWludGxpZnk=",
"simulation": {
"unitsConsumed": 123,
"deferred": true
},
"ticket": "<string>",
"blockhash": "<string>",
"sendConcurrently": true,
"next": {
"path": "jupiter/sweep",
"body": {}
}
}
}{
"error": {
"code": "Validation",
"message": "vault must be a public key"
}
}{
"error": {
"code": "Unauthorized",
"message": "Invalid API key"
}
}{
"error": {
"code": "Forbidden",
"message": "Action is not enabled for this key"
}
}{
"error": {
"code": "NotFound",
"message": "Vault not found"
}
}{
"error": {
"code": "Stale",
"message": "pool price moved; refresh before flipping"
}
}{
"error": {
"code": "BodyTooLarge",
"message": "Request body is too large"
}
}{
"error": {
"code": "SlippageToleranceExceeded",
"message": "Transaction rejected during simulation or preflight"
}
}{
"error": {
"code": "RateLimited",
"message": "Too many requests, slow down"
}
}{
"error": {
"code": "Internal",
"message": "Service temporarily unavailable"
}
}{
"error": {
"code": "JupiterQuoteFailed",
"message": "Service temporarily unavailable"
}
}{
"error": {
"code": "RpcUnavailable",
"message": "Service temporarily unavailable"
}
}Open and fund DLMM position
Requires key scope dlmm/open.
Returns an unsigned v0 transaction for the manager to sign. Do not send payer: the API sets it to the key’s manager and rejects a body that contains it. Unknown fields are ignored. The key’s manager must be the vault’s current on-chain authority, and the vault must be in the key’s allowlist when the key has one.
Creates a position and adds liquidity. upperBinId is exclusive and the range spans at most 1400 bins. At least one of amountX and amountY must be greater than zero. A range of up to 70 bins returns one step, or two when the setup does not fit with the deposit. A wider range returns a batch: position creation, resize steps, and funding steps. The first step always carries position, lowerBinId, and the inclusive upperBinId.
curl --request POST \
--url https://hedgin.xyz/api/external/v1/transactions/dlmm/open \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"vault": "7Np41oeYqPefeNQEHSv1UDhYrehxin3NStELsSKCT4K2",
"lbPair": "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
"lowerBinId": -20,
"upperBinId": 20,
"amountX": "500000000",
"amountY": "75000000",
"shape": "spot",
"maxActiveBinSlippage": 5
}
'import requests
url = "https://hedgin.xyz/api/external/v1/transactions/dlmm/open"
payload = {
"vault": "7Np41oeYqPefeNQEHSv1UDhYrehxin3NStELsSKCT4K2",
"lbPair": "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
"lowerBinId": -20,
"upperBinId": 20,
"amountX": "500000000",
"amountY": "75000000",
"shape": "spot",
"maxActiveBinSlippage": 5
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
vault: '7Np41oeYqPefeNQEHSv1UDhYrehxin3NStELsSKCT4K2',
lbPair: '5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6',
lowerBinId: -20,
upperBinId: 20,
amountX: '500000000',
amountY: '75000000',
shape: 'spot',
maxActiveBinSlippage: 5
})
};
fetch('https://hedgin.xyz/api/external/v1/transactions/dlmm/open', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://hedgin.xyz/api/external/v1/transactions/dlmm/open",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'vault' => '7Np41oeYqPefeNQEHSv1UDhYrehxin3NStELsSKCT4K2',
'lbPair' => '5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6',
'lowerBinId' => -20,
'upperBinId' => 20,
'amountX' => '500000000',
'amountY' => '75000000',
'shape' => 'spot',
'maxActiveBinSlippage' => 5
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://hedgin.xyz/api/external/v1/transactions/dlmm/open"
payload := strings.NewReader("{\n \"vault\": \"7Np41oeYqPefeNQEHSv1UDhYrehxin3NStELsSKCT4K2\",\n \"lbPair\": \"5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6\",\n \"lowerBinId\": -20,\n \"upperBinId\": 20,\n \"amountX\": \"500000000\",\n \"amountY\": \"75000000\",\n \"shape\": \"spot\",\n \"maxActiveBinSlippage\": 5\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://hedgin.xyz/api/external/v1/transactions/dlmm/open")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"vault\": \"7Np41oeYqPefeNQEHSv1UDhYrehxin3NStELsSKCT4K2\",\n \"lbPair\": \"5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6\",\n \"lowerBinId\": -20,\n \"upperBinId\": 20,\n \"amountX\": \"500000000\",\n \"amountY\": \"75000000\",\n \"shape\": \"spot\",\n \"maxActiveBinSlippage\": 5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hedgin.xyz/api/external/v1/transactions/dlmm/open")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"vault\": \"7Np41oeYqPefeNQEHSv1UDhYrehxin3NStELsSKCT4K2\",\n \"lbPair\": \"5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6\",\n \"lowerBinId\": -20,\n \"upperBinId\": 20,\n \"amountX\": \"500000000\",\n \"amountY\": \"75000000\",\n \"shape\": \"spot\",\n \"maxActiveBinSlippage\": 5\n}"
response = http.request(request)
puts response.read_body{
"vault": "So11111111111111111111111111111111111111112",
"result": {
"transaction": "aSDinaTvuI8gbWludGxpZnk=",
"simulation": {
"unitsConsumed": 123,
"deferred": true
},
"ticket": "<string>",
"blockhash": "<string>",
"sendConcurrently": true,
"next": {
"path": "jupiter/sweep",
"body": {}
}
}
}{
"error": {
"code": "Validation",
"message": "vault must be a public key"
}
}{
"error": {
"code": "Unauthorized",
"message": "Invalid API key"
}
}{
"error": {
"code": "Forbidden",
"message": "Action is not enabled for this key"
}
}{
"error": {
"code": "NotFound",
"message": "Vault not found"
}
}{
"error": {
"code": "Stale",
"message": "pool price moved; refresh before flipping"
}
}{
"error": {
"code": "BodyTooLarge",
"message": "Request body is too large"
}
}{
"error": {
"code": "SlippageToleranceExceeded",
"message": "Transaction rejected during simulation or preflight"
}
}{
"error": {
"code": "RateLimited",
"message": "Too many requests, slow down"
}
}{
"error": {
"code": "Internal",
"message": "Service temporarily unavailable"
}
}{
"error": {
"code": "JupiterQuoteFailed",
"message": "Service temporarily unavailable"
}
}{
"error": {
"code": "RpcUnavailable",
"message": "Service temporarily unavailable"
}
}Authorizations
API key issued by a Hedgin administrator, in the form hv1_<id>_<secret>. <id> is 1 to 48 characters and <secret> is 32 to 128 characters, both from [A-Za-z0-9_-].
Body
Vault the transaction acts on.
^[1-9A-HJ-NP-Za-km-z]{32,44}$"So11111111111111111111111111111111111111112"
Base58 Solana public key. The server decodes it and rejects anything that is not 32 bytes.
^[1-9A-HJ-NP-Za-km-z]{32,44}$"So11111111111111111111111111111111111111112"
Exclusive end bin. Must be greater than lowerBinId.
Token X, base units.
20^\d+$"1000000"
Token Y, base units.
20^\d+$"1000000"
Meteora DLMM liquidity distribution.
spot, curve, bidAsk How many bins the pool's active bin may move before the transaction fails.
0 <= x <= 1000Response
Build result. One step or a batch. The first step adds position, lowerBinId, and upperBinId.
Base58 Solana public key. The server decodes it and rejects anything that is not 32 bytes.
^[1-9A-HJ-NP-Za-km-z]{32,44}$"So11111111111111111111111111111111111111112"
One unsigned transaction and its ticket. Builders can add action metadata fields next to these.
- Single step · object
- Batch · object[]
Show child attributes
Show child attributes
