Skip to content

Conversation

odiinnn
Copy link
Contributor

@odiinnn odiinnn commented Oct 13, 2025

NOTE

Please enable "Allow edits by maintainers" while putting up the PR.


  • If you would like to add a volume/fees/revenue adapter please submit the PR here.
  • If you would like to add a liquidations adapter, please refer to this readme document for details.
  1. Once your adapter has been merged, it takes time to show on the UI. If more than 24 hours have passed, please let us know in Discord.
  2. Sorry, We no longer accept fetch adapter for new projects, we prefer the tvl to computed from blockchain data, if you have trouble with creating a the adapter, please hop onto our discord, we are happy to assist you.
  3. Please fill the form below only if the PR is for listing a new protocol else it can be ignored/replaced with reason/details about the PR
  4. For updating listing info It is a different repo, you can find your listing in this file: https://github.com/DefiLlama/defillama-server/blob/master/defi/src/protocols/data2.ts, you can edit it there and put up a PR
  5. Do not edit/push package-lock.json file as part of your changes, we use lockfileVersion 2, and most use v1 and using that messes up our CI
  6. No need to go to our discord and announce that you've created a PR, we monitor all PRs and will review it asap

Name (to be shown on DefiLlama): PACT SWAP
Twitter Link: https://x.com/PACT_SWAP
List of audit links if any:
Website Link: https://pactswap.io/
Logo (High resolution, will be shown with rounded borders): https://drive.google.com/drive/folders/115wM26FRzTCi_Ctzyebdk4cJY07TqrqD?usp=drive_link
Current TVL: 280.05 k
Treasury Addresses (if the protocol has treasury)
Chain: BTC, ETH, BNB, TRX, POL, DOGE, LTC
Coingecko ID (so your TVL can appear on Coingecko, leave empty if not listed): (https://api.coingecko.com/api/v3/coins/list)
Coinmarketcap ID (so your TVL can appear on Coinmarketcap, leave empty if not listed): (https://api.coinmarketcap.com/data-api/v3/map/all?listing_status=active,inactive,untracked&start=1&limit=10000)
Short Description (to be shown on DefiLlama): PACT SWAP enables native BTC swaps 95% cheaper than THORChain, offers the same composability as Uniswap, supports permissionless listings, and matches the pricing users expect from retail CEX accounts — all without bridges, wrapped assets, KYCs or geo-blockers.
Token address and ticker if any:
Category (full list at https://defillama.com/categories) *Please choose only one: Dex
Oracle Provider(s): Specify the oracle(s) used (e.g., Chainlink, Band, API3, TWAP, etc.): n/a
Implementation Details: Briefly describe how the oracle is integrated into your project: n/a
Documentation/Proof: Provide links to documentation or any other resources that verify the oracle's usage: n/a
forkedFrom (Does your project originate from another project): -
methodology (what is being counted as tvl, how is tvl being calculated): TVL is currently calculated soly based on tokens in the orderbook: For bid limit orders, the amount of CWEB (quote) tokens locked in the order. For ask limit orders, the amount of base tokens promised by the order as well as the additional CWEB collateral enforcing the delivery of tokens.
Github org/user (Optional, if your code is open source, we can track activity): n/a

@llamabutler
Copy link

The adapter at projects/pactswap exports TVL:

coinweb                   145.75 k
bsc                       47.62 k
ethereum                  47.47 k
tron                      17.13 k
bitcoin                   14.52 k
doge                      3.25 k
polygon                   3.04 k
litecoin                  2.36 k

total                    281.14 k 

@odiinnn odiinnn marked this pull request as ready for review October 13, 2025 09:08
return api.getBalances();
}

module.exports.coinweb = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, the liquidity in pact swap sits on each of the supported chains, and they arent bridged to coinweb chain? In which case, balances should be recorded on the chains they are deposited to, eg bitcoin, ethereum etc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, they are not bridged to coinweb chain. But market maker should lock native cweb on coinweb chain to create any type of orders. Thats the reason why cweb included in tvl. Also market maker lock his tokens in destination chains, its also included in tvl.
Or may be i got you wrong?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should count user deposits to the DEX liquidity, on the chain it is deposited on. module.exports.coinweb should be equal to the amount of assets deposited on coinweb chain

Copy link
Contributor Author

@odiinnn odiinnn Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, on Pact Swap user can create orders. To create any type of orders ask/bid users should lock native cweb on coinweb chain. All this locked cweb is inside orders. For ask orders users also should lock base assets and cweb as collateral for every order.
We havent got liquidity pools, we are orderbook cross-chain dex. Orders exists on coinweb chain


const c2Orders = await fetch(`${PACTSWAP_API_URL}/getAllC2Orders?contractAddress=${c2ContractAddress}`).then(res => res.json())

let value = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to read contract balances directly from the chain opposed to using your API for token amounts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is possible. I will update the PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@waynebruce0x waynebruce0x self-assigned this Oct 13, 2025
@llamabutler
Copy link

The adapter at projects/pactswap exports TVL:

coinweb                   144.57 k
bsc                       47.96 k
ethereum                  47.45 k
tron                      17.12 k
bitcoin                   14.46 k
doge                      3.24 k
polygon                   2.96 k
litecoin                  2.37 k

total                    280.12 k 

@waynebruce0x
Copy link
Collaborator

Can we not use erc20:balanceOf() and the functions in our SDK? You can return a list of addresses from your API but reading balances straight from ethers is preferred. Is this part of coinweb EVM?

@odiinnn
Copy link
Contributor Author

odiinnn commented Oct 14, 2025

Pact Swap workin on Coinweb chain and not Coinweb EVM Shard. Coinweb is a chain with it own stores that are not compatible with ethers. Implementation with fetching claims from https://api-cloud.coinweb.io/wallet is native way to work with Coinweb chain and its wallet service part.
Also Pact Swap smart contracts are written on Coinweb chain on typescript (language to wright smart contracts on Coinweb chain).
So in general we cannot do like you described. Coinweb is not an EVM chain and its not compatible in current stage.
Also orders is specific struct of Pact Swap Coinweb contracts. We cannot just call balanceOf. User lock theirs tokens in orders on Coinweb chain.

There is some docs with explanation of how Pact Swap works - https://docs.pactswap.io/docs/technical-architecture/coinweb-integration-deep-dive
Docs about claims in Coinweb chain - https://docs.coinweb.io/develop/reactive-smart-contracts/develop-claims-storage

Please ask questions if something not clear for you here.

@waynebruce0x
Copy link
Collaborator

I'm confused - so does pact swap have tokens in held in contracts deployed on ethereum, bsc etc or not?

@odiinnn
Copy link
Contributor Author

odiinnn commented Oct 14, 2025

No directly it havent got locked tokens in contracts deployed on ethereum, bsc etc. Instead of lock tokens in this contracts Pact Swap lock tokens with PACT (Penalty Adjudication for Cross-chain Transactions) mechanism. Its mean that user lock native CWEB on Coinweb chain with promise to spend his tokens on ethereum, bsc etc to unlock this locked native CWEB. There is a doc about PACT from Coinweb chain - https://docs.coinweb.io/learn/usecases/pact . And the doc how Pact Swap use this PACT - https://docs.pactswap.io/docs/technical-architecture/collateral-efficiency-and-state-machines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants