Skip to content

Commit

Permalink
update: pf slippageTolerance
Browse files Browse the repository at this point in the history
  • Loading branch information
kunalroute committed Jan 22, 2024
1 parent bce03bb commit f87228e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ const getQuote = async () => {
amount: '10000000000000', // source amount
fromTokenChainId: '80001', // Mumbai
toTokenChainId: '43113', // Fuji
slippageTolerance: 1, // optional
additionalGasLimit: '100000', // Additional gas limit to execute instruction on dest chain
partnerId: 0, // (Optional) - For any partnership, get your unique partner id by contacting us on Telegram or emailing us at [email protected]
};
Expand Down Expand Up @@ -629,7 +630,6 @@ const getTransaction = async (quoteData) => {
try {
const res = await axios.post(txDataUrl, {
...quoteData,
slippageTolerance: 0.5,
senderAddress: '<sender-address>',
receiverAddress: '<receiver-address>',
contractMessage: '<contract-message or instruction>',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const params = {
'userAddress': 'YOUR_WALLET_ADDRESS',
'feeTokenAddress': '0x16ECCfDbb4eE1A85A33f3A9B21175Cd7Ae753dB4', // ROUTE on Polygon
'slippageTolerance': 2,
'partnerId': 24, // get your unique partner id by contacting us on Telegram
'partnerId': 0, // get your unique partner id by contacting us on Telegram
}


Expand All @@ -44,7 +44,8 @@ const params = {
'amount': '10000000', // 10 USDC (USDC token contract on Polygon has 6 decimal places)
'fromTokenChainId': 137, // Polygon
'toTokenChainId': 250, // Fantom
'partnerId': 24, // get your unique partner id by contacting us on Telegram
'slippageTolerance': 2, // optional
'partnerId': 0, // get your unique partner id by contacting us on Telegram
}
```

Expand All @@ -64,7 +65,6 @@ const getTransaction = async (params, quoteData) => {
try {
const res = await axios.post(txDataUrl, {
...quoteData,
slippageTolerance: 0.5,
senderAddress: "<sender-address>",
receiverAddress: "<receiver-address>",
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ const main = async () => {
destinationChainId: "80001",
destinationTokenAddress: "0x22bAA8b6cdd31a0C5D1035d6e72043f4Ce6aF054",
expandedInputAmount: "10000000",
slippageTolerance: "1"
});

// execute quote handles approval as well
const transaction = await pathfinder.executeQuote(
{
quote,
slippageTolerance: "1",
senderAddress: evmSigner.address,
receiverAddress: evmSigner.address,
refundAddress: evmSigner.address // (optional) By default equal to `senderAddress` if not provided
Expand Down Expand Up @@ -87,7 +87,6 @@ const main = async () => {
const transaction = await pathfinder.executeQuote(
{
quote,
slippageTolerance: "1",
senderAddress: evmSigner.address, // tron address
receiverAddress: evmSigner.address,
refundAddress: evmSigner.address // (optional) By default equal to `senderAddress` if not provided
Expand Down Expand Up @@ -128,11 +127,11 @@ const main = async () => {
destinationChainId: "80001",
destinationTokenAddress: "0x22bAA8b6cdd31a0C5D1035d6e72043f4Ce6aF054",
expandedInputAmount: "1000000000000000000",
slippageTolerance: "1",
});
const transaction = await pathfinder.executeQuote(
{
quote,
slippageTolerance: "1",
senderAddress: "joydeeeep.testnet",
receiverAddress: "0x40d5250D1ce81fdD1F0E0FB4F471E57AA0c1FaD3",
refundAddress: "joydeeeep.testnet" // (optional) By default equal to `senderAddress` if not provided
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const getTransaction = async (params, quoteData) => {
try {
const res = await axios.post(txDataUrl, {
...quoteData,
slippageTolerance: 0.5,
senderAddress: "<sender-address>",
receiverAddress: "<receiver-address>",
refundAddress: "<refundAddress>" // (optional) By default equal to `senderAddress` if not provided
Expand Down

0 comments on commit f87228e

Please sign in to comment.