-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Add PactSwap #16651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add PactSwap #16651
Conversation
The adapter at projects/pactswap exports TVL:
|
return api.getBalances(); | ||
} | ||
|
||
module.exports.coinweb = { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
The adapter at projects/pactswap exports TVL:
|
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? |
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. There is some docs with explanation of how Pact Swap works - https://docs.pactswap.io/docs/technical-architecture/coinweb-integration-deep-dive Please ask questions if something not clear for you here. |
I'm confused - so does pact swap have tokens in held in contracts deployed on ethereum, bsc etc or not? |
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 |
NOTE
Please enable "Allow edits by maintainers" while putting up the PR.
package-lock.json
file as part of your changes, we use lockfileVersion 2, and most use v1 and using that messes up our CIName (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