{"id":20800844,"url":"https://github.com/Bucket-Protocol/bucket-protocol-sdk","last_synced_at":"2025-05-11T16:31:48.019Z","repository":{"id":188083824,"uuid":"677780695","full_name":"Bucket-Protocol/bucket-protocol-sdk","owner":"Bucket-Protocol","description":"Bucket Protocol TypeScript SDK","archived":false,"fork":false,"pushed_at":"2024-11-14T05:32:22.000Z","size":1159,"stargazers_count":13,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-14T06:27:51.678Z","etag":null,"topics":["blockchain","bucket-protocol","sdk","sui"],"latest_commit_sha":null,"homepage":"https://docs.bucketprotocol.io/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bucket-Protocol.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-12T16:04:17.000Z","updated_at":"2024-11-12T15:34:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"f222a127-2fd1-40ab-8893-b83925dc0d15","html_url":"https://github.com/Bucket-Protocol/bucket-protocol-sdk","commit_stats":null,"previous_names":["andreidev1/bucket-protocol-sdk","bucket-protocol/bucket-protocol-sdk"],"tags_count":64,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bucket-Protocol%2Fbucket-protocol-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bucket-Protocol%2Fbucket-protocol-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bucket-Protocol%2Fbucket-protocol-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bucket-Protocol%2Fbucket-protocol-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bucket-Protocol","download_url":"https://codeload.github.com/Bucket-Protocol/bucket-protocol-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225073009,"owners_count":17416536,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","bucket-protocol","sdk","sui"],"created_at":"2024-11-17T18:16:02.064Z","updated_at":"2025-05-11T16:31:48.002Z","avatar_url":"https://github.com/Bucket-Protocol.png","language":"TypeScript","funding_links":[],"categories":["**6\\. Detailed Data Tables of Financial Projects**","Client SDKs \u0026 Libraries"],"sub_categories":["**Table 1: Sui Ecosystem Financial Projects**","DeFi SDKs"],"readme":"# Bucket Protocol TypeScript SDK\n\nBucket Protocol aims to be a DeFi Engine on Sui network. It allow users to draw 0% interest loans against $SUI $BTC $ETH and LST used as collateral.\n\nLoans are paid out in $BUCK - a USD pegged stablecoin backed by multiple types of crypto, and need to maintain a minimum collateral ratio of 110%.\n\nIn addition to the collateral, the loans are secured by TANK containing $BUCK and by fellow borrowers collectively acting as guarantors of last resort.\n\n## Install Bucket Protocol\n\nInstall Bucket Protocol using npm : `npm i bucket-protocol-sdk`\n\nInstall Bucket Protocol using npm and git : `npm install https://github.com/Bucket-Protocol/bucket-protocol-sdk.git`\n\n## Quick start\n\nChoose a package ID based `mainnet` or `testnet` by replacing `packageType` value. By default package ID is set to `mainnet`.\n\n```ts\nimport { BucketClient } from 'bucket-protocol-sdk';\n\n// Instantiate BucketClient\nconst buck = new BucketClient();\n\n// Or create with rpc url\nconst buck = new BucketClient('https://sui-mainnet-endpoint.blockvision.org/');\n```\n\n## Become a stable swap and start earning rebates by integrating psmIn\n\n```ts\n// Build psmIn transaction\nconst tx = new Transaction();\n\nconst coinOut = await buck.psmSwapIn(\n  tx,\n  '0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN', // e.g USDC coin type\n  usdcInput, // usdc coin object\n  '0xdummy...', // referrer address\n);\n```\n\n## Query Bucket Protocol\n\n```ts\n// Return overall information\nawait buck.getProtocol();\n\n// Return all available bottles\nawait buck.getAllBottes();\n\n// Return all destroyed bottles\nawait buck.getDestroyedBottles();\n\n// Return all tanks\nawait buck.getAllTanks();\n\n// Return all psms\nawait buck.getAllPsms();\n\n// Return all fountains\nawait buck.getAllFountains();\n\n// Return all strap fountains\nawait buck.getAllStrapFountains();\n```\n\n## Query User state\n\n```ts\n// Return user tanks with address\nawait buck.getUserTanks(`0xdummy.....`);\n\n// Return user bottles with address\nawait buck.getUserBottles(`0xdummy.....`);\n\n// Return user positions with address\nawait buck.getUserLpProofs(`0xdummy.....`);\n```\n\n## Get borrow transaction\n\n```ts\nconst tx = new Transaction();\n\ntx = await buck.getBorrowTx(\n  tx,\n  `0x2::sui::SUI`,      // collateral coin type\n  1_000_000_000,        // collateral amount in raw\n  1_000_000_000,        // borrow amount in raw\n  `0xdummy...`,         // recipient address\n  true,                 // isUpdateOracle\n  `0xdummy...`,         // you can fetch with findInsertionPlace function\n  strapId,              // bottle's strapId\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBucket-Protocol%2Fbucket-protocol-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBucket-Protocol%2Fbucket-protocol-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBucket-Protocol%2Fbucket-protocol-sdk/lists"}