{"id":36437829,"url":"https://github.com/ThalaLabs/integrate-thala","last_synced_at":"2026-01-18T13:00:31.130Z","repository":{"id":264884015,"uuid":"881379084","full_name":"ThalaLabs/integrate-thala","owner":"ThalaLabs","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-01T10:36:46.000Z","size":40,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-01T12:30:31.622Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Move","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThalaLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-10-31T13:08:38.000Z","updated_at":"2025-10-01T10:36:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"a0542d13-3898-430d-987b-2fffbebbfa98","html_url":"https://github.com/ThalaLabs/integrate-thala","commit_stats":null,"previous_names":["thalalabs/thalaswap_integration","thalalabs/integrate-thala"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ThalaLabs/integrate-thala","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThalaLabs%2Fintegrate-thala","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThalaLabs%2Fintegrate-thala/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThalaLabs%2Fintegrate-thala/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThalaLabs%2Fintegrate-thala/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThalaLabs","download_url":"https://codeload.github.com/ThalaLabs/integrate-thala/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThalaLabs%2Fintegrate-thala/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28536686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T10:13:46.436Z","status":"ssl_error","status_checked_at":"2026-01-18T10:13:11.045Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-01-11T20:00:22.343Z","updated_at":"2026-01-18T13:00:31.114Z","avatar_url":"https://github.com/ThalaLabs.png","language":"Move","funding_links":[],"categories":["**8\\. Conclusion**"],"sub_categories":["**7.4 Security, Audits, and Formal Verification**"],"readme":"# ThalaSwap Integration\n\nThis repo is to help you integrate with ThalaSwap and/or ThalaProtocol. There are 2 steps:\n1. Copy the interface directory to your project. Example: `cp -r thalaswap_v1_interface my_project/`\n2. In your project, import it and use the methods provided. See any of the demo projects for examples (e.g. [`/thalaswap_v1_demo`](./thalaswap_v1_demo/) or [`/thalaswap_v2_demo`](./thalaswap_v2_demo/)).\n\n## Contract addresses\n\nThalaSwapV1: https://explorer.aptoslabs.com/account/0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af?network=mainnet\n\nThalaSwapV2: https://explorer.aptoslabs.com/account/0x007730cd28ee1cdc9e999336cbc430f99e7c44397c0aa77516f6f23a78559bb5?network=mainnet\n\nThalaSwapLens: https://explorer.aptoslabs.com/account/0xff1ac437457a839f7d07212d789b85dd77b3df00f59613fcba02388464bfcacb?network=mainnet\n\nThalaProtocol: https://explorer.aptoslabs.com/account/0x6f986d146e4a90b828d8c12c14b6f4e003fdff11a8eecceceb63744363eaac01?network=mainnet\n\n## ThalaSwap V1 Concepts\n\n### Pools (Base/Stable/Weighted)\n\n[`base_pool`](./thalaswap_v1_interface/sources/base_pool.move) covers common amm pool type parameters.\n\n[`stable_pool`](./thalaswap_v1_interface/sources/stable_pool.move) covers core stable pool amm logic.\n\n[`weighted_pool`](./thalaswap_v1_interface/sources/weighted_pool.move) covers core weighted pool amm logic.\n\nEach pool, weighted or stable, is its own resource under the ThalaSwapv1 resource account, `48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af`\n\nPools are indexed via type params consisting of pool asset \u0026 pool weight types. Pool weights are supported in increments of `5`.\n\n## ThalaSwap V2 Concepts\n\n### Pool\n\n[`pool`](./thalaswap_v2_interface/sources/pool.move) covers core amm logic assuming Fungible Assets.\n\nEach pool, either weighed pool or stable pool, is its own object. Pool addresses\ncan be found in either `ThalaSwapV2::pool::pools()` or `ThalaSwapLens::lens::get_pools_info()`.\n\n### Coin Wrapper\n\nWhile `pool` covers core amm logic assuming Fungible Assets, any coin-specific logic\nis left for [`coin_wrapper`](./thalaswap_v2_interface/coin_wrapper.move).\n\nAn example is creating a weighted pool. In `pool`, we have a method that\ntakes in FA metadata as input arguments:\n\n```\npublic entry fun create_pool_weighted_entry(\n    user: \u0026signer,\n    assets_metadata: vector\u003cObject\u003cMetadata\u003e\u003e,\n    ...\n)\n```\n\nIn `coin_wrapper`, a corresponding method that takes in generic type args can be found:\n\n```\npublic entry fun create_pool_weighted\u003cT0, T1, T2, T3\u003e(\n    user: \u0026signer,\n    assets_metadata: vector\u003cObject\u003cMetadata\u003e\u003e,\n    ...\n)\n```\n\nFor a Coin asset, make sure to pass in the right type arguments and `0xa` as a placeholder in `assets_metadata`.\nFor a Fungible Asset without a coin type, make sure to pass in\n`0x007730cd28ee1cdc9e999336cbc430f99e7c44397c0aa77516f6f23a78559bb5::coin_wrapper::Notacoin`\nas the type argument, and the FA metadata in `assets_metadata`. For example:\n\n- THL: T = 0x7fd500c11216f0fe3095d0c4b8aa4d64a4e2e04f83758462f2b127255643615::thl_coin::THL, asset_metadata = 0xa (0xa is a placeholder)\n- USDt: T = 0x007730cd28ee1cdc9e999336cbc430f99e7c44397c0aa77516f6f23a78559bb5::coin_wrapper::Notacoin, asset_metadata = 0x357b0b74bc833e95a115ad22604854d6b0fca151cecd94111770e5d6ffc9dc2b\n\n## ThalaProtocol Concepts\n\n### PSM V2\n\n[`psm_v2`](./thala_protocol_interface/sources/psm_v2.move) covers core PSM mint and redeem logic.\n\nEach PSM is its own object. PSM address for a given exchange asset can be found using `ThalaProtocol::psm_v2::psm_address(exchange_asset_metadata)`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FThalaLabs%2Fintegrate-thala","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FThalaLabs%2Fintegrate-thala","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FThalaLabs%2Fintegrate-thala/lists"}