I want to understand Solana rent and it's relation to the CLI usage. I understand the basics, that you need 2 years worth of rent in order to be rent-exempt but I have several questions in order to reach a better understanding:
I have wallet keypair keypair.json
I run:
solana account keypair.json
Balance: 2.95953572 SOL
Owner: 11111111111111111111111111111111
executable: false
Rent Epoch: 280
Should I assume that rent is 280 lamports per. Epoch? Do I need to calculate this based on how many epochs in two year to figure out what sol is required for rent exempt? Isn't there an easier way simply find out rent-exempt requirements if I have the keypair file or even just the public key of an account? Usage of "solana rent" command is confusing since I have no idea of the "data length" of my account.
When running the following commands in order to create different types of accounts can I always assume that enough Sol is automatically put into the account for it to be rent-exempt?
spl-token create-account
spl-token create-multisig
When creating a nonce account i'm required to specify the amount to put into the nonce account? If I'm using this nonce account temporarily for a multisig process how much SOL should I put in there?
solana create-nonce-account nonce-keypair.json 1
If you want to know how rent is calculated you can use the solana rent CLI command.
For example, any account in the system that is not a data account (i.e. has no data requirement) will display the rent exempt minimal fee:
solana rent 0
Rent per byte-year: 0.00000348 SOL
Rent per epoch: 0.000002439 SOL
Rent-exempt minimum: 0.00089088 SOL
For program data accounts (i.e. any account that is created to be owned by a program to read/write state to) will be a higher cost because of the storage needs. Let's assume your program stores a PublicKey (32 bytes) in an account, then rent for that account is calculated:
solana rent 32
Rent per byte-year: 0.00000348 SOL
Rent per epoch: 0.000003048 SOL
Rent-exempt minimum: 0.0011136 SOL
Related
On Oracle Flexcube, in the sttm_cust_account table, there is an 'ACC_STATUS' column.
In this column value changes from/to 'OVER' <> 'NORM' on some conditions.
I need to find when and where this status changes? This status changes during EOD or changes with any JOB? Do anyone knows in which packages I can found logic?
I know the module where we can change manually status.
But now I need to find place where automatically changes these statuses
Thanks in advance
For Flexcube 14.0 and above is applicable that the automatic status change logic you must check the STATUS RULE button in Account class maintenance screen(Function_id:-STDACCLS).
The Automatic status change happens during EOD.
Also at the Account class level there is a Preference as Status change Automatic which you can override at the Account level
to indicate whether status change is automatic for this account class or account.
For Manual status change you have to refer the screen (function id:-STDSTCHN).
Please find the below from the manual regarding STATUS RULE maintenance
In this screen, you can define five conditions for each status applicable to an account class. An account will be said to be in a specific status if any one of the five conditions associated with the status holds true for an account. Conversely, if all the conditions are false, the account will automatically move to the next available status for which the condition is true.
A user defined status INTR is used for both OD and Loan accounts. When a loan is in adversity status and the customer pays the entire overdue amount, the status of the loan changes to a user defined account status ‘INTR’ rather than ‘NORM’, so would the other OD and loan accounts of the same customer across branches.
Only backward movement of any other status to INTR is applicable. The account status cannot change from NORM to INTR. The status sequence of INTR is maintained as the immediate sequence number next to NORM.
The following elements are available based on which you can build a condition for automatic status change. You can associate each of these elements with an account, in the ‘Customer Accounts Maintenance’ screen.
The set of elements are as follows:
Frozen
Dormant
No Debits
No Credits
Stop Payment
Current Status
In addition, the following elements will also be available for processing:
OD (overdraft) Days
Inactive Days
Overline Days
TOD (Temporary Overdraft) Days
Customer Classification
Due Count
Overdue Days
Customer Credit Ranking
Debit Interest Overdue Days
Overdue Limit Breach Days
Overdue Expiry Days
Overdue No Credit days
Principal Overdue Days
Principal Overdue Amount
Principal Overdue Local Currency Equivalent Amount
Interest Overdue Days
Interest Overdue Amount
Interest Overdue Local Currency Equivalent Amount
Charge Overdue Days
Charge Overdue Amount
Charge Overdue Local Currency Equivalent Amount
Account Interim Days
Appropriation Preference
You can define the appropriation sequence for overdraft accounts for each account status.
Appropriation sequence maintenance is mandatory if the ‘Component-wise Tracking for Overdraft’ is checked.
The appropriation preference sequence can be modified anytime and this will be applicable for the existing accounts also.This modification will effect only for future credits and appropriation.
Component with priority 1
Select the component with first priority from the adjoining drop-down list. The options available are:
Principal
Interest
Charge
Component with priority 2
Select the component with second priority from the adjoining drop-down list. The options available are:
Principal
Interest
Charge
Component with priority 3
Select the component with third priority from the adjoining drop-down list. The options available are:
Principal
Interest
Charge
Status Change for Overdraft Accounts
Oracle FLEXCUBE processes the status change for overdraft accounts based on the following rules:
Debit Interest OD Days
OD Limit Breach Days
OD Expiry Days
No Credit days
Account Interim Days
Debit Interest OD Days
The system processes the status change on overdraft account, if the customer fails to pay the debit interest of the overdraft account for specified number of days.
For example,
OD Utilization date: 01-Jan-2011
Days after which Status Change should happen: 90 Days
Debit interest due date: 01-Feb-2011
In this example, the system modifies the customer account status based on the status rule maintenance, if the customer fails to pay the debit interest by 02-May-2011.
OD Limit Breach Days
The system processes the status change on OD account, if the OD limit of the overdraft account is breached for a specified number of days. The system tracks the overdraft limit breach days based on the utilizations done at the line level.
OD Expiry Days
The system processes the status change on overdraft account, if the OD utilization of the overdraft account is not settled beyond the expiry date.
No Credit Days
The system processes the status change on OD account if there is no credit transaction into the overdraft account for a specified number of days.
Logical Operators
Logical Operators are indicators of certain conditions that you specify while building a rule. These operators are used in combination with the elements discussed earlier. The following is a list of logical operators that you would require to build a status rule:
Operator
Description
AND
The conjunction ‘and’
OR
The conjunction ‘or’
Greater than
=
Greater than or equal to (please note that there is no space between the two symbols)
<
Less than
<=
Less than or equal to (please note that there is no space between the two symbols)
< >
Not equal to (please note that there is no space between the two symbols)
=
Equal to
Oracle FLEXCUBE allows data store for tracking of SOD debit interest due. During Interest liquidation for debit interest, the system populates the SOD Debit Interest Due Data Store with the Amount Due as debit interest for the SOD utilized amount and the due date of payment for the interest amount.
The debit interest due amount is adjusted in the SOD utilized amount and the system checks for any credit entries for the SOD corresponding to the debit interest. During EOD, if any credit entry exists for the account, then the system does adjustments on the amount due for the SOD debit interest due data store. The system also adjusts the debit interest payment against the oldest available debit interest due amount, and so on.
Oracle FLEXCUBE provides SDEs for ‘SOD Due Count’ and ‘SOD Overdue Days’ for status rule generation. During EOD while running the status update batch, the system calculates SDE ‘SOD Due Count’ value as the count of the records having due amount not equal to zero from the SOD debit interest due data store. The system updates the ‘SOD Overdue Days’ with the number of days since the last debit interest payment done for the account.
Oracle FLEXCUBE provides an account status called ‘DIDF’ for an SOD account, which is available as part of ‘Status Rule Screen’. If the ‘SOD Due Count ’or ‘SOD Overdue Days’ satisfies the condition specified in the status change rule, then the system changes the status for the account to ‘DIDF’.
While running the status change batch, the system updates the ‘No Debit’ flag as ‘Y’ for ‘DIDF’ status account. If payment for the debit interest happens on the SOD account against the utilized amount, and if on recalculation the value of SDE ‘SOD Due Count’, or ‘SOD Overdue Days’ is not met, the status batch changes the status of the OD account from ‘DIDF’ to the previous account status and updates the ‘No Debit’ flag as ‘N’.
For more information you can check the CASA user manual
I'm working on e-learning academy system like udemy every instructor have wallets and wallets have three type of balance
1- total balance and it present total earning
2- available balance and it present earning that he can make payout or transfer it to his bank account
3- hold balance and it present earning that is not available for specific time then will be available to transfer it.
Project build by Laravel my issue how can I hold money for 14 days and after that make this money available without any action from my side I need logical idea to make it
can use cron job, or is anyone have this experience before ?
Let me break down the issue as per my understanding so we make sure I'm answering the correct question;
You have a system that has a wallet feature.
This wallet needs to hold some money and make the money unavailable to be paid out (hold status)
Then after 14 days, the money gets paid automatically without any interaction.
If I'm correct, then keep reading the answer below. If i'm not, correct me with a comment and I'll update my answer accordingly.
Answer:
We will create a new table. Let's call it pending_payments. It'll have the following information: user_id, payment_amount, pay_at
That table will hold information about pending payments and to which user they should be paid as well as the amount and the date it should be paid at.
We'll have a Laravel job that can be automated ( read this for more information: https://laravel.com/docs/9.x/scheduling) which will do the following:
a. Run daily on a specific time. Let's say at 13:00 daily for ease.
b. It'll check the pending_payments table for payments that should be paid today.
c. Pay them ( which means run whatever function/task you have to run in order to process the payment).
d. On a successful payment, remove the row from pending_payments table. And on a failure payment, log the error and insert the row again with a later date to be retried again later.
That's it.
Hi I'm new to SOLANA Blockchain , While gazing through the charges inside Solana, I found there is a fee associated with transaction like , minting tokens , transferring them , creating token accounts etc.. But there is another charge called Rent that is associated with an account as per the size of the instructions we are storing. But I'm confused that which account this rent is associated to.I'm using
1 Payer Account as payer in transactions , minting etc..
This Payer Account is also the owner of the spl-token that I created
2 Token account that holds the tokens
3 Normal wallets which are used for sending / receiving / minting tokens
4 Smart contracts to execute more operations , \
So I have 4 accounts as said above , so from which account solana will be taking the rent from,Please help ..
Thanks in Advance.
We're building a marketplace in NEAR. We have two smart contracts for token and marketplace. Same as NEAR example.
In our platform, we have successfully implemented below features:
Token mint (used contract method: nft_mint)
Token listing for sale at Fixed Price in marketplace (used contract methods: storage_deposit nft_approve)
Token purchase (used contract method: offer)
Apply creator royalty at mint time.
Apply service fee (Transaction fee of Marketplace) on each sale.
Everything is working fine.
Now, we would like to implement the Timed Auction Functionality
Creator can create NFT’s to be sold as an auction so that buyers can bid on them to get a higher price.
Method:- Sell to the highest bidder: where the highest bid wins at the end.
Making a bid on this kind of auction is like making an offer on a fixed-price listing. The seller can choose to accept it at any time, but the buyer will near of the amount of bid to create a bid.
Questions:
How we can implement the Timed Auction Functionality with Marketplace
Contract?
Do we have any documentation or example for the
Timed Auction Functionality?
Example of OpenSea's Timed Auction Functionality:
You can't do that directly from within a contract since the contract does not run all the time you will have to call function trough something like https://cron.cat/ or your own.
Contracts perceive time trough current execution so when a function is called env::block_timestamp_ms() within said fn would give us the current time of execution, you can subtract time from it to get some time in the past. We can do manual checks like is the time stamp past this than do that or the less accurate is the blockheight above certain threshold but all this will have to be executed within a function that needs to be called.
I will preface this post by saying that this is how I would go about solving this in a simple way. There are more complex solutions out there but I'll try and keep it relatively simple. (scroll to the bottom for a TLDR).
Here's a solution to the timed auction functionality. In the marketplace example that you posted, what you'll want to do is store two extra fields in the sale object indicating the desired length of the auction as well as the time when the sale was listed.
Whenever NFTs are put for sale (in the nft_on_approve function), you'll need to add the current block_timestamp (which will give you the number of nanoseconds since the Unix epoch). You'll also need to store the desired length of the auction which is up to you as to how you would like to implement that. It can be time in nanoseconds, milliseconds, seconds, days, either since the Unix epoch or the actual desired duration of the auction.
Once your sale object contains both these new fields, all you would need to do is whenever an offer is made, check if the current block timestamp is within the desired auction length. If it is, proceed, if it's not panic. Since the marketplace can't constantly be polling to see if the auction is finished, a common approach is to use the functionality I described above:
You either bid on the NFT before the timestamp or you didn't. If you did, your bid is accepted, if you don't, it panics.
At this point, there is no way for the marketplace to automatically transfer the NFT to the highest bidder the second the auction closes (due to the marketplace's inability to poll). My suggestion here would be to have a claim function that the highest bidder must call if they want the NFT transferred to them. You can get spicy with this and have timeouts whereby if it isn't claimed within 5 days, the original owner can claim it back but for the sake of simplicity, let's not get into that.
As for the bidding mechanic, there's many different ways you can do this. I'll go over one of the more simple approaches. Currently, when a sale is listed with sale conditions, the NFT can only be purchased for more than or equal to the price as shown here. What you'll want to do is store active bids in the sale object.
You'll need to store both the current highest bidder as well as their bid amount. This will be initialized to empty when the NFT is listed and then once an offer is made for less than the desired list price, it's considered a bid. Bids will only be added if they are less than the desired price and greater than the highest current bid. If the offer is more than the list price, the NFT is automatically sold and the purchase is processed.
Combining everything I've outlined so far in a TLDR:
What you would need to add as a minimum PoC to the sales object:
Store desired length of auction (in whatever format you want)
Store date of listing
Store current highest bidder
Store current highest bid
Listing mechanics:
When a sale is listed, set the date of listing and the desired length of the auction.
Offer mechanics:
make sure the attached deposit is greater than the current highest bid (if none, make sure it's >= 0).
If the attached deposit is greater than the list price, process the purchase. If it's not, add it as the current highest bid.
Make sure that the any offers are made within the desired length of the auction. If they aren't panic, if they are, you're good to go.
If somebody is outbid, make sure you refund them for their deposit!
Claim mechanics:
Claims can only be made if the auction time has passed. Only the highest bidder can claim the NFT. Once claimed, the purchase is processed.
I'm in the early stages of integrating Square payments. It makes sense in my application to allow users to save their card details, as we expect multiple small transactions. Square calls this feature 'cards on file'.
As part of this process you create a customer and a related card in Square's system; IDs for these will be held in my system and associated with my users; that way when they come to pay again they can select the option of using a card on file. The API to actually charge the card simply takes these two IDs and an amount.
What worries me is that my database is holding all the data necessary to charge a customer's card; I could write a script which just charges all of my customers an amount of money - naturally a hacker with access to my data could do the same thing.
I wasn't expecting to have this level of risk in my system - my assumption was that Square would have isolated me from this (via some sort of user challenge for missing data - e.g. the CCV number). It seems the safe option is to not use the 'card on file' feature and have the user re-enter every time.
Is this right, or have I completely misunderstood something here?
In order to charge a card, your Square access token is required along with the card ID. It's best practice to store that access token as an environment variable in order to limit the security risk. If someone gains access to the card IDs in your database, they won't be able to charge any of the cards without that access token that's associated with your developer account.
I did miss something - as any charge made on a customer's saved card is credited to my account (as configured in the Square portal), the only beneficiary of any fraudulent charge would be be me. A hacker could not get access to funds and therefore the risk is limited in scope.
Obviously if I was a fraudulent company there would be a risk to users - it seems the EU isn't happy with this and changes coming this year will require additional information to be captured from the user at the point of sale.
Strong Customer Authentication