Skip to content

Commit

Permalink
Merge pull request #417 from ambrosus/enable-bridge-fee
Browse files Browse the repository at this point in the history
[RELAY] Enable bridge fee
  • Loading branch information
nacknime-official authored Dec 2, 2022
2 parents 8255585 + ebadfa7 commit 97c19db
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions relay/configs/prod-bsc.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"endpoint": "/fees",
"amb": {
"privateKey": "in env",
"minBridgeFeeUSD": 0,
"minBridgeFeeUSD": 5,
"minTransferFeeUSD": 1,
"explorerURL": "https://explorer-api.ambrosus.io",
"transferFeeRecipient": "0x",
Expand All @@ -63,7 +63,7 @@
},
"side": {
"privateKey": "in env",
"minBridgeFeeUSD": 0,
"minBridgeFeeUSD": 5,
"minTransferFeeUSD": 0.5,
"explorerURL": "https://api.bscscan.com/api?apikey=NFH875QU828E37MQD7XB3QHFBE4XTC2AKH",
"transferFeeRecipient": "0x",
Expand Down
4 changes: 2 additions & 2 deletions relay/configs/prod-eth.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"endpoint": "/fees",
"amb": {
"privateKey": "in env",
"minBridgeFeeUSD": 0,
"minBridgeFeeUSD": 5,
"minTransferFeeUSD": 10,
"explorerURL": "https://explorer-api.ambrosus.io",
"transferFeeRecipient": "0x",
Expand All @@ -87,7 +87,7 @@
},
"side": {
"privateKey": "in env",
"minBridgeFeeUSD": 0,
"minBridgeFeeUSD": 5,
"minTransferFeeUSD": 0.5,
"explorerURL": "https://api.etherscan.io/api?apikey=DY4Z86MQ2D9E24C6HB98PTA79EKJ5TQIFX",
"transferFeeRecipient": "0x",
Expand Down
4 changes: 2 additions & 2 deletions relay/configs/test-bsc.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"endpoint": "/fees",
"amb": {
"privateKey": "in env",
"minBridgeFeeUSD": 0,
"minBridgeFeeUSD": 5,
"minTransferFeeUSD": 1,
"explorerURL": "https://explorer-api.ambrosus-test.io",
"transferFeeRecipient": "0x",
Expand All @@ -63,7 +63,7 @@
},
"side": {
"privateKey": "in env",
"minBridgeFeeUSD": 0,
"minBridgeFeeUSD": 5,
"minTransferFeeUSD": 0.5,
"explorerURL": "https://api-testnet.bscscan.com/api?apikey=NFH875QU828E37MQD7XB3QHFBE4XTC2AKH",
"transferFeeRecipient": "0x",
Expand Down
4 changes: 2 additions & 2 deletions relay/configs/test-eth.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"endpoint": "/fees",
"amb": {
"privateKey": "in env",
"minBridgeFeeUSD": 0,
"minBridgeFeeUSD": 5,
"minTransferFeeUSD": 1,
"explorerURL": "https://explorer-api.ambrosus-test.io",
"transferFeeRecipient": "0x",
Expand All @@ -82,7 +82,7 @@
},
"side": {
"privateKey": "in env",
"minBridgeFeeUSD": 0,
"minBridgeFeeUSD": 5,
"minTransferFeeUSD": 0.5,
"explorerURL": "https://api-sepolia.etherscan.io/api?apikey=DY4Z86MQ2D9E24C6HB98PTA79EKJ5TQIFX",
"transferFeeRecipient": "0x",
Expand Down
3 changes: 2 additions & 1 deletion relay/internal/service_fee/fee/fee_bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import (
)

var percentFromAmount = map[uint64]int64{
0: 0.0 * 100, // 0.. ...$ => 0%
0: 1.0 * 100, // 0..100_000$ => 1%
100_000: 0.5 * 100, // 100_000...$ => 0.5%
}

func getBridgeFee(nativeUsdPrice, tokenUsdPrice, amount, minBridgeFee decimal.Decimal) (decimal.Decimal, error) {
Expand Down

0 comments on commit 97c19db

Please sign in to comment.