{"id":22882259,"url":"https://github.com/uxdprotocol/uxd-client","last_synced_at":"2026-03-03T00:39:52.072Z","repository":{"id":36984792,"uuid":"483435848","full_name":"UXDProtocol/uxd-client","owner":"UXDProtocol","description":"JavaScript Client for the UXD Solana Program.","archived":false,"fork":false,"pushed_at":"2023-12-22T10:00:57.000Z","size":2589,"stargazers_count":14,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T04:47:29.706Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://uxd.fi","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UXDProtocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2022-04-19T23:04:54.000Z","updated_at":"2023-09-08T22:16:18.000Z","dependencies_parsed_at":"2023-02-16T19:45:28.814Z","dependency_job_id":"db724b35-7687-49d3-b571-66fdd5addc32","html_url":"https://github.com/UXDProtocol/uxd-client","commit_stats":{"total_commits":74,"total_committers":6,"mean_commits":"12.333333333333334","dds":0.6756756756756757,"last_synced_commit":"5761deca516a5afb1c8ec7f5dca8fe2d70881374"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UXDProtocol%2Fuxd-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UXDProtocol%2Fuxd-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UXDProtocol%2Fuxd-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UXDProtocol%2Fuxd-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UXDProtocol","download_url":"https://codeload.github.com/UXDProtocol/uxd-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252816522,"owners_count":21808702,"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":[],"created_at":"2024-12-13T18:16:30.846Z","updated_at":"2026-03-03T00:39:52.033Z","avatar_url":"https://github.com/UXDProtocol.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm][npm-image]][npm-url]\n\n[npm-image]: https://img.shields.io/npm/v/@uxd-protocol/uxd-client.svg\n[npm-url]: https://www.npmjs.com/package/@uxd-protocol/uxd-client\n\n# JavaScript Client for the UXD Solana Program\n\n## Install\n\n```\nnpm install --save @uxd-protocol/uxd-client\n```\n\n## Usage\n\n### About UXD on Solana\n\n#### Mainnet-Beta\n\n- UXD Program: _UXD8m9cvwk4RcSxnX2HZ9VudQCEeDH6fRnB4CAP57Dr_\n- UXD Mint: _7kbnvuGBxxj8AG9qp8Scn56muWGaRaFqxg1FsRp3PaFT_\n\n#### Devnet\n\n- UXD Program: _BA67esrWE7cPzQWtAftaTbrVWtmHZJ1PbbBBpZgpjH4p_\n- UXD Mint: _B8fvu55oqVmPzRFjo99wvnPXkuA2AcFBou5tstpeHFaR_\n\n#### Instantiate the Controller Object\n\n```javascript\nimport { Controller } from '@uxd-protocol/uxd-client';\n\nconst mainnetProgramId = new PublicKey('UXD8m9cvwk4RcSxnX2HZ9VudQCEeDH6fRnB4CAP57Dr');\n\nconst controller = new Controller(\n  'UXD',\n  6,\n  mainnetProgramId\n);\n```\n\n### Instantiate a Solana Connection\n\n```javascript\nimport { Connection } from '@solana/web3.js';\n\nconst connection = new Connection('https://api.mainnet-beta.solana.com');\n```\n\n### Instantiate the UXD Client\n\n```javascript\nimport { UXDClient } from '@uxd-protocol/uxd-client';\n\nconst mainnetProgramId = new PublicKey('UXD8m9cvwk4RcSxnX2HZ9VudQCEeDH6fRnB4CAP57Dr');\n\nconst client = new UXDClient(mainnetProgramId);\n```\n\n## Available Instructions\n\n### Public instructions\n\nAll public instructions are permissionless, anyone can use them at any point in time.\nNote that appart from mint/redeem, all other instructions do not have any parameter, and simply trigger a periodic maintainance action needed by the program.\n\n- `mint` (User can deposit USDC and receive UXD in exchange)\n- `redeem` (User can return UXD and receive USDC in exchange)\n- `collect_profits_of_mercurial_vault_depository` (Buyback UXP using profits)\n- `collect_profits_of_credix_lp_depository` (Buyback UXP using profits)\n- `rebalance_create_withdraw_request_from_credix_lp_depository` (automatic credix rebalance, step1)\n- `rebalance_redeem_withdraw_request_from_credix_lp_depository` (automatic credix rebalance, step2)\n\n### Instructions reserved for DAO governance\n\nThose instructions are internal instructions usable only by the UXP governance.\nThey will be used to configure and initialize the on-chain program states.\nEach instruction require the DAO's authority to sign the transaction.\n\n#### Controller (program's root state)\n\n- `initialize_controller`\n- `edit_controller`\n- `freeze_program`\n\n#### Identity depository (hold USDC)\n\n- `edit_identity_depository`\n- `initialize_identity_depository`\n- `mint_with_identity_depository`\n- `redeem_from_identity_depository`\n\n#### Mercurial vault depository (liquid on-chain investment)\n\n- `register_mercurial_vault_depository`\n- `edit_mercurial_vault_depository`\n- `mint_with_mercurial_vault_depository`\n- `redeem_from_mercurial_vault_depository`\n\n#### Credix lp depository (semi-liquid lending)\n\n- `register_credix_lp_depository`\n- `edit_credix_lp_depository`\n- `mint_with_credix_lp_depository`\n- `redeem_from_credix_lp_depository`\n\n## How to use\n\n### Javascript\n\nComplete example for a UXD mint:\n\n```ts\nimport { PublicKey, Connection, ComputeBudgetProgram } from '@solana/web3.js';\nimport { UXDClient } from '@uxd-protocol/uxd-client';\nimport { Controller } from '@uxd-protocol/uxd-client';\nimport { IdentityDepository } from '@uxd-protocol/uxd-client';\nimport { MercurialVaultDepository } from '@uxd-protocol/uxd-client';\nimport { CredixLpDepository } from '@uxd-protocol/uxd-client';\nimport { Controller } from '@uxd-protocol/uxd-client';\n\nconst uxdProgramId = new PublicKey('UXD8m9cvwk4RcSxnX2HZ9VudQCEeDH6fRnB4CAP57Dr');\nconst usdcMint = new PublicKey('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v');\n\n/**\n * Initialize UXD's data sources\n */\nconst client = new UXDClient(uxdProgramId);\nconst connection = new Connection('https://api.mainnet-beta.solana.com');\nconst controller = new Controller('UXD', 6, uxdProgramId);\nconst identityDepository = new IdentityDepository(\n  usdcMint,\n  'USDC',\n  6,\n  uxdProgramId\n);\nconst mercurialVaultDepository = await MercurialVaultDepository.initialize({\n  connection: connection,\n  collateralMint: {\n    mint: usdcMint,\n    name: 'USDC',\n    symbol: 'USDC',\n    decimals: 6,\n  },\n  uxdProgramId,\n});\nconst credixLpDepository = await CredixLpDepository.initialize({\n  connection: connection,\n  uxdProgramId: uxdProgramId,\n  collateralMint: usdcMint,\n  collateralSymbol: 'USDC',\n  credixProgramId: new PublicKey(\n    'CRDx2YkdtYtGZXGHZ59wNv1EwKHQndnRc1gT4p8i2vPX'\n  ),\n});\n\n/**\n * Generate and process the mint instruction and transaction\n */\nconst user: Signer = new Keypair(); // Use your keys here\nconst TXN_OPTS = {\n  commitment: 'confirmed',\n  preflightCommitment: 'confirmed',\n  skipPreflight: true,\n};\n\nconst mintInstruction = client.createMintWithCredixLpDepositoryInstruction(\n  controller,\n  identityDepository,\n  mercurialVaultDepository,\n  credixLpDepository,\n  user,\n  42, // ui amount to mint\n  TXN_OPTS\n);\nconst mintTransaction = new Transaction();\nmintTransaction.add(mintInstruction);\nmintTransaction.add(\n  ComputeBudgetProgram.setComputeUnitLimit({\n    units: 400_000,\n  })\n);\nmintTransaction.feePayer = user.publicKey;\n\nconst mintResult = await web3.sendAndConfirmTransaction(\n  connection,\n  mintTransaction,\n  [user],\n  TXN_OPTS\n);\n```\n\n### Rust\n\nFor a rust-based CPI call, please checkout the uxd-cpi repository:\n\nhttps://github.com/UXDProtocol/uxd-cpi\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuxdprotocol%2Fuxd-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuxdprotocol%2Fuxd-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuxdprotocol%2Fuxd-client/lists"}