diff --git a/docs.json b/docs.json index 76f6bcc..3bee97e 100644 --- a/docs.json +++ b/docs.json @@ -213,51 +213,59 @@ }, { "group": "JUPITER", - "openapi": "./openapi/jupiter.json" - }, - { - "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", - "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" + "icon": "https://jup.ag/favicon.ico", + "pages": [ + "standard-blinks-library/jupiter/index", + "standard-blinks-library/jupiter/swap", + { + "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", + "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" + ] + } + ] + } + ] + } + ] } ] }, diff --git a/standard-blinks-library/index.mdx b/standard-blinks-library/index.mdx index 58da3b1..4bca440 100644 --- a/standard-blinks-library/index.mdx +++ b/standard-blinks-library/index.mdx @@ -4,30 +4,75 @@ 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. + + + 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. - \ No newline at end of file + diff --git a/standard-blinks-library/jupiter/borrow.mdx b/standard-blinks-library/jupiter/borrow.mdx new file mode 100644 index 0000000..3c17e40 --- /dev/null +++ b/standard-blinks-library/jupiter/borrow.mdx @@ -0,0 +1,7 @@ +--- +title: "Lend Borrow" +description: "Use your assets as collateral to take out loans with Jupiter Lend." +sidebarTitle: "Borrow" +--- + +TODO TODO TODO 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 new file mode 100644 index 0000000..6052e19 --- /dev/null +++ b/standard-blinks-library/jupiter/index.mdx @@ -0,0 +1,28 @@ +--- +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" +--- + +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 new file mode 100644 index 0000000..757a012 --- /dev/null +++ b/standard-blinks-library/jupiter/lend.mdx @@ -0,0 +1,28 @@ +--- +title: "Lend" +description: "Allow your users to earn yields on their assets or borrow against them." +sidebarTitle: "Introduction" +mode: "wide" +--- + +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. + + + + 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 new file mode 100644 index 0000000..1fec95a --- /dev/null +++ b/standard-blinks-library/jupiter/swap.mdx @@ -0,0 +1,7 @@ +--- +title: "Swap" +description: "Swap any token pair in your application using Jupiter." +sidebarTitle: "Swap" +--- + +TODO TODO TODO 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 diff --git a/standard-blinks-library/raydium/index.mdx b/standard-blinks-library/raydium/index.mdx new file mode 100644 index 0000000..e69de29