From 9c791b59dc12ba1b2873170958d24a352bfba374 Mon Sep 17 00:00:00 2001 From: "bjoern.sol" Date: Fri, 21 Nov 2025 15:32:24 +0100 Subject: [PATCH 1/4] chore: test deploy --- docs.json | 48 ++++++++++++++++++++++- standard-blinks-library/index.mdx | 45 ++++++++++++++++----- standard-blinks-library/jupiter/index.mdx | 7 ++++ standard-blinks-library/jupiter/lend.mdx | 19 +++++++++ standard-blinks-library/jupiter/swap.mdx | 5 +++ standard-blinks-library/kamino/index.mdx | 1 + 6 files changed, 114 insertions(+), 11 deletions(-) create mode 100644 standard-blinks-library/jupiter/index.mdx create mode 100644 standard-blinks-library/jupiter/lend.mdx create mode 100644 standard-blinks-library/jupiter/swap.mdx create mode 100644 standard-blinks-library/kamino/index.mdx diff --git a/docs.json b/docs.json index 76f6bcc..ee263fc 100644 --- a/docs.json +++ b/docs.json @@ -213,7 +213,52 @@ }, { "group": "JUPITER", - "openapi": "./openapi/jupiter.json" + "icon": "https://res.cloudinary.com/dnxjhra4h/image/upload/v1763721553/jupiter-icon_lhjgb3.png", + "pages": [ + "standard-blinks-library/jupiter/index", + "standard-blinks-library/jupiter/swap", + "standard-blinks-library/jupiter/lend", + { + "group": "API Reference", + "openapi": "./openapi/jupiter.json", + "pages": [ + { + "group": "Swap", + "pages": [ + "GET /api/v0/swap/{tokenPair}", + "POST /api/v0/swap/{tokenPair}/{amount}" + ] + }, + { + "group": "Lend", + "pages": [ + { + "group": "Earn", + "pages": [ + "GET /api/v0/lend/earn/{vaultToken}/deposit", + "POST /api/v0/lend/earn/{vaultToken}/deposit", + "GET /api/v0/lend/earn/{vaultToken}/withdraw", + "POST /api/v0/lend/earn/{vaultToken}/withdraw" + ] + }, + { + "group": "Borrow", + "pages": [ + "GET /api/v0/lend/borrow/{vaultId}/deposit", + "POST /api/v0/lend/borrow/{vaultId}/deposit", + "GET /api/v0/lend/borrow/{vaultId}/{positionId}/borrow", + "POST /api/v0/lend/borrow/{vaultId}/{positionId}/borrow", + "GET /api/v0/lend/borrow/{vaultId}/{positionId}/repay", + "POST /api/v0/lend/borrow/{vaultId}/{positionId}/repay", + "GET /api/v0/lend/borrow/{vaultId}/{positionId}/withdraw", + "POST /api/v0/lend/borrow/{vaultId}/{positionId}/withdraw" + ] + } + ] + } + ] + } + ] }, { "group": "RAYDIUM", @@ -237,6 +282,7 @@ }, { "group": "KAMINO", + "pages": ["standard-blinks-library/kamino/index"], "openapi": "./openapi/kamino.json" }, { diff --git a/standard-blinks-library/index.mdx b/standard-blinks-library/index.mdx index 58da3b1..97eb927 100644 --- a/standard-blinks-library/index.mdx +++ b/standard-blinks-library/index.mdx @@ -4,30 +4,55 @@ sidebarTitle: "Introduction" description: "Production-ready APIs to construct transactions for Solana's top protocols. Instantly bring on-chain experiences into your app today." --- -Standard Blinks Library - Ready-to-use protocol endpoints +Standard Blinks Library - Ready-to-use protocol endpoints The Standard Blinks Library (SBL) provides production-ready APIs for creating transactions with Solana's most popular protocols. Instead of building integrations from scratch or learning complex protocol SDKs, use our tested endpoints to bring DeFi experiences into your app with simple HTTP requests. - ## Supported Protocols We support major protocols like Jupiter, Kamino, Raydium, Orca, Meteora, and more. For the complete list of available integrations, visit our [Supported Protocols](/markets/supported-protocols) page or browse protocols in the left sidebar menu. -Don't see what you're looking for? New protocols are added regularly—[request an integration](https://form.typeform.com/to/aLMntdWJ) and we'll help you get started. + Don't see what you're looking for? New protocols are added regularly—[request + an integration](https://form.typeform.com/to/aLMntdWJ) and we'll help you get + started. - ## Get Started - - + + Learn why teams are choosing APIs over SDKs for protocol integrations - + Build your first integration in 5 minutes with zero SDK complexity - - Explore ready-to-use APIs for swaps, lending, liquidity, and more + + +## Browse Protocols + + + + Jupiter is a decentralized exchange on Solana that allows you to swap + tokens, provide liquidity, and earn fees. + + + Kamino is a lending protocol on Solana that allows you to lend and borrow + tokens. - \ No newline at end of file + diff --git a/standard-blinks-library/jupiter/index.mdx b/standard-blinks-library/jupiter/index.mdx new file mode 100644 index 0000000..cddf873 --- /dev/null +++ b/standard-blinks-library/jupiter/index.mdx @@ -0,0 +1,7 @@ +--- +title: "Introduction to Jupiter" +description: "Learn how to integrate Jupiter in seconds in your application" +sidebarTitle: "Introduction" +--- + +Jupiter is a decentralized exchange on Solana that allows you to swap tokens, provide liquidity, and earn fees. diff --git a/standard-blinks-library/jupiter/lend.mdx b/standard-blinks-library/jupiter/lend.mdx new file mode 100644 index 0000000..8ffbf1f --- /dev/null +++ b/standard-blinks-library/jupiter/lend.mdx @@ -0,0 +1,19 @@ +--- +title: "Earn Yield with Jupiter" +description: "Integrate Jupiter Lend in your application to earn yield on your assets" +sidebarTitle: "Lend Tokens" +--- + +## Get Market Data + +## Deposit to Earn + +## Withdraw from Earn + +## Borrow Tokens + +## Repay Borrow + +## Withdraw Borrow + +## Track Positions diff --git a/standard-blinks-library/jupiter/swap.mdx b/standard-blinks-library/jupiter/swap.mdx new file mode 100644 index 0000000..1ccf144 --- /dev/null +++ b/standard-blinks-library/jupiter/swap.mdx @@ -0,0 +1,5 @@ +--- +title: "Swap Tokens with Jupiter" +description: "Learn how to swap tokens with Jupiter in your application" +sidebarTitle: "Swap Tokens" +--- diff --git a/standard-blinks-library/kamino/index.mdx b/standard-blinks-library/kamino/index.mdx new file mode 100644 index 0000000..89fa2c0 --- /dev/null +++ b/standard-blinks-library/kamino/index.mdx @@ -0,0 +1 @@ +# Kamino Introduction From d3e581aa8a4eaae103cb4c748a16afc62d329cb9 Mon Sep 17 00:00:00 2001 From: "bjoern.sol" Date: Fri, 21 Nov 2025 21:07:32 +0100 Subject: [PATCH 2/4] feat: jupiter earn --- docs.json | 56 +----- standard-blinks-library/index.mdx | 24 ++- standard-blinks-library/jupiter/borrow.mdx | 203 +++++++++++++++++++++ standard-blinks-library/jupiter/earn.mdx | 159 ++++++++++++++++ standard-blinks-library/jupiter/index.mdx | 24 ++- standard-blinks-library/jupiter/lend.mdx | 38 ++-- standard-blinks-library/jupiter/swap.mdx | 45 ++++- standard-blinks-library/raydium/index.mdx | 0 8 files changed, 480 insertions(+), 69 deletions(-) create mode 100644 standard-blinks-library/jupiter/borrow.mdx create mode 100644 standard-blinks-library/jupiter/earn.mdx create mode 100644 standard-blinks-library/raydium/index.mdx diff --git a/docs.json b/docs.json index ee263fc..3bee97e 100644 --- a/docs.json +++ b/docs.json @@ -213,11 +213,18 @@ }, { "group": "JUPITER", - "icon": "https://res.cloudinary.com/dnxjhra4h/image/upload/v1763721553/jupiter-icon_lhjgb3.png", + "icon": "https://jup.ag/favicon.ico", "pages": [ "standard-blinks-library/jupiter/index", "standard-blinks-library/jupiter/swap", - "standard-blinks-library/jupiter/lend", + { + "group": "Lend", + "pages": [ + "standard-blinks-library/jupiter/lend", + "standard-blinks-library/jupiter/earn", + "standard-blinks-library/jupiter/borrow" + ] + }, { "group": "API Reference", "openapi": "./openapi/jupiter.json", @@ -259,51 +266,6 @@ ] } ] - }, - { - "group": "RAYDIUM", - "openapi": "./openapi/raydium.json" - }, - { - "group": "SAVE", - "openapi": "./openapi/save.json" - }, - { - "group": "DEFITUNA", - "openapi": "./openapi/defituna.json" - }, - { - "group": "DEFICARROT", - "openapi": "./openapi/deficarrot.json" - }, - { - "group": "DRIFT", - "openapi": "./openapi/drift.json" - }, - { - "group": "KAMINO", - "pages": ["standard-blinks-library/kamino/index"], - "openapi": "./openapi/kamino.json" - }, - { - "group": "LULO", - "openapi": "./openapi/lulo.json" - }, - { - "group": "MARGINFI", - "openapi": "./openapi/marginfi.json" - }, - { - "group": "METEORA", - "openapi": "./openapi/meteora.json" - }, - { - "group": "ORCA", - "openapi": "./openapi/orca.json" - }, - { - "group": "SOLANA", - "openapi": "./openapi/solana.json" } ] }, diff --git a/standard-blinks-library/index.mdx b/standard-blinks-library/index.mdx index 97eb927..4bca440 100644 --- a/standard-blinks-library/index.mdx +++ b/standard-blinks-library/index.mdx @@ -45,14 +45,34 @@ We support major protocols like Jupiter, Kamino, Raydium, Orca, Meteora, and mor Jupiter is a decentralized exchange on Solana that allows you to swap tokens, provide liquidity, and earn fees. - + Kamino is a lending protocol on Solana that allows you to lend and borrow tokens. + + Raydium is a decentralized exchange on Solana that allows you to swap + tokens, provide liquidity, and earn fees. + + + Orca is a decentralized exchange on Solana that allows you to swap tokens, + provide liquidity, and earn fees. + diff --git a/standard-blinks-library/jupiter/borrow.mdx b/standard-blinks-library/jupiter/borrow.mdx new file mode 100644 index 0000000..7224c62 --- /dev/null +++ b/standard-blinks-library/jupiter/borrow.mdx @@ -0,0 +1,203 @@ +--- +title: "Lend Borrow" +description: "Use your assets as collateral to take out loans with Jupiter Lend." +sidebarTitle: "Borrow" +--- + +Use supplied assets as collateral to take out loans. Access liquidity without selling your holdings. + +Jupiter Borrow Flow - Collateralized borrowing process + +## What You Can Build + +### 1. Position Tracking Dashboard + +Monitor user positions with health factors, collateral, and debt: + +```typescript +// Fetch position data for vault 1 +const response = await fetch( + 'https://api.dial.to/v1/blink?apiUrl=https%3A%2F%2Fjupiter.dial.to%2Fapi%2Fv0%2Flend%2Fborrow%2F1%2Fdeposit', + { + headers: { + 'X-Blink-Client-Key': 'YOUR_CLIENT_KEY' + } + } +); + +const blink = await response.json(); +// Use blink.dataTable to display: position value, collateral, borrowed amount, health factor +``` + + + View API spec with position tracking examples + + +### 2. Market Rates Display + +Show current borrowing rates and available liquidity: + +```typescript +// Get market info for vault 1 +const marketData = await fetch( + 'https://jupiter.dial.to/api/v0/lend/borrow/1/deposit', + { + method: 'GET' + } +); + +// Display: APY, available to borrow, LTV ratio +``` + +### 3. Deposit Collateral Interface + +Allow users to add collateral to existing or new positions: + +```typescript +// Create deposit transaction for vault 1 +const depositTx = await fetch( + 'https://jupiter.dial.to/api/v0/lend/borrow/1/deposit', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + account: 'USER_WALLET_ADDRESS', + type: 'transaction', + amount: 0.8, // 0.8 SOL + positionId: 2433 // Optional: omit to create new position + }) + } +); +``` + + + See deposit API with examples + + +### 4. Borrow Interface + +Enable users to borrow against their collateral: + +```typescript +// Generate borrow transaction +const borrowTx = await fetch( + 'https://jupiter.dial.to/api/v0/lend/borrow/1/2433/borrow', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + account: 'USER_WALLET_ADDRESS', + type: 'transaction', + percentage: 50 // Borrow 50% of available capacity + }) + } +); +``` + + + See borrow API with examples + + +### 5. Repay & Withdraw Interfaces + +Build UIs for loan repayment and collateral withdrawal: + + + +```typescript Repay Loan +// Generate repay transaction +const repayTx = await fetch( + 'https://jupiter.dial.to/api/v0/lend/borrow/1/2433/repay', + { + method: 'POST', + body: JSON.stringify({ + account: 'USER_WALLET_ADDRESS', + type: 'transaction', + percentage: 100 // Full repayment + }) + } +); +``` + +```typescript Withdraw Collateral +// Generate withdraw transaction +const withdrawTx = await fetch( + 'https://jupiter.dial.to/api/v0/lend/borrow/1/2433/withdraw', + { + method: 'POST', + body: JSON.stringify({ + account: 'USER_WALLET_ADDRESS', + type: 'transaction', + amount: 0.5 // Withdraw 0.5 SOL + }) + } +); +``` + + + + +Always check the health factor before allowing withdrawals - users can only withdraw collateral that isn't required to maintain a healthy LTV ratio. + + +## Parameters + +**Vault ID**: Each lending market has a unique vault ID (e.g., `1` for SOL/USDC vault) + +**Position ID**: Each user position has a unique ID (e.g., `2433`). Returned when creating a new position. + + +Use the blink `dataTable` field to display real-time position metrics: collateral value, borrowed amount, available to borrow, health factor, and liquidation threshold. + + +## Full API Reference + + + + Add collateral to positions + + + Take out loans against collateral + + + Pay back borrowed assets + + + Remove collateral from positions + + diff --git a/standard-blinks-library/jupiter/earn.mdx b/standard-blinks-library/jupiter/earn.mdx new file mode 100644 index 0000000..a8506df --- /dev/null +++ b/standard-blinks-library/jupiter/earn.mdx @@ -0,0 +1,159 @@ +--- +title: "Lend Earn" +description: "Earn passive income with your assets using Jupiter Lend." +sidebarTitle: "Earn" +--- + +Our APIs give you the full picture of the Jupiter Lend market. It starts with reading the market rates, over depositing assets, tracking your positions, and withdrawing your assets. + +## Reading Data + +Jupiter Lend Earn Action + + + Please be aware that the `pk_demo` key is for testing purposes only! Request + your production API key by [getting in touch with + us](https://form.typeform.com/to/aLMntdWJ). + + +### Market Info + +To fetch the latest market rates, you can use our Markets API with the `jupiter` provider: + + + +```bash curl +curl -X GET "https://markets.dial.to/api/v0/markets?type=yield&provider=jupiter" \ + -H "x-dialect-api-key: pk_demo" +``` + +```typescript TypeScript +const response = await fetch( + " --url 'https://markets.dial.to/api/v0/markets?type=yield&provider=jupiter' \ +", + { + headers: { + "x-dialect-api-key": "pk_demo", + }, + } +); +``` + + + +For more information on how to use the market data, please see the [Understanding Market Data](/markets/quick-start#understanding-market-data) guide. + +### Positions + +To track your Jupiter Earn positions, use the Markets API. The response includes positions from all protocols, so you'll need to filter for Jupiter yield positions. + + + +```bash curl +curl --request GET \ + --url 'https://markets.dial.to/api/v0/positions/owners?walletAddresses=6JpNV6DK88auwzKVizdeT4Bw3D44sam5GqjcPCJ7y176' \ + --header 'x-dialect-api-key: pk_demo' +``` + +```typescript TypeScript +const response = await fetch( + "https://markets.dial.to/api/v0/positions/owners?walletAddresses=6JpNV6DK88auwzKVizdeT4Bw3D44sam5GqjcPCJ7y176", + { + method: "GET", + headers: { + "x-dialect-api-key": "pk_demo", + }, + } +); + +// Filter for Jupiter yield positions +const data = await response.json(); +const jupiterEarnPositions = data.positions.filter( + (pos) => pos.type === "yield" && pos.market.provider.id === "jupiter" +); +``` + + + + + Please note that we offer a second endoint that would allow you to track + **historical position data**, so that you can see how your positions have + changed over time. For more information, please see the [Historical Position + Data](/markets/history) guide. + + +## Actions + +Depending on the market type you will be able to take various actions. The Markets and Positions APIs will return you the blink URLs for each available action, but you can also look in the API reference section below. + +Jupiter Lend Earn Action + +### Deposit Assets + +To deposit assets, you can use our [Deposit API](/api-reference/lend-earn/deposit) that will return you a ready-to-sign transaction. + + + +```bash curl +curl --request POST \ + --url 'https://jupiter.dial.to/api/v0/lend/earn/USDC/deposit?percentage=10' \ + --header 'Content-Type: application/json' \ + --data '{ + "account": "6JpNV6DK88auwzKVizdeT4Bw3D44sam5GqjcPCJ7y176" +}' +``` + +```typescript TypeScript +const response = await fetch( + "https://jupiter.dial.to/api/v0/lend/earn/USDC/deposit?percentage=10", + { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + account: "6JpNV6DK88auwzKVizdeT4Bw3D44sam5GqjcPCJ7y176", + }), + } +); +``` + + + +### Withdraw Assets + +To withdraw assets, you can use our [Withdraw API](/api-reference/lend-earn/withdraw) endpoint. + + + +```bash curl +curl --request POST \ + --url 'https://jupiter.dial.to/api/v0/lend/earn/USDC/withdraw?percentage=10' \ + --header 'Content-Type: application/json' \ + --data '{ + "account": "6JpNV6DK88auwzKVizdeT4Bw3D44sam5GqjcPCJ7y176" +}' +``` + +```typescript TypeScript +const response = await fetch( + "https://jupiter.dial.to/api/v0/lend/earn/USDC/withdraw?percentage=10", + { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + account: "6JpNV6DK88auwzKVizdeT4Bw3D44sam5GqjcPCJ7y176", + }), + } +); +``` + + diff --git a/standard-blinks-library/jupiter/index.mdx b/standard-blinks-library/jupiter/index.mdx index cddf873..815e734 100644 --- a/standard-blinks-library/jupiter/index.mdx +++ b/standard-blinks-library/jupiter/index.mdx @@ -1,7 +1,27 @@ --- title: "Introduction to Jupiter" -description: "Learn how to integrate Jupiter in seconds in your application" +description: "Learn how to integrate Jupiter in seconds in your application and build amazing experiences for your users." sidebarTitle: "Introduction" --- -Jupiter is a decentralized exchange on Solana that allows you to swap tokens, provide liquidity, and earn fees. +Jupiter SBL Introduction Landing Page + +Jupiter is Solana's largest decentralized exchange (DEX) aggregator. It allows you to swap tokens, provide liquidity, and earn fees. With the SBL, you can integrate Jupiter in your application in seconds using only simple HTTP requests. + +## Supported Actions + + + + Swap any token pair on Jupiter. + + + Earn yields and borrow tokens. + + diff --git a/standard-blinks-library/jupiter/lend.mdx b/standard-blinks-library/jupiter/lend.mdx index 8ffbf1f..41a1870 100644 --- a/standard-blinks-library/jupiter/lend.mdx +++ b/standard-blinks-library/jupiter/lend.mdx @@ -1,19 +1,27 @@ --- -title: "Earn Yield with Jupiter" -description: "Integrate Jupiter Lend in your application to earn yield on your assets" -sidebarTitle: "Lend Tokens" +title: "Lend" +description: "Allow your users to earn yields on their assets or borrow against them." +sidebarTitle: "Introduction" --- -## Get Market Data +Jupiter Lend is a lending protocol on Solana that enables users to earn yields on their assets or borrow against them. The protocol automatically optimizes yields and provides flexible borrowing options without requiring users to manage multiple positions across different protocols. -## Deposit to Earn - -## Withdraw from Earn - -## Borrow Tokens - -## Repay Borrow - -## Withdraw Borrow - -## Track Positions + + + Supply assets to earn passive income + + + Use your supplied assets as collateral to take out loans + + + Loop your assets to multiply your yields + + diff --git a/standard-blinks-library/jupiter/swap.mdx b/standard-blinks-library/jupiter/swap.mdx index 1ccf144..39170aa 100644 --- a/standard-blinks-library/jupiter/swap.mdx +++ b/standard-blinks-library/jupiter/swap.mdx @@ -1,5 +1,44 @@ --- -title: "Swap Tokens with Jupiter" -description: "Learn how to swap tokens with Jupiter in your application" -sidebarTitle: "Swap Tokens" +title: "Swap" +description: "Swap any token pair in your application using Jupiter." +sidebarTitle: "Swap" --- + +Our Jupiter Swap API enables you to execute token swaps directly in your application with just a few lines of code. + +## Execute Swap + +To execute a swap, use our [Swap API](/api-reference/swap/execute) that will return you a ready-to-sign transaction. + + + +```bash curl +curl --request POST \ + --url https://jupiter.dial.to/api/v0/swap/SOL-Bonk/0.01 \ + --header 'Content-Type: application/json' \ + --data '{ + "account": "6JpNV6DK88auwzKVizdeT4Bw3D44sam5GqjcPCJ7y176" +}' +``` + +```typescript TypeScript +const response = await fetch( + "https://jupiter.dial.to/api/v0/swap/SOL-Bonk/0.01", + { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + account: "6JpNV6DK88auwzKVizdeT4Bw3D44sam5GqjcPCJ7y176", + }), + } +); +``` + + + + + The token pair format is `INPUT-OUTPUT` (e.g., `SOL-Bonk`) and the amount is + the quantity of the input token to swap. + diff --git a/standard-blinks-library/raydium/index.mdx b/standard-blinks-library/raydium/index.mdx new file mode 100644 index 0000000..e69de29 From af8188b8d821a06be5cd04d5ecfa5bd5d77afd27 Mon Sep 17 00:00:00 2001 From: "bjoern.sol" Date: Fri, 21 Nov 2025 21:26:46 +0100 Subject: [PATCH 3/4] chore: wording --- standard-blinks-library/jupiter/borrow.mdx | 198 +-------------------- standard-blinks-library/jupiter/swap.mdx | 39 +--- 2 files changed, 2 insertions(+), 235 deletions(-) diff --git a/standard-blinks-library/jupiter/borrow.mdx b/standard-blinks-library/jupiter/borrow.mdx index 7224c62..3c17e40 100644 --- a/standard-blinks-library/jupiter/borrow.mdx +++ b/standard-blinks-library/jupiter/borrow.mdx @@ -4,200 +4,4 @@ description: "Use your assets as collateral to take out loans with Jupiter Lend. sidebarTitle: "Borrow" --- -Use supplied assets as collateral to take out loans. Access liquidity without selling your holdings. - -Jupiter Borrow Flow - Collateralized borrowing process - -## What You Can Build - -### 1. Position Tracking Dashboard - -Monitor user positions with health factors, collateral, and debt: - -```typescript -// Fetch position data for vault 1 -const response = await fetch( - 'https://api.dial.to/v1/blink?apiUrl=https%3A%2F%2Fjupiter.dial.to%2Fapi%2Fv0%2Flend%2Fborrow%2F1%2Fdeposit', - { - headers: { - 'X-Blink-Client-Key': 'YOUR_CLIENT_KEY' - } - } -); - -const blink = await response.json(); -// Use blink.dataTable to display: position value, collateral, borrowed amount, health factor -``` - - - View API spec with position tracking examples - - -### 2. Market Rates Display - -Show current borrowing rates and available liquidity: - -```typescript -// Get market info for vault 1 -const marketData = await fetch( - 'https://jupiter.dial.to/api/v0/lend/borrow/1/deposit', - { - method: 'GET' - } -); - -// Display: APY, available to borrow, LTV ratio -``` - -### 3. Deposit Collateral Interface - -Allow users to add collateral to existing or new positions: - -```typescript -// Create deposit transaction for vault 1 -const depositTx = await fetch( - 'https://jupiter.dial.to/api/v0/lend/borrow/1/deposit', - { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify({ - account: 'USER_WALLET_ADDRESS', - type: 'transaction', - amount: 0.8, // 0.8 SOL - positionId: 2433 // Optional: omit to create new position - }) - } -); -``` - - - See deposit API with examples - - -### 4. Borrow Interface - -Enable users to borrow against their collateral: - -```typescript -// Generate borrow transaction -const borrowTx = await fetch( - 'https://jupiter.dial.to/api/v0/lend/borrow/1/2433/borrow', - { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify({ - account: 'USER_WALLET_ADDRESS', - type: 'transaction', - percentage: 50 // Borrow 50% of available capacity - }) - } -); -``` - - - See borrow API with examples - - -### 5. Repay & Withdraw Interfaces - -Build UIs for loan repayment and collateral withdrawal: - - - -```typescript Repay Loan -// Generate repay transaction -const repayTx = await fetch( - 'https://jupiter.dial.to/api/v0/lend/borrow/1/2433/repay', - { - method: 'POST', - body: JSON.stringify({ - account: 'USER_WALLET_ADDRESS', - type: 'transaction', - percentage: 100 // Full repayment - }) - } -); -``` - -```typescript Withdraw Collateral -// Generate withdraw transaction -const withdrawTx = await fetch( - 'https://jupiter.dial.to/api/v0/lend/borrow/1/2433/withdraw', - { - method: 'POST', - body: JSON.stringify({ - account: 'USER_WALLET_ADDRESS', - type: 'transaction', - amount: 0.5 // Withdraw 0.5 SOL - }) - } -); -``` - - - - -Always check the health factor before allowing withdrawals - users can only withdraw collateral that isn't required to maintain a healthy LTV ratio. - - -## Parameters - -**Vault ID**: Each lending market has a unique vault ID (e.g., `1` for SOL/USDC vault) - -**Position ID**: Each user position has a unique ID (e.g., `2433`). Returned when creating a new position. - - -Use the blink `dataTable` field to display real-time position metrics: collateral value, borrowed amount, available to borrow, health factor, and liquidation threshold. - - -## Full API Reference - - - - Add collateral to positions - - - Take out loans against collateral - - - Pay back borrowed assets - - - Remove collateral from positions - - +TODO TODO TODO diff --git a/standard-blinks-library/jupiter/swap.mdx b/standard-blinks-library/jupiter/swap.mdx index 39170aa..1fec95a 100644 --- a/standard-blinks-library/jupiter/swap.mdx +++ b/standard-blinks-library/jupiter/swap.mdx @@ -4,41 +4,4 @@ description: "Swap any token pair in your application using Jupiter." sidebarTitle: "Swap" --- -Our Jupiter Swap API enables you to execute token swaps directly in your application with just a few lines of code. - -## Execute Swap - -To execute a swap, use our [Swap API](/api-reference/swap/execute) that will return you a ready-to-sign transaction. - - - -```bash curl -curl --request POST \ - --url https://jupiter.dial.to/api/v0/swap/SOL-Bonk/0.01 \ - --header 'Content-Type: application/json' \ - --data '{ - "account": "6JpNV6DK88auwzKVizdeT4Bw3D44sam5GqjcPCJ7y176" -}' -``` - -```typescript TypeScript -const response = await fetch( - "https://jupiter.dial.to/api/v0/swap/SOL-Bonk/0.01", - { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - account: "6JpNV6DK88auwzKVizdeT4Bw3D44sam5GqjcPCJ7y176", - }), - } -); -``` - - - - - The token pair format is `INPUT-OUTPUT` (e.g., `SOL-Bonk`) and the amount is - the quantity of the input token to swap. - +TODO TODO TODO From 2d7b251ef06056e564bf90d2506c9b69e8df7410 Mon Sep 17 00:00:00 2001 From: "bjoern.sol" Date: Fri, 21 Nov 2025 21:36:42 +0100 Subject: [PATCH 4/4] chore: layout --- standard-blinks-library/jupiter/index.mdx | 1 + standard-blinks-library/jupiter/lend.mdx | 1 + 2 files changed, 2 insertions(+) diff --git a/standard-blinks-library/jupiter/index.mdx b/standard-blinks-library/jupiter/index.mdx index 815e734..6052e19 100644 --- a/standard-blinks-library/jupiter/index.mdx +++ b/standard-blinks-library/jupiter/index.mdx @@ -2,6 +2,7 @@ title: "Introduction to Jupiter" description: "Learn how to integrate Jupiter in seconds in your application and build amazing experiences for your users." sidebarTitle: "Introduction" +mode: "wide" ---