Skip to content

Commit 7c7037f

Browse files
authored
Merge pull request #553 from JJ-Cro/update03072026
feat(v4.6.6): add Alpha LP and Prediction market APIs with corresponding request types and examples
2 parents 031b896 + 0428fac commit 7c7037f

61 files changed

Lines changed: 13399 additions & 10288 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/endpointFunctionList.md

Lines changed: 386 additions & 352 deletions
Large diffs are not rendered by default.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { RestClientV5 } from 'bybit-api';
2+
3+
const client = new RestClientV5({
4+
testnet: true,
5+
key: 'apikey',
6+
secret: 'apisecret',
7+
});
8+
9+
client.executeAlphaLPRedeem({ positionId: 12345, poolAddress: '0x1234567890abcdef', dercRatio: '0.5' })
10+
.then((response) => {
11+
console.log(response);
12+
})
13+
.catch((error) => {
14+
console.error(error);
15+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { RestClientV5 } from 'bybit-api';
2+
3+
const client = new RestClientV5({
4+
testnet: true,
5+
key: 'apikey',
6+
secret: 'apisecret',
7+
});
8+
9+
client.executeAlphaLPStake({ positionId: 0, poolAddress: '0x1234567890abcdef', payTokenAmount: '1000', payTokenCode: 'CEX_1', rangeUpper: '2000', rangeLower: '1800' })
10+
.then((response) => {
11+
console.log(response);
12+
})
13+
.catch((error) => {
14+
console.error(error);
15+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { RestClientV5 } from 'bybit-api';
2+
3+
const client = new RestClientV5({
4+
testnet: true,
5+
key: 'apikey',
6+
secret: 'apisecret',
7+
});
8+
9+
client.getAlphaLPOrderList({ orderType: 0, days: 7, limit: 20, pageIndex: 1 })
10+
.then((response) => {
11+
console.log(response);
12+
})
13+
.catch((error) => {
14+
console.error(error);
15+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { RestClientV5 } from 'bybit-api';
2+
3+
const client = new RestClientV5({
4+
testnet: true,
5+
key: 'apikey',
6+
secret: 'apisecret',
7+
});
8+
9+
client.getAlphaLPPayTokenList({})
10+
.then((response) => {
11+
console.log(response);
12+
})
13+
.catch((error) => {
14+
console.error(error);
15+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { RestClientV5 } from 'bybit-api';
2+
3+
const client = new RestClientV5({
4+
testnet: true,
5+
key: 'apikey',
6+
secret: 'apisecret',
7+
});
8+
9+
client.getAlphaLPPayTokenPrice({ tokenCode: ['CEX_1', 'CEX_2'] })
10+
.then((response) => {
11+
console.log(response);
12+
})
13+
.catch((error) => {
14+
console.error(error);
15+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { RestClientV5 } from 'bybit-api';
2+
3+
const client = new RestClientV5({
4+
testnet: true,
5+
key: 'apikey',
6+
secret: 'apisecret',
7+
});
8+
9+
client.getAlphaLPPoolInfo({ poolAddress: '0x1234567890abcdef' })
10+
.then((response) => {
11+
console.log(response);
12+
})
13+
.catch((error) => {
14+
console.error(error);
15+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { RestClientV5 } from 'bybit-api';
2+
3+
const client = new RestClientV5({
4+
testnet: true,
5+
key: 'apikey',
6+
secret: 'apisecret',
7+
});
8+
9+
client.getAlphaLPPoolList({ tokenSymbol: 'ETH' })
10+
.then((response) => {
11+
console.log(response);
12+
})
13+
.catch((error) => {
14+
console.error(error);
15+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { RestClientV5 } from 'bybit-api';
2+
3+
const client = new RestClientV5({
4+
testnet: true,
5+
key: 'apikey',
6+
secret: 'apisecret',
7+
});
8+
9+
client.getAlphaLPPositionList()
10+
.then((response) => {
11+
console.log(response);
12+
})
13+
.catch((error) => {
14+
console.error(error);
15+
});
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { RestClientV5 } from 'bybit-api';
2+
3+
const client = new RestClientV5({
4+
testnet: true,
5+
key: 'apikey',
6+
secret: 'apisecret',
7+
});
8+
9+
client
10+
.executeAlphaPredictionBuy({
11+
tokenId: 'token_yes_123',
12+
amount: '100',
13+
payTokenCode: 'USDC',
14+
orderType: 1,
15+
slippage: '0.05',
16+
eventId: 'event_123',
17+
})
18+
.then((response) => {
19+
console.log(response);
20+
})
21+
.catch((error) => {
22+
console.error(error);
23+
});

0 commit comments

Comments
 (0)